| View previous topic :: View next topic |
| Author |
Message |
e!ns7e!n Cheater
Reputation: 0
Joined: 06 Sep 2007 Posts: 30
|
Posted: Mon Jan 26, 2009 8:07 am Post subject: Delphi - write pointer |
|
|
how to write some value in pointer adress with this functions:
| Code: | function WriteByteString(offset : Cardinal; value : String) : Cardinal;
var
byteArray : TByteArray;
begin
if GetID(process,Pid) then
begin
Pidhandle:= OpenProcess(PROCESS_ALL_ACCESS, false, pId);
ByteStringToByteArray(value, byteArray);
WriteProcessMemory(Pidhandle, Pointer(offset), byteArray, length(byteArray), bytesWritten);
CloseHandle(Pidhandle);
end;
result:= bytesWritten;
end; |
if address is static - like that :
| Code: | | WriteByteString($00223344, '62 5C 6F 6F'); |
but if address is pointer like :
| Description: |
|
| Filesize: |
1.78 KB |
| Viewed: |
6670 Time(s) |

|
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Mon Jan 26, 2009 5:45 pm Post subject: |
|
|
getmodulehandle+offset
or for function:
getprocaddress+offset.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25813 Location: The netherlands
|
Posted: Mon Jan 26, 2009 7:51 pm Post subject: |
|
|
in case of my.dll+304c offsetcount=1 offset[0]: 44 :
getmodulehandle for my.dll
add 304c to that base address
read the 4 byte value stored at that location
add 44 to that value and then reador write the address that the new value represents
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Mon Jan 26, 2009 7:54 pm Post subject: |
|
|
| Dark Byte wrote: | in case of my.dll+304c offsetcount=1 offset[0]: 44 :
getmodulehandle for my.dll
add 304c to that base address
read the 4 byte value stored at that location
add 44 to that value and then reador write the address that the new value represents |
isn't this what I just said O.o...
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Mon Jan 26, 2009 8:06 pm Post subject: |
|
|
| no you showed you don't know what a pointer is
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Mon Jan 26, 2009 8:28 pm Post subject: |
|
|
| whoops didn't see the part about the pointer X.X...
|
|
| Back to top |
|
 |
e!ns7e!n Cheater
Reputation: 0
Joined: 06 Sep 2007 Posts: 30
|
Posted: Tue Jan 27, 2009 7:32 am Post subject: |
|
|
| Dark Byte wrote: | in case of my.dll+304c offsetcount=1 offset[0]: 44 :
getmodulehandle for my.dll
add 304c to that base address
read the 4 byte value stored at that location
add 44 to that value and then reador write the address that the new value represents |
ok i try but i'm not sure that i'm right...
| Code: | procedure TfrmMain.btnPatchClick(Sender: TObject);
var
dwModuleHandle : dword;
address7 : pbyte;
buffer2 : dword;
begin
if GetID(process,Pid) then
begin
Pidhandle := OpenProcess(PROCESS_ALL_ACCESS, false, dwModuleHandle);
dwModuleHandle := GetModuleHandle('my.dll'); //getmodulehandle for my.dll
address7 := PBYTE(dwModuleHandle + $304c); //add 304c to that base address
//read
ReadProcessMemory(Pidhandle,Pointer(address7), @buffer2 ,4,bytesWritten); //read the 4 byte value stored at that location
address7 := PBYTE(address7 + $44); //here is error!
//write
WriteProcessMemory(Pidhandle,Pointer(address7), @buffer2 ,4,bytesWritten);
end;
end; |
i'm not sure about the code and i've an error:
| Quote: | | Operator not applicable to this operand type |
p.p.
oops i saw my error
| Code: | | buffer2 := buffer2 + 44; | must be
but i have other questin because the pointer doesn't work....
the adress wich i want to hack isn't static and i scan for a pointer.
yesterday the address was 12345678 now he is 33345678 and the pointer is empty
what i have to do ?
whre is my mistake ?????
|
|
| Back to top |
|
 |
robedino Cheater
Reputation: 0
Joined: 03 Sep 2008 Posts: 48
|
Posted: Wed Jan 28, 2009 12:33 pm Post subject: |
|
|
maybe it's a multi-level pointer?
Dunno, I'm not very in to hacking withg Delphi, I want to learn it tho...
|
|
| Back to top |
|
 |
e!ns7e!n Cheater
Reputation: 0
Joined: 06 Sep 2007 Posts: 30
|
Posted: Fri Jan 30, 2009 6:07 am Post subject: |
|
|
i find the problem - code-shifting... but i really don't know how to change value of the address if i can't find the address :[
can somebody give me a code in delphi with wich i can find address or pointer wich work ? confuseddd
|
|
| Back to top |
|
 |
|