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 


A Very In Depth Tutorial on Auto Assembler
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials
View previous topic :: View next topic  
Author Message
1gabbe1
Grandmaster Cheater Supreme
Reputation: 0

Joined: 13 Mar 2008
Posts: 1348
Location: 127.0.0.1

PostPosted: Wed Aug 12, 2009 2:28 pm    Post subject: Reply with quote

Great tut, I did not fully understand the "And/Or/Xor " part, but I'll read into it more and hopefully understand it better...
I started with completing the CE tut, then read this...
Now I'm trying to "hack" some basic games that comes with windows, and so far I'm doing good I think... (Making the timer go backwards or when your supposed to loose one point it adds 2 instead and stuff like that)
Thanks alot for this it really helped me!
Good luck on continued learning of asm scripting and once again, thanks!

_________________


FAIL:
http://www.youtube.com/watch?v=t9-CS2v8wcc
Look @ 1.02 on that vid...
Back to top
View user's profile Send private message
Infamous Joe
Newbie cheater
Reputation: 0

Joined: 15 Nov 2009
Posts: 12

PostPosted: Tue Dec 08, 2009 1:34 pm    Post subject: Reply with quote

Most indepth AAssembling guide I have ever read, thank you.
Back to top
View user's profile Send private message
rustyIND
How do I cheat?
Reputation: 0

Joined: 02 Dec 2009
Posts: 4
Location: Papeete

PostPosted: Wed Dec 09, 2009 6:04 am    Post subject: Auto Assembler Tutorial Reply with quote

Bonjour à tous,

je félicite DarkByte qui nous à sorti un excellent tutorial.
Bien organisé, trés clair, avec des exemples.
C'est super.
Pour ma part, j'ai beaucoûp appris.
Je ne dirai pas que je maitrîse mais seulement que j'en connais plus maintenant.
Je dormirai moins bête comme on dit.
C'est bien de reconnaître que tu es encore en apprentissage.
De toutes façons avec la progression des nouvelles technologies, il faut toujours se mettre à jour.
Toujours se mettre à jour.

Merci . Very Happy

_________________
Sorry for my English but I'm not too much opportunity to use it.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Kuzi117
How do I cheat?
Reputation: 0

Joined: 18 Dec 2009
Posts: 1
Location: Canada

PostPosted: Sat Dec 19, 2009 3:23 am    Post subject: Reply with quote

Great tut! Very Happy helped so much.
I'm such an AA noob!
Back to top
View user's profile Send private message
educofu
Expert Cheater
Reputation: 3

Joined: 21 Aug 2009
Posts: 171
Location: Brazil,MG,OP

PostPosted: Fri Apr 23, 2010 11:36 am    Post subject: Reply with quote

XOR = EXclusive OR

example:

a=0
b=1

a OR a = 0
a OR b = 1
b OR b = 1


a XOR a = 0
a XOR b = 1
b XOR b = 0 < this happens because "1" isnt exclusive.

hacksign23 wrote:
xor:
1 0 = 1
0 1 = 1
0 0 = 1
1 1 = 0



or is just:
1 0 = 1
0 1 = 1
0 0 = 0
1 1 = 1


0 XOR 0 = 0

_________________
"I finally started thinking outside of the box, only to find myself in a larger box."
Back to top
View user's profile Send private message MSN Messenger
Falc0n
Expert Cheater
Reputation: 1

Joined: 04 Apr 2009
Posts: 104

PostPosted: Fri Apr 23, 2010 5:43 pm    Post subject: Reply with quote

lOLI just remember XOR by

using xor eax, eax when I want to clear eax register LOL

so therefore, xoring the same thing by itself = 0 Razz
Back to top
View user's profile Send private message
Nayaden
How do I cheat?
Reputation: 0

Joined: 11 May 2010
Posts: 1

PostPosted: Tue May 11, 2010 2:35 pm    Post subject: Re: A Very In Depth Tutorial on Auto Assembler Reply with quote

Thanks for the tut.
Something to add.

Jump Instructions:
JZ: Jump if Zero
JNZ: Jump if Not Zero

XOR
The logical XOR (called exclusive-or) operation is a dyadic operation (meaning it accepts exactly two operands).
It is defined as follows:
Code:

0 xor 0 = 0
0 xor 1 = 1
1 xor 0 = 1
1 xor 1 = 0

In English, the logical XOR operation is, “If the first operand or the second operand, but not both, is one, the result is one; otherwise the result is zero.”
If one of the operands to the logical exclusive-OR operation is a one, the result is always the inverse of the other operand; that is, if one operand is one, the result is zero if the other operand is one and the result is one if the other operand is zero. If the first operand contains a zero, then the result is exactly the value of the second operand. This feature lets you selectively invert bits in a bit string.

LEA (Load Effective Address)
The lea instruction takes the form:
Code:

lea dest, source
lea reg16, mem
lea reg32, mem

It loads the specified 16 or 32 bit general purpose register with the effective address of the specified memory location.
The effective address is the final memory address obtained after all addressing mode computations. For example,
Code:

lea ax, ds:[1234h]

Loads the ax register with the address of memory location 1234h; here it just loads the ax register with the value 1234h.
Another useful example:
Code:

lea ax, 3[bx]

lea copies the address of the memory location 3[bx] into the ax register; i.e., it adds three with the value in the bx register and moves the sum into ax.

The Stack
The stack is where the CPU stores important machine state information, subroutine return addresses, procedure
parameters, and local variables.

A stack is a Last-In First-Out (LIFO) list. The stack is an area of memory that is organized in this fashion. The PUSH instruction adds data to the stack and the POP instruction removes data. The data removed is always the last data added (that is why it is called a last-in first-out list).

The push and pop instructions manipulate data on the stack.
The sp register (Stack Pointer) has a very special purpose – it maintains the program stack. Normally, you would not use this register for arithmetic computations. The proper operation of most programs depends upon the careful use of this register.
Code:

push reg16
pop reg16
push reg32
pop reg32

The first two instructions push and pop a 16 bit general purpose register. This is a compact (one byte) version designed specifically for registers. Note that there is a second form that provides a mod-reg-r/m byte that could push registers as well; most assemblers only use that form for pushing the value of a memory location.

The second pair of instructions push or pop use a32 bit general purpose register.
This is really nothing more than the push register instruction described in the previous paragraph with a size prefix byte.


Instructions
I believe everyone knows what an instruction is, and I understand what you are trying to explain, but your use of the OpCode term is a bit confusing.

Take this for example:
Code:

Mov X, Y
Add X, Z
Div Z, 2

Mov, Add, Div, Lea, etc. are indeed instructions, or if you want, you could name them commands.
Each instructions has it’s own OpCode (see bellow). But an Instruction, such as Mov, is not called an OpCode, it is called a mnemonic.

Because pure machine code is rather difficult to read by humans (because it’s nothing more than a string of numbers), it is often written in a more understandable form called assembly language, which gives each numeric opcode a special tag called an instruction mnemonic.

An assembler takes human readable assembly source code and converts it directly into machine code.
Machine code is a nearly exact, one-to one conversion of assembly language. It describes programs in terms of the same instructions with the same operands in the same order. The only difference is that assembly is the text-based, human readable version, and machine code is expressed entirely with numbers.
The difference between assembly language and machine code is (usually) a purely cosmetic one. The data itself is the same in either case; the only difference is how it’s expressed.

If the goal is to reduce this code to a form that can be expressed entirely through numeric data, the first order of business should be assigning each instruction a unique integer code. Let’s say Mov is assigned 0, Add is assigned 1, and Div is assigned 4 (assuming Sub and Mul take the 2 and 3 slots). The first attempt to reduce this to machine code will transform it into this:
Code:

0 X, Y
1 X, Z
4 Z, 2

Every assembler on earth really just boils down to a program that reads in instructions and maps them to numeric codes. Of course, these numeric codes have a name—they’re called opcodes. “Opcode” is an abbreviation of Operation Code. This makes pretty good sense, because each numeric code corresponds to a specific operation, as you’ve seen.

These are important terms, however, and a lot of people screw them up. Instructions can come in two forms; the numeric opcode that you’ve just seen, and the string-based mnemonic, which is the actual instruction name you’ve been using so far.

Thanks again!
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 11, 2010 4:07 pm    Post subject: Reply with quote

On 32 bit your lea is wrong and for stack it has to be dword aligned on x86
Back to top
View user's profile Send private message
ricekingrulz
Grandmaster Cheater
Reputation: 0

Joined: 13 Jun 2008
Posts: 984

PostPosted: Tue Jul 27, 2010 9:51 pm    Post subject: Reply with quote

Nice guide, learned quite a bit
Back to top
View user's profile Send private message
Teh1337Bix
Cheater
Reputation: 3

Joined: 22 Mar 2010
Posts: 37
Location: Australia

PostPosted: Tue Sep 28, 2010 10:09 am    Post subject: Reply with quote

You got the first section wrong Razz You forgot to mention the 8 bit registers (al ah bl bh ect...) and I don't think you should write so much about the representations of the registers because I haven't found proof of what you're saying. Other than that the tutorial looks okay, but I'll continue proof reading.
Back to top
View user's profile Send private message
1gabbe1
Grandmaster Cheater Supreme
Reputation: 0

Joined: 13 Mar 2008
Posts: 1348
Location: 127.0.0.1

PostPosted: Wed Oct 27, 2010 4:39 am    Post subject: Re: A Very In Depth Tutorial on Auto Assembler Reply with quote

samuri25404 wrote:
Calm down, though. In hexadecimal, the decimal 10 is replaced by A, the decimal 11 is replaced by B, and so forth up to F, which stands for 16. After that, it becomes 10, then 11, up until 1F, and then it starts over at 20, and so forth.


Even though it's a wery small error, F equals 15, not 16.
The reason it has the base 16 is because 0 counts.

_________________


FAIL:
http://www.youtube.com/watch?v=t9-CS2v8wcc
Look @ 1.02 on that vid...
Back to top
View user's profile Send private message
Dacnomania
Expert Cheater
Reputation: 1

Joined: 03 Sep 2010
Posts: 124

PostPosted: Mon Jan 10, 2011 12:39 am    Post subject: Reply with quote

I read this before I went to bed this morning . xP
I liked the tutorial, as I in fact never knew wtf that crap was, now I understand it, and it will help me hack games in a manner much differently.
Back to top
View user's profile Send private message Send e-mail AIM Address
stanoja
Cheater
Reputation: 0

Joined: 08 Mar 2007
Posts: 33
Location: Mk.

PostPosted: Fri Jan 21, 2011 12:41 pm    Post subject: Re: A Very In Depth Tutorial on Auto Assembler Reply with quote

Quote:

Code:

mov eax,[ebx]


This means "move the VALUE of ebx into the address that is stored within eax". Simply put, having the [brackets] around a register or address means the value of what is in the register or address.


No, this means that the VALUE of eax is going to be the value of the address of ebx. So ebx is just a pointer. When you use brackets you're taking the actual address of the register's value.
Both eax and ebx are just carrying a value, the value can be used both as address or value. When you need it as address, you just put brackets. At least that was on 8086 simulators...

You're words explain this:
Code:

mov [eax], ebx


And please correct me if I'm wrong Wink

_________________
Busy thinking...
Back to top
View user's profile Send private message Send e-mail
Nastri
How do I cheat?
Reputation: 0

Joined: 16 Jan 2010
Posts: 2

PostPosted: Sun Feb 27, 2011 10:28 pm    Post subject: GREAT TUTORIAL!!! Reply with quote

[quote="samuri25404]
...
---------------
III.a JMP
---------------

The JMP command is one of the most commonly used commands (around as common as the MOV command, which we will get to next). However, you don't see "JMP" nearly as much as you see "MOV" in opcodes and scripts, because there are many variations to the JMP command. There are way too many to list, but some are listed below.

JMP: Always jump to
JE/JZ: Jump to if equal
JNE/JNZ: Jump to if not equal
JA: Jump to if Above
JG: Jump to if Greater
JNA: Jump to if not Above
JNG: Jump to if not Greater
JB: Jump to if Below
JL: Jump to if Lower
JNB: Jump to if not Below
JNL: Jump to if not Lower
JAE: Jump to if Above or Equal
JGE: Jump to if Greater or Equal
JNAE: Jump to if not Above or Equal (i.e. JB)
JNGE: Jump to if not greater than or Equal (i.e. JL)

And you get the picture. Now this must seem confusing. "Jump to if greater", or JG is one of the Conditional Jumps. A conditional jump is as its name implies, it jumps when a certain condition is met. Usually, there is a "CMP" or compare function above it--more on that later. That's pretty much it for JMP. On to...
...
[/quote]
Nice tutorial Samuri, it helped me start doing my AA scripts. I would give you some money ... (but I don't have a job Laughing )
And using the AA is proving to be very helpful. Where I had to use a 19 level pointer( Shocked belive me it exists) I could make a 10 line script(less but I'm writing from the top of my head) to work the same way(and with a 20th of the headache to figure it out).

but...(there's always a but isn't it ? Mad )

There's a problem on how you explain the JMP command.(let me give the example, as I think it'll be easier to explain )

Code:

CMP A,B //compare A with B
JGE Somewhere


The question is:

The JGE command will jump to the Somewhere label when A>=B or when B>=A??

In the example of the tutorial you use a JNE(Jump if not equal) command and it doesn't give you this kind of trouble because if you ask wether is A<>B or B<>A you'll have the same answer but when you use some of the other JMP commands the problem apears.

Ps:(the "<>" sign means "is different of" to those who would ask later)

Sorry if I wrote something wrong. I'm from Brasil and English isn't my native language.
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Mon Feb 28, 2011 5:51 am    Post subject: Re: GREAT TUTORIAL!!! Reply with quote

Nastri wrote:
The JGE command will jump to the Somewhere label when A>=B or when B>=A??

In that case, the JGE operation will only jump to Somewhere if A is greater than or equal to B (by a signed comparison).


Last edited by Innovation on Thu Apr 19, 2012 4:53 pm; edited 1 time in total
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 Tutorials -> Auto Assembler tutorials All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
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