00577767    8B11            mov     edx, dword ptr [ecx]
00577769    53              push    ebx
0057776A    FF52 0C         call    dword ptr [edx+C]
0057776D    8B46 10         mov     eax, dword ptr [esi+10]     //esi+10是数据包结束地址
00577770    8B4E 0C         mov     ecx, dword ptr [esi+C]      //esi+C是数据包开始地址
00577773    8B56 30         mov     edx, dword ptr [esi+30]
00577776    2BC1            sub     eax, ecx
00577778    8D7E 28         lea     edi, dword ptr [esi+28]
0057777B    50              push    eax
0057777C    51              push    ecx
0057777D    52              push    edx
0057777E    8BCF            mov     ecx, edi
00577780    E8 EBE5EBFF     call    00435D70
0057776D    8B46 10         mov     eax, dword ptr [esi+10]     //esi+10是数据包结束地址
00577770    8B4E 0C         mov     ecx, dword ptr [esi+C]      //esi+C是数据包开始地址
我想从0057776D开始,把这里的数据包读出来,保存到一个文件里,而且让程序可以继续执行下去,当前已经有个DLL在目标程序内,有请高手上场……
500分不够了还可以再加

解决方案 »

  1.   

    不懂,不过可以参考下sniffer之类的软件
      

  2.   

    这些是我写的代码,运行的时候直接崩了,对这方面的知识了解不够,如果有部分是可用的,高手可以直接看着改改,节约时间
    procedure OutData(s:string;len:integer);     //输出到txt文件
    var
    F:TEXTFILE;
    OutStr:array[0..40] of  Char;
    begin
      CopyMemory(@OutStr,@s,len);
        AssignFile(F, 'C:\a.txt');
        Append(F);
        Writeln(F,':'+OutStr);
        Closefile(F);
    end;procedure MyData();               //截取,再让程序继续进行
    begin
      asm
      pushad
      mov eax, dword ptr [esi + $10]
      mov ecx, dword ptr [esi + $C]
      sub ecx,eax
      push ecx
      push eax
      call OutData
        popad
        mov eax, dword ptr [esi+$10]
      mov ecx, dword ptr [esi+$C]
    mov edx, dword ptr [$0057776D]
    add edx, 6
    jmp edx
      popad
      end;
    end;--------------------------------------------
    x:function():integer;  test:=$E9; //Jmp
      WriteProcessMemory (hProcess, Pointer($0057776D), @test, 1, tt);
      x:=addr(MyData);                                     //取函数地址?
      test:=x-$0057776D-$5;
      WriteProcessMemory (hProcess, Pointer($0057776E), @test, 4, tt);
      

  3.   

    先把
    OutData();     //输出到txt文件
    procedure MyData();               //截取,再让程序继续进行只把这两个处理函数写出来也行啊……绝对给分
      

  4.   

    我继续改,可惜它还是继续错
    Function OutData(s:Pointer;len:integer): Integer; stdcall;
    var
    F:TEXTFILE;
    ns:string;
    begin
      CopyMemory(@ns,@s,len);
        AssignFile(F, 'C:\a.txt');
        Append(F);
        Writeln(F,':'+ns);
        Closefile(F);
    end;function MyData(): Integer; stdcall;
    begin  asm
      pushad
            push eax                              // 这里push eax是为了用EAX放包长度
            push ecx                              // 这里push edx是为了用EDX放包指针
      mov eax, dword ptr [esi + $10]
      mov ecx, dword ptr [esi + $C]
      sub eax,ecx
      pushad                              // 这里pushad是为了下面调用输出信息时防止破坏原寄存器数据
      push eax
      push ecx
      call OutData
        popad                                // 恢复寄存器
        pop ecx                              // 恢复寄存器
        pop eax                              // 恢复寄存器
        mov eax, dword ptr [esi+$10]
      mov ecx, dword ptr [esi+$C]
    mov edx, dword ptr [$0057776D]
    add edx, 6
    jmp edx
      popad
      end;
    end;
    -----------------------------------------
    address2:^DWORD;address2:=@MyData;
      test:=$E9;
      WriteProcessMemory (hProcess, Pointer($0057776D), @test, 1, tt);
      test:=address2^-$0057776D-$5;
      WriteProcessMemory (hProcess, Pointer($0057776E), @test, 4, tt);
      

  5.   

    看来是没啥希望了有谁把这个ecx里的数据以数据包的16进制格式添加到listbox里就结帖了        push eax                              // 包长度
            push ecx                              // 包指针
            call OutData