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++] problem with pointer + Offset

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

Joined: 18 Sep 2016
Posts: 42

PostPosted: Tue Apr 23, 2019 6:09 am    Post subject: [c++] problem with pointer + Offset Reply with quote



Code:

   auto vcmpBase = (uintptr_t)::GetModuleHandle("vcmp-game.dll");
   auto shit = (vcmpBase + 0x03AC980);
   patch::SetFloat((shit+ 0x060C), 0.0, 1); // setfloat works but not set to 0.0 the addres I want :/


I have a problem. The value I want to be set it doesnt get set and stays default all the time. What am I doing wrong in my code? how can I allocate an module handle with address and an offset?

I've put a screenshot for better understanding[/code]
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 371

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

PostPosted: Tue Apr 23, 2019 7:24 am    Post subject: Reply with quote

You need to read the value stored at shit and add 0x60c to that
_________________
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
Kewun
Cheater
Reputation: 0

Joined: 18 Sep 2016
Posts: 42

PostPosted: Tue Apr 23, 2019 7:33 am    Post subject: Reply with quote

Code:
   auto vcmpBase = (uintptr_t)::GetModuleHandle("vcmp-game.dll");
   auto shit = (vcmpBase + 0x03AC980);
   float komek = patch::GetFloat(vcmpBase + 0x03ac980);

   float bsb = komek + 0x060C;

   patch::SetFloat((shit+ bsb), 0.0, 1);



Like this?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 371

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

PostPosted: Tue Apr 23, 2019 8:15 am    Post subject: Reply with quote

yes, but read it as an integer
_________________
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
Kewun
Cheater
Reputation: 0

Joined: 18 Sep 2016
Posts: 42

PostPosted: Tue Apr 23, 2019 10:47 am    Post subject: Reply with quote

Thanks! Fixed
Code:


   auto vcmpBase = (uintptr_t)::GetModuleHandle("vcmp-game.dll");

   DWORD kutas = *(DWORD*)(vcmpBase += 0x03AC980);

   patch::SetFloat((kutas)+0x060C, 0.0, 1);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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