Auto Assembler - Example 2

Section's for general approaches on hacking various options in games. No online-related discussions/posts OR warez!
Post Reply
User avatar
TheyCallMeTim13
Administration
Administration
Posts: 1480
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 741

Auto Assembler - Example 2

Post by TheyCallMeTim13 »

[Link]
Auto Assembler - Example 2
Let's look at that the following example.

Note: All numbers in the Auto Assembler are read as [Link] format by default, use # or (int) for decimal format (base 10).
Note: Values written in a 0x* notation are in [Link] format.
[Link]


Main section
1. {$STRICT} When [Link] is present in your script, Cheat Engine will not assume that an undefined symbol is a [Link], and will give you an error instead. Note that this is optional. 3. define(address, GAME.exe+123ABC) This line [Link] or sets "address" to "GAME.exe+123ABC", i.e.: any where in this script we place "address" Cheat Engine will replace it with "GAME.exe+123ABC". 4. define(bytes, 0F 2F 05 7C A4 6A FE) This line [Link] or sets "bytes" to "0F 2F 05 7C A4 6A FE", i.e.: any where in this script we place "bytes" Cheat Engine will replace it with "0F 2F 05 7C A4 6A FE".
Enable section
8. [ENABLE] This line just denotes the start of the enable section. Note: Cheat Engine table scripts require an enable and disable section. 9. alloc(memSomeHook, 0x400, address) This line [Link] 0x400 bytes using the symbol "memSomeHook", near the address of address (which is "GAME.exe+123ABC"). 11. label(fltSomeHook) This creates a [Link] using the symbol "fltSomeHook". 12. registerSymbol(fltSomeHook) This [Link] "fltSomeHook" with the user symbol list. A registered symbol can be used in the disable section and else where on the table. 13. label(flgSomeHook) This creates a [Link] using the symbol "flgSomeHook". 14. registerSymbol(flgSomeHook) This [Link] "flgSomeHook" with the user symbol list. 15. label(ptrSomeHook) This creates a [Link] using the symbol "ptrSomeHook". 16. registerSymbol(ptrSomeHook) This [Link] "ptrSomeHook" with the user symbol list. 18. label(n_code) This creates a [Link] using the symbol "n_code". 19. label(o_code) This creates a [Link] using the symbol "o_code". 20. label(exit) This creates a [Link] using the symbol "exit". 21. label(return) This creates a [Link] using the symbol "return". 23. memSomeHook? This places the symbol, here it denotes to start assembling at the address of memSomeHook. 24. fltSomeHook? This places the symbol, here it denotes the placement of fltSomeHook. 25. dd (float)1 This sets the [Link] of the "fltSomeHook" as a data double word (4 bytes), with a float value of 1. 26. flgSomeHook? This places the symbol, here it denotes the placement of flgSomeHook. 27. db 00 This sets the [Link] of the "flgSomeHook" as a data byte, with a value of 0. 28. align 10 This will [Link] what comes after this line, it aligns at an address ending with 0x10, with the default padding byte of 0x0. 29. ptrSomeHook? This places the symbol, here it denotes the placement of ptrSomeHook. 30. dq 0 This sets the [Link] of the "ptrSomeHook" as a data quadword (8 bytes), with a value of 0x0. Note: ptrSomeHook will be used as a base address and in 64 bit mode 8 bytes is needed, but in 32 bit mode only 4 bytes is needed. 31. align 10 CC This will [Link] what comes after this line, it aligns at an address ending with 0x10, with a padding byte of 0xCC. 32. n_code? This places the symbol, here it denotes the placement of n_code, this will be the start of the new code. 33. mov [ptrSomeHook],rbx This will [Link] the value of [Link] into the value at the address (denoted by the [ and ]) of ptrSomeHook. 34. cmp byte ptr [flgSomeHook],0 This [Link] a byte pointer value at the address of flgSomeHook to 0x0 (as an immediate). 35. je o_code This will [Link], [Link] to the label o_code; i.e.: if the last compare equated to being equal. 36. cmp byte ptr [flgSomeHook],1 This [Link] a byte pointer value at the address of flgSomeHook to 0x1. 37. jne @f This will [Link], [Link] forward to the next label (denoted by the "@f", as "@b" would be for a label back); i.e.: if the last compare equated to being not equal. 38. movss xmm0,[fltSomeHook] This will [Link] [Link] of the value at the address of fltSomeHook into [Link]. 39. jmp o_code This will [Link] to the label o_code. 40. @@? This denotes a generic label, it can't be used by name is only useful with "@f" and "@b". 41. mov byte ptr [flgSomeHook],0 This will [Link] a byte value of 0x0 into the value at the address of flgSomeHook. 42. o_code? This places the symbol, here it denotes the placement of o_code, this will be the start of the original code. 43. movss [rbx+10],xmm0 This will [Link] [Link] of [Link] into the value at the address of [Link] plus 0x10. 44. exit? This places the symbol, here it denotes the placement of exit, this will be the start of the exit code, note that the exit label is not used so it could be removed with the [Link] declaration. 45. jmp return This will [Link] to the label return.
50. address? This places the symbol, here it denotes to start assembling at the address of address (which is "GAME.exe+123ABC"). 51. jmp n_code This will [Link] to the label n_code. This is the injection hook, as it hooks the code to do some thing else. Note that, in 64 bit mode, here is where the use of AllocateNearThisAddress with [Link] helps to insure a 5 byte jump. 52. nop This is a [Link] (no operation), here it is used a padding as the original instruction was more then 5 bytes. 54. return? This places the symbol, here it denotes the placement of return, this will be the return point.
Disable section
59. [DISABLE] This line just denotes the start of the disable section. 62. address? This places the symbol, here it denotes to start assembling at the address of address (which is "GAME.exe+123ABC"). 63. db bytes This denotes to start assembling data bytes using the symbol bytes (which is "0F 2F 05 7C A4 6A FE"). 65. unregisterSymbol(fltSomeHook) This [Link] "fltSomeHook" with the user symbol list. 66. unregisterSymbol(flgSomeHook) This [Link] "flgSomeHook" with the user symbol list. 67. unregisterSymbol(ptrSomeHook) This [Link] "ptrSomeHook" with the user symbol list. 68. dealloc(memSomeHook) This [Link] the memory at "memSomeHook".
See also
  • [Link]
  • [Link]
  • [Link]
  • [Link]
  • [Link]
  • [Link]
Last edited by TheyCallMeTim13 on Tue May 01, 2018 12:48 am, edited 7 times in total.

Post Reply

Who is online

Users browsing this forum: No registered users