请叫高手,c++翻译成delphi(14分)

  • 主题发起人 主题发起人 nine_day
  • 开始时间 开始时间
N

nine_day

Unregistered / Unconfirmed
GUEST, unregistred user!
typedef struct _RemotePara//参数结构
{
char pLoadLibrary[256];
char pGetProcAddress[60];
DWORD dwGetProcAddress;
DWORD dwLoadLibrary;
}RemotePara;
DWORD WINAPI ThreadProc (RemotePara *lpPara)
{
typedef HMODULE (WINAPI *LOADLIBRARY)(LPCTSTR );
typedef DWORD (WINAPI *GETPROCADDRESS)(HMODULE,LPCSTR);
typedef BOOL (__cdecl *MYFUNC)(int,HWND);

LOADLIBRARY myLoadLibrary = (LOADLIBRARY)lpPara->dwLoadLibrary;
GETPROCADDRESS myGetProcAddress = (GETPROCADDRESS)lpPara->dwGetProcAddress;

HMODULE hDll = myLoadLibrary((LPCSTR)lpPara->pLoadLibrary);
MYFUNC init = (MYFUNC)myGetProcAddress(hDll,(LPCSTR)lpPara->pGetProcAddress);

init(0,(HWND)0x0070011E);

return 0;
}
 
type
PRemotePara = ^TRemotePara;
TRemotePara = record
pLoadLibrary : array[0..255] of Char;
pGetProcAddress: array[0..59] of Char;
dwGetProcAddress : DWORD;
dwLoadLibrary : DWORD;
end;

function ThreadProc(lpPara : PRemotePara) : DWORD
stdcall;
type
LOADLIBRARY = function(lpLibFileName: PChar): HMODULE
stdcall;
GETPROCADDRESS = function(hModule: HMODULE
lpProcName: LPCSTR): FARPROC
stdcall;
MYFUNC = function(p1 : Integer
p2 : HWND) : BOOL
cdecl;
var
myLoadLibrary : LOADLIBRARY;
myGetProcAddress : GETPROCADDRESS;
hDll : HMODULE;
init : MYFUNC;
begin
myLoadLibrary := Pointer(lpPara^.dwLoadLibrary);
myGetProcAddress := Pointer(lpPara^.dwGetProcAddress);
hDll := myLoadLibrary(lpPara^.pLoadLibrary);
init := myGetProcAddress(hDll,lpPara^.pGetProcAddress);
init(0,$0070011E);
Result := 0;
end;
 
多谢,在100分的问题里,又加了一段代码,目的是注入dll,分数不是问题,我可以都给你amli,只求帮我看看的我的程序。nine_day@163.com 我可以把vc的原程序给你,多谢!
 
后退
顶部