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 


Cheat Engine 7.0 Question - 2 & 4 Byte Big Endian

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

Joined: 16 Apr 2013
Posts: 97

PostPosted: Mon Feb 17, 2020 10:26 pm    Post subject: Cheat Engine 7.0 Question - 2 & 4 Byte Big Endian Reply with quote

Does 7.0 come with this by default? I had manually added these in a previous version and when I installed the new version, it had it. I even selected "reset settings" when installing. If it carries over from another version, where is that info stored so I can delete it?

I'm trying to help a user who's installed Cheat Engine 7.0 for the first time ever. They can't run a script I made because it's lua and it's getting an error. I'm thinking I can just package my own copy of CE up that already has the 2 & 4 byte types included, but I don't know if this data is stored within the CE run dir itself or not.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25779
Location: The netherlands

PostPosted: Tue Feb 18, 2020 5:10 am    Post subject: Reply with quote

it's stored in the registry
in the start menu under Cheat Engine execute "reset settings" to remove custom types as well (install will leave them intact but manually resetting will delete these)

you can package the custom types with CE inside tables as well using registerCustomTypeAutoAssembler([[codeforbigendian]])
it will be forgotten when ce restarts

_________________
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
View user's profile Send private message MSN Messenger
Drivium
Advanced Cheater
Reputation: 0

Joined: 16 Apr 2013
Posts: 97

PostPosted: Tue Feb 18, 2020 9:04 am    Post subject: Reply with quote

Quote:
you can package the custom types with CE inside tables as well using registerCustomTypeAutoAssembler([[codeforbigendian]])
it will be forgotten when ce restarts


This sounds exactly like what I need to do. How would that look exactly? Do I manually edit the .ct file and drop this in or do I open an auto assembly window and paste it in there then add it to the cheat table as a line? Do I need to activate it?

Obviously, I'd prefer to package it the way you suggested, but I did find this also: https://github.com/FreeER/Cheat-Engine-Custom-Types. Would running one of these .reg files from @FreeER work also?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25779
Location: The netherlands

PostPosted: Wed Feb 19, 2020 8:59 am    Post subject: Reply with quote

example for big endian 2 byte:
Code:

registerCustomTypeAutoAssembler([[
alloc(TypeName,256)
 alloc(ByteSize,4)
 alloc(ConvertRoutine,1024)
 alloc(ConvertBackRoutine,1024)
 
 
 TypeName:
 db '2 Byte Big Endian',0
 
 
 ByteSize:
 dd 2
 
 
 //The convert routine should hold a routine that converts the data to an integer (in eax)
 //function declared as: stdcall int ConvertRoutine(unsigned char *input);
 //Note: Keep in mind that this routine can be called by multiple threads at the same time.
 ConvertRoutine:
 //jmp dllname.functionname
 [64-bit]
 //or manual:
 //parameters: (64-bit)
 //rcx=address of input
 xor eax,eax
 mov ax,[rcx] //eax now contains the bytes 'input' pointed to
 xchg ah,al //convert to big endian
 
 
 ret
 [/64-bit]
 
 
 [32-bit]
 //jmp dllname.functionname
 //or manual:
 //parameters: (32-bit)
 push ebp
 mov ebp,esp
 //[ebp+8]=input
 //example:
 mov eax,[ebp+8] //place the address that contains the bytes into eax
 mov ax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
 and eax,ffff //cleanup
 xchg ah,al //convert to big endian
 
 
 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:
 //jmp dllname.functionname
 //or manual:
 [64-bit]
 //parameters: (64-bit)
 //ecx=input
 //rdx=address of output
 //example:
 xchg ch,cl //convert the little endian input into a big endian input
 mov [rdx],cx //place the integer the 4 bytes pointed to by rdx
 
 
 ret
 [/64-bit]
 
 
 [32-bit]
 //parameters: (32-bit)
 push ebp
 mov ebp,esp
 //[ebp+8]=input
 //[ebp+c]=address of output
 //example:
 push eax
 push ebx
 mov eax,[ebp+8] //load the value into eax
 mov ebx,[ebp+c] //load the address into ebx
 
 
 //convert the value to big endian
 xchg ah,al
 
 
 mov [ebx],ax //write the value into the address
 pop ebx
 pop eax
 
 
 pop ebp
 ret 8
 [/32-bit]
]])

and running those .reg files might also work. 

_________________
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
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4695

PostPosted: Wed Feb 19, 2020 10:32 am    Post subject: Reply with quote

In case you don't know, registerCustomTypeAutoAssembler is Lua code: copy/paste it into the Lua script of the cheat table. (main window -> table -> show cheat table Lua script)
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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