Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help patching memory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
sylvanus
Advanced Cheater
Reputation: 0

Joined: 09 May 2006
Posts: 68

PostPosted: Thu Sep 11, 2008 5:48 pm    Post subject: Help patching memory Reply with quote

original bytes from 004B44E7 to 004B44ED is :

004B44E7 50 push eax
004B44E8 FF 75 DC push [ebp-24]
004B44EB 8D 45 CC lea eax,[ebp-34]

50 FF 75 DC 8D 45 CC --> 7 BYTES, sure?

view image please :

[img]http://img528.imageshack.us/my.php?image=originalivrf3.jpg[/img]



next, i am patching with 7 bytes too in 004B44E7 :

call CODECAVE (5 BYTES)
nop (1 BYTE) -----> 5 + 1 + 1 = 7 bytes
nop (1 BYTE)

this is my code :

if (status == true) {
FixMem(GetCurrentProcess(), (void*)IVADDY, 5, PAGE_EXECUTE_READWRITE, (DWORD*)oldprot);
IVADDY = 0x004B44E7;
*(BYTE*)IVADDY = 0xE8; // call is 1 byte
*(DWORD*)(IVADDY + 1) = JMP(IVADDY, itemvac);//address of codecave is 4 byte
*(DWORD*)(IVADDY + 5) = 0x90; //nop is 1 byte
*(DWORD*)(IVADDY + 6) = 0x90; //nop is 1 byte

1+ 4 + 1 + 1 = 7 bytes? sure?

BUT!, oh suprise,

original bytes from 004B44E7 to 004B44EB patching correct!
but...

MORE BYTES are PATCHED??

view image

[img]http://img204.imageshack.us/my.php?image=patchmemoryko8.jpg[/img]

too patch.. FROM

004B44EE to 004B44F3 ??

004B44EE 00 00 add [eax],al ??
004B44F0 00 c4 add ah,al ??
004B44F2 4e dec esi ??
004B44EE 89 00 mov [eax],eax ??

any help please??



patchmemory.jpg
 Description:
AFTER PATCH
 Filesize:  46.19 KB
 Viewed:  3312 Time(s)

patchmemory.jpg



original_iv.jpg
 Description:
THIS IS ORIGINAL CODE
 Filesize:  43.57 KB
 Viewed:  3312 Time(s)

original_iv.jpg




Last edited by sylvanus on Thu Sep 11, 2008 5:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Thu Sep 11, 2008 5:53 pm    Post subject: Reply with quote

*(DWORD*)(IVADDY + 5) = 0x90; //nop is 1 byte
*(DWORD*)(IVADDY + 6) = 0x90; //nop is 1 byte

WRONG!
It was supose to be like this:
Code:
*(BYTE*)(IVADDY + 5) = 0x90; //nop is 1 byte
*(BYTE*)(IVADDY + 6) = 0x90; //nop is 1 byte

or
Code:
*(WORD*)(IVADDY + 6) = 0x9090;

_________________
Gone
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu Sep 11, 2008 6:10 pm    Post subject: Reply with quote

BYTE DWORD DWORD DWORD = 13. You need 7.
Back to top
View user's profile Send private message MSN Messenger
sylvanus
Advanced Cheater
Reputation: 0

Joined: 09 May 2006
Posts: 68

PostPosted: Thu Sep 11, 2008 6:30 pm    Post subject: Reply with quote

Yeah,

I am a stupid, I am ancioso for my trainer finishes that I did not realize this small mistake

in 32 bits, registers eax, ebx are DWORD = 2 WORDS
D = double

1 word = 2bytes

eax = 2 word = 4 bytes

and 1byte = 1 byte jeje Smile

thanks GMZorita.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites