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 


Assembly newbie

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

Joined: 12 May 2009
Posts: 51
Location: Sweden

PostPosted: Tue May 12, 2009 12:13 pm    Post subject: Assembly newbie Reply with quote

I'm new to assembly, although I know other languages. I would like a brief explanation of some things in how assembly works.

When I allocate new memory and write code in that area, will that code ever excecute if I don't jump there? If not, why?

When creating one of those tick boxes in CE, where you write assembly code after [enable] and [disable], I've seen that the most common way to make the program run your code instead of the original code you write something like:

01646C4B:
jmp newmem
nop

All the examples I've seen only use one "nop", but I'm guessing you must use more nops if the instruction you're replacing is longer, or am I wrong?

If there are other stuff that are important to know that differs from other programming languages, please tell me.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue May 12, 2009 2:39 pm    Post subject: Reply with quote

code execution must be changed to the new memory for the code inside it to be run. there are other ways of changing code flow, like call.

long jmp takes 5 bytes the nop is not necessary. as long as you remember what instructions you overwrote and jmp back to an address with an instruction instead of halfway through you are good to go

assembly language.. differences ? more than there are similarities. when you code assembler try not to think high level

try to post examples of what you need help with exactly..
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

Joined: 09 May 2003
Posts: 25871
Location: The netherlands

PostPosted: Tue May 12, 2009 3:43 pm    Post subject: Reply with quote

the nops make it easier for the labeling system to deal with the return jump
e.g:
01646c4b: might be one 4 byte instruction and after that a 5 byte instruction.
Since the first one isn't enough, both instructions would be overwritten by the jmp, resulting in a total of 9 bytes of instruction code. The jump is 5 bytes, so followed by 4 nop's

Code:

01646c4b:
jmp mycode
nop
nop
nop
return:

mycode:
dosomething

finally:
originalinstruction1
originalinstruction2
jmp return

_________________
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
View user's profile Send private message MSN Messenger
Aqua Regia
Advanced Cheater
Reputation: 0

Joined: 12 May 2009
Posts: 51
Location: Sweden

PostPosted: Wed May 13, 2009 3:20 am    Post subject: Reply with quote

Thank you for your replies.

I recently learned python in which a code can look like this:

Code:

code1:
    a
    b
code2:
    c


a and b belongs to code1, and c belongs to code2. But there doesn't seem to be any indentation in assembler, does the computer just excecute all the unstructions from top to bottom?

Sometimes when I use the code injection template, I write in the adress, and the original code contains 2 lines of assembler, which confuses me.

What's the difference between call and jmp? Is it like calling a function and goto?
Back to top
View user's profile Send private message
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