----------------------------------------------------
-Meiyoh
How to make conditional codes
Say
If value on address 12345678 equal to 2C then execute code / cheat
if Value on address 12345678 less than 2C then execute code / cheat
etc
You know what I mean.
Thanks.
-ParkourPenguin
----------------------------------------------------[ENABLE]
alloc(newmem, 100)
label(lessthan)
label(return)
registersymbol(newmem)
newmem:
mov eax, 12345678
cmp [eax],2C
jl lessthan
jne return
//code to execute if they're equal
//example:
luacall(equalCheat())
jmp return
lessthan:
//code to execute if value at 12345678 is less than 2C
//example:
luacall(lessThanCheat())
return:
[DISABLE]
unregistersymbol(newmem)
dealloc(newmem)
My problem is with the "luacall" procedure. I've made a code to show as an example of what I want to do: (Eg. game: Battle For Wesnoth)
In this code the player moves increases only when the value pointed is equal to 15, which means the code remains inactive (originalcode) till it reaches 15. When the pointed value is equal 15, then it will increase only once to 16 and stop.[ENABLE]
alloc(newmem,1024)
label(returnhere)
label(originalcode)
label(exit)
newmem:
cmp [[[["wesnoth.exe"+01165DB8]+20]+28]+F0],#15 //A pointer. If the value is not equal to 15 it jumps to original code, but what I want is a procedure to make the value increase until it reaches 15 and then stop by jumping to the original code.
jne originalcode
inc [edx+000000F0]
mov eax,[edx+000000F0]
originalcode:
mov eax,[edx+000000F0]
exit:
jmp returnhere
"wesnoth.exe"+946B17:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
"wesnoth.exe"+946B17:
mov eax,[edx+000000F0]
//Alt: db 8B 82 F0 00 00 00
I want to know if there's a way to make the moves increase 'till it reaches 15 and then stop, but using full code injection instead of lua. Lets say
cmp [[[["wesnoth.exe"+01165DB8]+20]+28]+F0], < 0xF
Like the ParkourPenguin said: when using lua we have something like this:
If the only way is by using "luacall" procedure, then what should I put between the brackets? Every time I write something I get an "error in line". Could anyone create a code injection structure using the one I posted as an example? Thanks.bytes = readBytes(adrs,1)
if bytes == 0xF then
--do cheats here
elseif bytes < 0xF then
--do cheats here
end