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 


Replace with custom code instead of NOP OpCodes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Megamandos
How do I cheat?
Reputation: 0

Joined: 04 Aug 2009
Posts: 1

PostPosted: Mon Aug 10, 2009 8:59 pm    Post subject: Replace with custom code instead of NOP OpCodes Reply with quote

EDIT2: Figured it out. did the following:

Wrote this:

Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)

1A37C796:
jmp newmem
nop
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
mov ecx,[esi+30]
nop

originalcode:
mov [edx+eax*4],ecx
mov ecx,[esi+30]

exit:
jmp returnhere
       
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
1A37C796:
mov [edx+eax*4],ecx
mov ecx,[esi+30]


Then File>Assign to current cheat table.


ORIGINAL:
I am trying to make a cheat table or trainer for fear 2 v1.04. I found the codes that update ammo for weapons when they are fired, and I want to have it update the ammo to what that weapon currently is holding... I know this sounds weird but bare with me. I am trying not to have to go into explaining all the stuff I found out about how oddly they programmed fear 2.

Basically what I want to do is replace the code with something else instead of with "NOP" opcodes. And not have to open up assembler and edit the memory values every time I start up the game. And I don't want to have to patch any files to achieve this. So is there a way to have it replace code with my code instead of NOP opcodes?

EDIT: I guess a better way to ask is: will a cheat table/trainer (made by CE) be able to do assembler code injection?[/code]
Back to top
View user's profile Send private message AIM Address
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Tue Aug 11, 2009 7:01 am    Post subject: Reply with quote

You didn't have to create a code cave for this, you simply repalced the instructions order... a simpler way would be:
Code:
[Enable]
Address:
mov ecx,[esi+30]
mov [edx+eax*4],ecx

[Disable]
Address:
mov [edx+eax*4],ecx
mov ecx,[esi+30]
Back to top
View user's profile Send private message
Megamandos
How do I cheat?
Reputation: 0

Joined: 04 Aug 2009
Posts: 1

PostPosted: Tue Aug 11, 2009 7:27 pm    Post subject: Reply with quote

What is the disadvantage of using code caves? I mean, the small amount of memory they use up doesn't matter that much, does it?
Back to top
View user's profile Send private message AIM Address
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Wed Aug 12, 2009 7:01 am    Post subject: Reply with quote

It doesn't really matter in this case, I just thought you might want to know this since you're not using more than 5 bytes (size of far jmp/call) you could simply rewrite the original opcodes without a code cave and fill with NOPs if needed, shorter code.
Back to top
View user's profile Send private message
Megamandos
How do I cheat?
Reputation: 0

Joined: 04 Aug 2009
Posts: 1

PostPosted: Sat Aug 15, 2009 11:40 am    Post subject: Reply with quote

Oh ic, I just started learning asm a feww days ago. Thanks.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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