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 


Auto Assembler

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

Joined: 12 Feb 2011
Posts: 46

PostPosted: Mon Apr 11, 2011 7:42 am    Post subject: Auto Assembler Reply with quote

Hey guys, I've a question about the Auto Assembler.

Is it possible to call a script without writing it into an address?

I mean, I've a code which runs when the address being called:
Code:
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(org)

"cm.exe"+102FC1:
jmp newmem
nop
nop
nop
nop
nop
returnhere:

newmem:
cmp [0075F40C],edx
JNE org
jmp exit

org:
inc [0075F40C]

originalcode:
mov [0075F40C],edx

exit:
jmp returnhere

"cm.exe"+102FC1:
jmp newmem
nop
nop
nop
nop
nop

[DISABLE]
dealloc(newmem)
"cm.exe"+102FC1:
mov [0075F40C],00000001


But I want to call this address myself. How can I do it?
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon Apr 11, 2011 10:02 am    Post subject: Reply with quote

You can't just call any code of the program when you wish without causing tons of errors (and probably immediate crash).

If you wish to change a value, that is another matter of course.

You can make a script to increase a stored address anytime, or just store the address, add it into the CE table and assign a key to it to change it anytime.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
scearezt
Cheater
Reputation: 0

Joined: 12 Feb 2011
Posts: 46

PostPosted: Mon Apr 11, 2011 10:50 am    Post subject: Reply with quote

It's not just a value, I want to run a whole script.
The script contains a "loop", which increasing a value until it reaches the final value which was a dynamic value. Or it can be a simple value change, but then how can I do that?:

Code:
mov [0075F40C],edx
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon Apr 11, 2011 11:13 am    Post subject: Reply with quote

If it is a loop, you should jump back from org to newmem to check, increase, check, increase... and exit at the end.
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
scearezt
Cheater
Reputation: 0

Joined: 12 Feb 2011
Posts: 46

PostPosted: Mon Apr 11, 2011 11:15 am    Post subject: Reply with quote

Yes I know but this script runs only when it's called by an another address... How can I call myself to loop it?
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon Apr 11, 2011 11:50 am    Post subject: Reply with quote

You can't just call any address anytime. The functions are built on each other. It is like if you would ask "how can I always take one step forward"? You can do that anytime, but depending on where you are, you can easily go into a wall, fall off from a cliff, get hit by a car at the middle of a road or whatever.

To avoid these accidents, you also need to change the whole environment. Some simple functions can be called anytime but calling a function randomly from an application is a sure way to crash the whole program as the environtment will not be the same as it should be when the function is executed. Taking a deep breath in space will not help in surviving, no matter how badly you want it.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
scearezt
Cheater
Reputation: 0

Joined: 12 Feb 2011
Posts: 46

PostPosted: Sun Apr 17, 2011 6:55 am    Post subject: Reply with quote

I've a new question...

Is it possible to compare an address' value to 2 value at once?

I've this code so far...

Code:
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(comp1)
label(comp2)

newmem:
cmp [0150FECC],19
jl comp1
cmp [0150FECC],1C
je comp2
jmp originalcode

comp1:
mov [0150FECC],19
jmp newmem

comp2:
mov [0150FECC],2D
jmp newmem

originalcode:
cmp dword ptr [0150FECC],27

exit:
jmp returnhere

"ga.exe"+489B2:
jmp newmem
nop
nop
returnhere:

Just a simple value comparing. If I'm not wrong, "je comp2" this means jumpIfEqual, is it possible to say: "jump if lower and bigger than"

Is it?

Thanks!
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Sun Apr 17, 2011 4:58 pm    Post subject: Reply with quote

You will need to make 2 compares and plan your instructions according to each results, or make some kind of loop and use a changing value for the same compare. Just for reference, here are the conditional jumps that you can use (a bit old reference but still quite useful).


Code:
Jxx - Jump Instructions Table
        Mnemonic              Meaning                    Jump Condition
          JA     Jump if Above                         CF=0 and ZF=0
          JAE    Jump if Above or Equal                CF=0
          JB     Jump if Below                         CF=1
          JBE    Jump if Below or Equal                CF=1 or ZF=1
          JC     Jump if Carry                         CF=1

          JCXZ   Jump if CX Zero                       CX=0
          JE     Jump if Equal                         ZF=1
          JG     Jump if Greater (signed)              ZF=0 and SF=OF
          JGE    Jump if Greater or Equal (signed)     SF=OF
          JL     Jump if Less (signed)                 SF != OF
          JLE    Jump if Less or Equal (signed)        ZF=1 or SF != OF
          JMP    Unconditional Jump                    unconditional

          JNA    Jump if Not Above                     CF=1 or ZF=1
          JNAE   Jump if Not Above or Equal            CF=1
          JNB    Jump if Not Below                     CF=0
          JNBE   Jump if Not Below or Equal            CF=0 and ZF=0
          JNC    Jump if Not Carry                     CF=0
          JNE    Jump if Not Equal                     ZF=0
          JNG    Jump if Not Greater (signed)          ZF=1 or SF != OF

          JNGE   Jump if Not Greater or Equal (signed) SF != OF
          JNL    Jump if Not Less (signed)             SF=OF
          JNLE   Jump if Not Less or Equal (signed)    ZF=0 and SF=OF
          JNO    Jump if Not Overflow (signed)         OF=0
          JNP    Jump if No Parity                     PF=0
          JNS    Jump if Not Signed (signed)           SF=0
          JNZ    Jump if Not Zero                      ZF=0

          JO     Jump if Overflow (signed)             OF=1
          JP     Jump if Parity                        PF=1
          JPE    Jump if Parity Even                   PF=1
          JPO    Jump if Parity Odd                    PF=0
          JS     Jump if Signed (signed)               SF=1
          JZ     Jump if Zero                          ZF=1

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
scearezt
Cheater
Reputation: 0

Joined: 12 Feb 2011
Posts: 46

PostPosted: Mon Apr 18, 2011 5:57 am    Post subject: Reply with quote

Thanks Geri, I've saved this table.

Aaaand here's what I've made:
Code:

alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(jmp1)
label(jmp2)
label(jmp3)
label(jmp4)
label(jmp5)
label(jmp6)
label(jmp7)
label(jmp8)
label(jmp9)
label(jmp10)
label(jmp11)
label(jmp12)
label(jmp13)
label(jmp14)
label(jmp15)
label(jmp16)
label(jmp17)
label(jmp18)
label(jmp19)
label(jmp20)
label(jmp21)

newmem:
cmp [0150FECC],1
je jmp1
cmp [0150FECC],18
je jmp2
cmp [0150FECC],1C //28
je jmp3
cmp [0150FECC],2C //44
je jmp4
cmp [0150FECC],2F //47
je jmp5
cmp [0150FECC],31 //49
je jmp6
cmp [0150FECC],3F //63
je jmp7
cmp [0150FECC],40 //64
je jmp8
cmp [0150FECC],42 //66
je jmp9
cmp [0150FECC],45 //69
je jmp10
cmp [0150FECC],6C //108
je jmp11
cmp [0150FECC],6D //109
je jmp12
cmp [0150FECC],73 //115
je jmp13
cmp [0150FECC],77 //119
je jmp14
cmp [0150FECC],7C //124
je jmp15
cmp [0150FECC],0F7 //247
je jmp16
cmp [0150FECC],105 //261
je jmp17
cmp [0150FECC],10D //269
je jmp18
cmp [0150FECC],11F //287
je jmp19
cmp [0150FECC],15D //349
je jmp20
cmp [0150FECC],165 //357
je jmp21
jmp originalcode

jmp1:
mov [0150FECC],19 //25
jmp newmem

jmp2:
mov [0150FECC],19 //25
jmp newmem

jmp3:
mov [0150FECC],2D //45
jmp newmem

jmp4:
mov [0150FECC],1B //27
jmp newmem

jmp5:
mov [0150FECC],32 //50
jmp newmem

jmp6:
mov [0150FECC],2E //46
jmp newmem

jmp7:
mov [0150FECC],41 //65
jmp newmem

jmp8:
mov [0150FECC],3E //62
jmp newmem

jmp9:
mov [0150FECC],46 //70
jmp newmem

jmp10:
mov [0150FECC],41 //65
jmp newmem

jmp11:
mov [0150FECC],6E //110
jmp newmem

jmp12:
mov [0150FECC],6B //107
jmp newmem

jmp13:
mov [0150FECC],78 //120
jmp newmem

jmp14:
mov [0150FECC],72 //114
jmp newmem

jmp15:
mov [0150FECC],0F8 //248 --- Don't begin Hexadecimal numbers with letters!
jmp newmem

jmp16:
mov [0150FECC],7B //123
jmp newmem

jmp17:
mov [0150FECC],10E //270
jmp newmem

jmp18:
mov [0150FECC],104 //260
jmp newmem

jmp19:
mov [0150FECC],15E //350
jmp newmem

jmp20:
mov [0150FECC],11E //286
jmp newmem

jmp21:
mov [0150FECC],165 //357
jmp newmem

originalcode:
cmp dword ptr [0150FECC],27

exit:
jmp returnhere

"ga.exe"+489B2:
jmp newmem
nop
nop
returnhere:


Just skipping some values when a key pressed and the value is a "specific" value.
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon Apr 18, 2011 6:27 am    Post subject: Reply with quote

Well I am not sure what is the purpose of this code but I noticed that jmp1 and jmp2 is doing the same so it would be enough to jump to jmp1 in both cases.

Quote:
Don't begin Hexadecimal numbers with letters!


It doesn't matter in CE. Your script will be compiled correctly anyway.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
scearezt
Cheater
Reputation: 0

Joined: 12 Feb 2011
Posts: 46

PostPosted: Sun Apr 24, 2011 8:50 am    Post subject: Debugger Reply with quote

Hey guys, I just don't want to open a new topic so... here's an another question.

What's breakpoints good for?
I'm disappointed in it 'Cuz I don't know what's the point of it...
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Sun Apr 24, 2011 12:00 pm    Post subject: Reply with quote

Set a breakpoint on a code and the program will stop if it reaches that point. Then you can debug the program (looking at registers, stepping, tracing etc etc).

http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles/225-basic-encryptions-debugging-backtracing-and-some-info-on-the-stack

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
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 Gamehacking 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