 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Mon Dec 31, 2007 12:27 pm Post subject: WPM question, again |
|
|
Well since I got all this allocating stuff to work I've got another problem.
I allocated memory on lulz (pointer).
so:
| Code: | | lulz := VirtualAllocEx(HandleWindow, nil, 128, MEM_RESERVE or MEM_COMMIT, PAGE_READWRITE); |
and now I want to write on $006DF140: call lulz
But I don't know how I should do that.
Help please
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25932 Location: The netherlands
|
Posted: Mon Dec 31, 2007 12:31 pm Post subject: |
|
|
e8 (addressoflulz-6DF140)-5
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping
Last edited by Dark Byte on Mon Dec 31, 2007 1:34 pm; edited 1 time in total |
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Mon Dec 31, 2007 12:48 pm Post subject: |
|
|
| Dark Byte wrote: | | e8 (addressoflulz-6d5140)-5 |
But how to use this?
like
| Code: | | WriteProcessMemory(HandleWindow, ptr($006DF140), $e8+(lulz-$6d5140)-5, 2, Write); |
or with ptr().
Well it's not working with this.
Explain how to use it please
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25932 Location: The netherlands
|
Posted: Mon Dec 31, 2007 12:56 pm Post subject: |
|
|
var callinstruction: array [0..4] of byte;
callinstruction[0]:=$e8;
pdword(@callinstruction[1])^:=(lulz-$006DF140)-5;
writeprocessmemory(processhandle, pointer($006DF140), @x[0],5,write);
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping
Last edited by Dark Byte on Mon Dec 31, 2007 1:35 pm; edited 1 time in total |
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Mon Dec 31, 2007 1:33 pm Post subject: |
|
|
for
| Code: | | pdword(@callinstruction[1])^:=(lulz-$6d5140)-5; |
It keeps saying:
[Error] Unit1.pas(500): Operator not applicable to this operand type
and what is $6d5140 actually?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25932 Location: The netherlands
|
Posted: Mon Dec 31, 2007 1:36 pm Post subject: |
|
|
I meant 006DF140
and if lulz isn't a dword but a pointer then typecast it to a dword.
pdword(@callinstruction[1])^:=(dword(lulz)-$006DF140)-5;
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Tue Jan 01, 2008 9:47 am Post subject: |
|
|
Thank you alot, it's working perfect.
You are god in these things. thx
Edit:
Well here's the script I want to "convert" to delphi:
| Code: | [Enable]
alloc(CSX,128)
alloc(CSY,128)
alloc(VACRange,4)
registerSymbol(VACRange)
VACRange:
dd 1E
CSX:
mov eax, [80c898]
push eax
mov eax, [eax+640]
pop eax
mov eax, [eax+648]
mov [ebx],eax
mov edi,[ebp+10]
ret
CSY:
mov eax, [80c898]
push eax
mov eax, [eax+644]
add eax,[VACRange]
pop eax
mov eax, [eax+64C]
mov [edi],eax
mov ebx,[ebp+14]
ret
006DF140:
call CSX
006DF1A5:
call CSY
[Disable]
006DF140:
mov [ebx],eax
mov edi,[ebp+10]
006DF1A5:
mov [edi],eax
mov ebx,[ebp+14]
dealloc(CSX)
dealloc(CSY)
dealloc(VACRange)
unregisterSymbol(VACRange) |
My only problem is the VACRange.
I tried this:
| Code: | lulz3 := VirtualAllocEx(HandleWindow, nil, $512, MEM_RESERVE or MEM_COMMIT, PAGE_READWRITE);
WriteProcessMemory(HandleWindow, lulz3, @test, 1, Write);
callinstruction3[0]:=$03;
callinstruction3[1]:=$05;
lulz4 := ptr(integer(lulz2)+12);
pdword(@callinstruction3[2])^:=(dword(lulz3)-dword(lulz4))-5;
WriteProcessMemory(HandleWindow, ptr(integer(lulz2)+12), @callinstruction3, 4, Write); //lulz2 is the allocation for CSY
|
vars:
| Code: | lulz, lulz2, lulz3, lulz4: pointer;
callinstruction3: array [0..4] of byte;
test: Array [0..15] of Byte=($1E, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00); |
If you don't understand this (I think it's not that easy) I can post the whole code.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|