So, I was thinking on making a code where with the press of a button, I'll transfer my character's max health value into their current health value. I already got the pointers for both values (involving quite the hellish AOB shenanigans, I might add).
Originally, I wanted to make it happen automatically after every battle, hijacking an opcode that seems to be active every time a battle ends (replacing the register's value in a mov function) But I tried fiddling with it and the game crashes as a result.
It's the same principle with multiplying a value with a button, I guess, which I always wanted since I hate opening calculator every time.
I know you can just tell CE to allocate some unused memory space for my code, but I don't know how the game will get to that code. Or rather, the game should have nothing to do with the code altogether to prevent crashes.
Maybe you have to use Lua to do it? I know nothing about that unfortunately.
How to make an assembly code run manually
Re: How to make an assembly code run manually
Sounds like you might have injected into shared code.
But to run code use "createThread".
[Link]
But to run code use "createThread".
[Link]
Re: How to make an assembly code run manually
I have a feeling his game is created with Unity Engine, which then will bring into discussion other aspects/issues. Thus not that simple to find an injection spot to his understanding, let alone use a thread with Lua without attaching/detaching to the mono thread to avoid crashes. Could you name your game?
-
- Expert Cheater
- Posts: 852
- Joined: Fri Oct 12, 2018 10:25 pm
- Reputation: 896
Re: How to make an assembly code run manually
You don't even need to do any of that. The easiest thing that anyone with basic knowledge could do is to use the basic aobscan template to create a script in a function that constantly accesses the base address of the character. Inside it create another alloc/registersymbol (1 byte is enough), and add a cmp at the beginning to compare that alloc.
Add that alloc into the address list, and give it the hotkey that you want. Like change 0 to 1 when pressing F1. Really basic code example:
Code: Select all
alloc(run,1)
registersymbol(run)
newmem:
cmp byte ptr [run],01
jne code
mov byte ptr [run],00
DO HEALTH SHENANIGANS HERE. Like 'mov' max health to the current health.
code:
bla bla bla
Re: How to make an assembly code run manually
Thanks a lot! I never thought about that!
Though I tried the code and it didn't work. Probably because my hp switch code is faulty. You're supposed to do it like this, right?
The [base] being the base address that points to the values, plus the offset.
I think that might be wrong since the value of [base] is just the address it's pointing to (addresses of max and current health). Meanwhile, I want to move not that address, but the value it has.
So, maybe I should've made something like this instead?
The value is just two byte so I use the 16 bit registers.
Though I tried the code and it didn't work. Probably because my hp switch code is faulty. You're supposed to do it like this, right?
Code: Select all
push ax
mov ax,[base]+123
mov [base]+234,ax
pop ax
I think that might be wrong since the value of [base] is just the address it's pointing to (addresses of max and current health). Meanwhile, I want to move not that address, but the value it has.
So, maybe I should've made something like this instead?
Code: Select all
push ax
push bx
mov ax,[base]+123
mov bx,[ax]
mov [base]+234,bx
pop bx
pop ax
Re: How to make an assembly code run manually
You need to iterate through the pointer. So more like this:Mr. Alien wrote: ↑Fri Apr 30, 2021 9:41 pmThanks a lot! I never thought about that!
Though I tried the code and it didn't work. Probably because my hp switch code is faulty. You're supposed to do it like this, right?
The [base] being the base address that points to the values, plus the offset.Code: Select all
push ax mov ax,[base]+123 mov [base]+234,ax pop ax
I think that might be wrong since the value of [base] is just the address it's pointing to (addresses of max and current health). Meanwhile, I want to move not that address, but the value it has.
So, maybe I should've made something like this instead?The value is just two byte so I use the 16 bit registers.Code: Select all
push ax push bx mov ax,[base]+123 mov bx,[ax] mov [base]+234,bx pop bx pop ax
Code: Select all
push rax
mov rax,[base]
test rax,rax
jz @f
mov ax,[rax+123]
mov [rax+234],ax
@@:
pop rax
Re: How to make an assembly code run manually
So which game is this about, again?..
Re: How to make an assembly code run manually
You don't need scripting for this
Since you have both pointers add them as memoryrecords to the table
then give currentHealth a hotkey that 'sets value' and give it as value
(make sure to include the round braces)
also, you can multiply a value by 8 by setting it's value to
Since you have both pointers add them as memoryrecords to the table
then give currentHealth a hotkey that 'sets value' and give it as value
Code: Select all
(description of record with max value)
also, you can multiply a value by 8 by setting it's value to
Code: Select all
value*8
Who is online
Users browsing this forum: No registered users