blqxxxxxxx Cheater
Reputation: 0
Joined: 25 Aug 2009 Posts: 37
|
Posted: Sun Mar 28, 2010 12:51 pm Post subject: DLL Injecting |
|
|
HI guys . I have to inject a dll in counter-strike 1.6. I use this:
| Code: | function InjectDLL(dwPID: LongWord;szLibraryPath:String):Boolean;
var
dwWritten: Integer;
hProcess,hThread: THandle;
lpModule,lpBuffer: Pointer;
BytesWritten: Cardinal;
begin
hProcess := OpenProcess(PROCESS_ALL_ACCESS,False,dwPID);
if hProcess<>0 then
Result := False;
lpModule := GetProcAddress(GetModuleHandle('kernel32.dll'),'LoadLibraryA');
lpBuffer := VirtualAllocEx(hProcess,nil,StrLen(PChar(szLibraryPath))+1,MEM_COMMIT,BytesWritten);
WriteProcessMemory(hProcess,lpBuffer,@szLibraryPath,StrLen(PChar(szLibraryPath))+1,BytesWritten);
hThread := CreateRemoteThread(hProcess,nil,0,lpModule,lpBuffer,0,hThread);
if hThread<>0 then
Result := False;
CloseHandle(hThread);
CloseHandle(hProcess);
Result := True;
end; |
but this isn't working for cs. I dunno how to make injection btw this code works but for cs need to start the dll before you starting cs. Can someone help me?
Kind regards megaz0r
|
|