nielskool Advanced Cheater
Reputation: 0
Joined: 03 Jun 2007 Posts: 65
|
Posted: Sat Oct 24, 2009 4:13 pm Post subject: delphi dll inject when value becomes... start procedure? |
|
|
heey guys,
i am trying to make a dll that shows a message when a value(in the host) changes to 1
i inject this dll in the program but it crashes everytime... maybe i need some help.
just started with this.
this is the code i use:
Code: |
library messdll;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
{$R *.res}
var
temp:cardinal;
buf:pchar;
begin
repeat
Sleep(500);
getmem(buf,4);
ReadProcessMemory(Application.Handle,ptr($02DC4F0A),buf,4,temp);
if(integer(buf) = 1) then
begin
showmessage('yeah you found it');
end;
freemem(buf);
until(false);
end.
|
P.S.
i now use a repeat and sleep, is there an other way to get the same result?
//edit
when i use:
Code: | library messdll;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
{$R *.res}
var
temp:cardinal;
buf:pchar;
begin
repeat
Sleep(500);
getmem(buf,4);
ReadProcessMemory(OpenProcess(PROCESS_ALL_ACCESS,False,Application.Handle),ptr($00947C3C),buf,4,temp);
showmessage(string(buf));
if(integer(buf) = 10) then
begin
showmessage('yeah you found it');
end;
freemem(buf);
until(false);
end.
|
it gave me some wierd text(4chars)
showmessage(string(buf));
or
showmessage(integer(buf));
doesn't matter gives same outputs
but spider solitait does not hang...
_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P |
|