|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
xxhehe Expert Cheater Reputation: 0
Joined: 11 Mar 2015 Posts: 136
|
Posted: Thu Nov 12, 2015 4:32 am Post subject: 3 Byte Value Search |
|
|
LUA Script do not work
Requesting Help
changes to available
Code: |
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(PreferedAlignment, 4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
TypeName:
db '3 Byte',0
ByteSize:
dd 3
PreferedAlignment:
dd 1
ConvertRoutine:
[32-bit]
push ebp
mov ebp,esp
push ecx
mov ecx,[ebp+8]
[/32-bit]
//at this point ecx contains the address where the bytes are stored
mov eax,[ecx] //second fun fact, addressing with 32-bit registers doesn't work in 64-bit, it becomes a 64-bit automatically (most of the time)
shr eax,3 //shift right by 3 bits (divide by 8)
[64-bit]
ret
[/64-bit]
[32-bit]
pop ecx
pop ebp
ret 4
[/32-bit]
//The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
//function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
ConvertBackRoutine:
[32-bit]
push ebp
mov ebp,esp
push edx
push ecx
mov edx,[ebp+0c]
mov ecx,[ebp+08]
[/32-bit]
//at this point edx contains the address to write the value to
//and ecx contains the value
push eax
push edx
mov edx,[edx] //edx now contains the original value
and edx,7 //only save the first 3 bits
mov eax,ecx //eax gets the user input value
shl eax,3 //shift left by 3 bits (multiply by 8)
or eax,edx //add the bits of the original value
pop edx
mov [edx],eax //write the new value into the old value
pop eax
[64-bit]
//everything is back to what it was, so exit
ret
[/64-bit]
[32-bit]
//cleanup first
pop ecx
pop edx
pop ebp
ret 8
[/32-bit]
|
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Thu Nov 12, 2015 4:42 pm Post subject: |
|
|
It is not a Lua script. It is "CustomType AutoAssemble Script"
_________________
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Thu Nov 12, 2015 7:24 pm Post subject: |
|
|
Moved, this is not a Lua related topic.
_________________
- Retired. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Fri Nov 13, 2015 1:45 am Post subject: |
|
|
since it's 3 bytes you have to build the registervalue manually
e. g
Code: |
xor eax, eax
mov ah, [ecx+2]
shr eax, 8
mov ax, [ecx]
|
after that you can do the other things you like to do with it
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|
|
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
|
|