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 


Is the custom type not possible on the M1 Mac?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine MacOS
View previous topic :: View next topic  
Author Message
coey
How do I cheat?
Reputation: 0

Joined: 09 Feb 2023
Posts: 2

PostPosted: Thu Feb 09, 2023 7:41 am    Post subject: Is the custom type not possible on the M1 Mac? Reply with quote

Hello! Very Happy

Is the custom type not possible on the M1 Mac?

In Windows, all custom types work well from v7.2 to 7.4.

However, all compile errors occur on the M1 Mac. (I've tried all 7 versions that I can try.)

The custom type I want to use is dword xor x4 search.

But not only this, almost custom types don't work. (compile error)

Is it inevitable because of the difference in OS?


For more information, I have a custom type that developer posted from this forum (which works well in Windows 10).


----------------------------------------------------------------------------


alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(UsesFloat,1)
alloc(CallMethod,1)

TypeName:
db 'dword xor +4',0

ByteSize:
dd 8

UsesFloat:
db 0 //Change to 1 if this custom type should be treated as a float

CallMethod:
db 1 //Remove or change to 0 for legacy call mechanism

//The convert routine should hold a routine that converts the data to an integer (in eax)
//function declared as: cdecl int ConvertRoutine(unsigned char *input, PTR_UINT address);
//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
//rdx=address
mov eax,[rcx] //eax now contains the bytes 'input' pointed to
xor eax,[rcx+4]

ret
[/64-bit]

[32-bit]
//jmp dllname.functionname
//or manual:
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=address of input
//[ebp+c]=address
//example:

push ebx
mov ebx,[ebp+8] //place the address that contains the bytes into eax
mov eax,[ebx] //place the bytes into eax so it's handled as a normal 4 byte value
xor eax,[ebx+4]

pop ebx

pop ebp
ret
[/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: cdecl void ConvertBackRoutine(int i, PTR_UINT address, unsigned char *output);
ConvertBackRoutine:
//jmp dllname.functionname
//or manual:
[64-bit]
//parameters: (64-bit)
//ecx=input
//rdx=address
//r8=address of output
//example:
xor ecx,[r8+4]
mov [r8],ecx //place the integer at the 4 bytes pointed to by r8

ret
[/64-bit]

[32-bit]
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address
//[ebp+10]=address of output
//example:
push eax
push ebx
mov eax,[ebp+8] //load the value into eax
mov ebx,[ebp+10] //load the output address into ebx
xor eax,[ebx+4]
mov [ebx],eax //write the value into the address
pop ebx
pop eax

pop ebp
ret
[/32-bit]
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Feb 09, 2023 7:57 am    Post subject: Reply with quote

mach/unix uses a different parameter passing system

in windows parameter passing is done using :
rcx, rdx, r8 and r9

ce runs in rosetta 2 (64-bit) so the parameters are passed using: rdi, rsi, rdx, rcx, r8 and r9


so:
likely you'd have to convert
Code:

//rcx=address of input
//rdx=address
mov eax,[rcx] //eax now contains the bytes 'input' pointed to
xor eax,[rcx+4]

ret

to
Code:

//rdi=address of input
//rsi=address
mov eax,[rdi] //eax now contains the bytes 'input' pointed to
xor eax,[rdi+4]

ret


and

Code:

[64-bit]
//parameters: (64-bit)
//ecx=input
//rdx=address
//r8=address of output
//example:
xor ecx,[r8+4]
mov [r8],ecx //place the integer at the 4 bytes pointed to by r8

ret
[/64-bit]


to

Code:

[64-bit]
//parameters: (64-bit)
//edi=input
//rsi=address
//rdx=address of output
//example:
xor edi,[rdx+4]
mov [rdx],edi //place the integer at the 4 bytes pointed to by r8

ret
[/64-bit]


this is of course untested. My mac is currently not available at the moment so I can't test

_________________
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
coey
How do I cheat?
Reputation: 0

Joined: 09 Feb 2023
Posts: 2

PostPosted: Thu Feb 09, 2023 8:26 am    Post subject: Reply with quote

[quote="Dark Byte"]


The version I tried.
M1 mac mini ventura 13.2 (cheat engine v743)

Thank you for your answer. As you said, I revised everything and tested it, but a similar error occurs.

I know very little about this, so I appreciate any little help.
I don't care if it's not now.
If you have time later, I'd like you to take a look.

I'll write down the errors that occurred below.


Not all code is injectable.
(Error in line 38 (mov eax,[rdi]) :This instruction can't be compiled)
Are you sure you want to edit it to this?

Click yes then

Error in line 30 (mov eax,[rdi]) :This instruction can't be compiled



Even if I erase the syntax related to the 30th line and test it again just in case, the same error occurs again in the line below.

Error in line 58 (mov [rdx],edi) :This instruction can't be compiled).......
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 MacOS 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites