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 


[C Code]Value type without name

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Sat Oct 16, 2021 11:56 am    Post subject: [C Code]Value type without name Reply with quote

This is example where i can use in c++:
Code:
*(unsigned char*)0xA888F1 = 0;

But i didn't found how to do in c code

_________________
void(__cdecl *Haxing)(HWND hGameWindow)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Oct 16, 2021 1:13 pm    Post subject: Reply with quote

have you tried using that C code inside a CCode block ?

Seems to work just fine for me.

If you're on 7.3 just give it at least one name
{$ccode bla=rax}

_________________
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
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Sat Oct 16, 2021 1:28 pm    Post subject: Reply with quote

It just saying that error in line 14
here's code:
Code:
globalalloc(cameraAI,1024)
createThread(cameraAI)

cameraAI:
{$ccode tmp=eax}
typedef int(__cdecl *fCameraAI_SetAction)(int,char*,void);

fCameraAI_SetAction CameraAI_SetAction = (fCameraAI_SetAction)0x48D620;

CameraAI_SetAction(1,"%s");

if ("%s" == "CDActionDebugWatchCar")
 {
unsigned char* 0xA888F1 = 1;
   if (GetKeyState(107) & (1<<15))
    {
    unsigned char* 0xA88914 += 1;
    }
   if (GetKeyState(109) & (1<<15))
    {
    unsigned char* 0xA88914 -= 1;
    }
   else
   {
   unsigned char* 0xA888F1 = 0;
   }
 }

{$asm}
ret

_________________
void(__cdecl *Haxing)(HWND hGameWindow)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Oct 16, 2021 1:56 pm    Post subject: Reply with quote

instead of
Code:

unsigned char* 0xA888F1 = 1;


try
Code:

*(unsigned char*)0xA888F1 = 0;


and similar for the other lines

Code:

unsigned char* 0xA88914 += 1;

should be
Code:

(*(unsigned char*) 0xA88914) += 1;

_________________
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
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Sat Oct 16, 2021 2:02 pm    Post subject: Reply with quote

ty

EDIT:
btw, how to do with int parameter?

_________________
void(__cdecl *Haxing)(HWND hGameWindow)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Oct 16, 2021 2:48 pm    Post subject: Reply with quote

Code:

*(int *)address


also,
Code:

if ("%s" == "CDActionDebugWatchCar")

will not work. String compares in c are pointer compares and the address of "%s" is not the same as the address of CDActionDebugWatchCar"

_________________
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
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