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 


Bad float precision while writing to an address

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

Joined: 24 Mar 2016
Posts: 67

PostPosted: Sun Apr 24, 2016 3:43 pm    Post subject: Bad float precision while writing to an address Reply with quote

I'm trying to write to an address (fly address) a float value. For example, I go to CheatnEngine and I set the address' value from 0 (ground value) to 500.
Here I can see the flying effect, everything works properly ... but, when I try to set it in C++ it's like i set the flying address from 0 (ground value) to 2 (superlittle jump lol)... So I've just thought the problem was a bad float digit precision.

I've already tried and retiried the code and it works properly in other games too... Here it is :

Quote:
*(DWORD*)(myAddy) = (float)500;


Why doesn't it work, or better, does that strange effect? Any tip?

@ParkourPenguin
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Apr 24, 2016 7:43 pm    Post subject: Reply with quote

*(float*)(myAddy) = 500.0f;
_________________
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
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Apr 24, 2016 11:02 pm    Post subject: Re: Bad float precision while writing to an address Reply with quote

itsoqrappy wrote:
@ParkourPenguin
-Stop calling people out...it's annoying. If you want to address someone specifically, send them a PM. If you can't PM yet, then just wait until you can and post your questions for all in the interim.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4302

PostPosted: Sun Apr 24, 2016 11:47 pm    Post subject: Reply with quote

What ++METHOS said. I don't even know why you're asking for my help with C++. I'm not that good at it and there are many other people on this site that can help you out significantly more than I can.

Just judging based on your last few topics, you should ascertain your comprehension of C++. While you may sometimes know what to write down to make something work, it's pretty clear you don't understand what you're writing down. If you take the time to actually learn what you're doing instead of just memorizing it, you'll find that you won't make as many mistakes later on, saving you time in the long run.

_________________
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
itsoqrappy
Advanced Cheater
Reputation: 0

Joined: 24 Mar 2016
Posts: 67

PostPosted: Mon Apr 25, 2016 4:29 pm    Post subject: Reply with quote

Dark Byte wrote:
*(float*)(myAddy) = 500.0f;


Ok, now it works. Anyhow
I'm reading another pointer with this code:
Quote:
auto baseAddress = (DWORD)::GetModuleHandle(nullptr);
auto address = *(DWORD*)(baseAddress + ANOTHERADDY);


why doesn't it work? With some others pointers it works...

Yes, offsets and ANOTHERADDY are correct, I've checked it 15 times.


Last edited by itsoqrappy on Wed Apr 27, 2016 12:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4302

PostPosted: Mon Apr 25, 2016 4:43 pm    Post subject: Reply with quote

What's the pointer path of it when it's working in CE? I can't think of anything else that's wrong besides thefourth being functionally useless.
_________________
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
itsoqrappy
Advanced Cheater
Reputation: 0

Joined: 24 Mar 2016
Posts: 67

PostPosted: Mon Apr 25, 2016 4:53 pm    Post subject: Reply with quote

ParkourPenguin wrote:
What's the pointer path of it when it's working in CE? I can't think of anything else that's wrong besides thefourth being functionally useless.

Yeah I tried deleting that line too but still nothing... Sad the offsets, addys etc. are not wrong (don't worry for that, i took 3 hours to recheck everything, btw i cant screen anyway right now because im out with my sister's pc).

Any idea? I would need to try with VirtualProtect but im not sure, cuz i didnt need of it when working with all other pointers in the same game.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Tue Apr 26, 2016 4:02 am    Post subject: Reply with quote

Quote:

auto baseAddress = (DWORD)::GetModuleHandle(nullptr);
auto address = *(DWORD*)(baseAddress + ANOTHERADDY);

If this is your idea of what modulename+offset means (e.g game.exe+4abcdef0 and you assume ANOTHERADDY is 4abcdef0 ) then it's wrong.

it should then be:
Code:

auto baseAddress = (DWORD)::GetModuleHandle(nullptr);
auto address =baseAddress + ANOTHERADDY;

_________________
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