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++ Type Double Pointers
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Sun Mar 15, 2009 8:05 pm    Post subject: C++ Type Double Pointers Reply with quote

I can change a Dword pointer easily but A double pointer is fooling me:

ie.

*(DWORD*)(*(DWORD*)MyBase + 0x30) = 100000;

But when I try to do double I have trouble I have tried:
DOUBLE RealFrogBase = *((DOUBLE*)FrogBase) + 0x8;
*(DWORD*)(*(DWORD*)RealFrogBase + 0x30) = (DOUBLE)100000.0;

INT FrogBaseNext = (*(DWORD*)FrogBase + 0x8); //Add 8
*(DOUBLE*)(*(DWORD*)FrogBaseNext +0x30) = 100000;

Got any suggestions? I also found this, I am reading through the thread:

http://forum.cheatengine.org/viewtopic.php?t=276729&start=0&postdays=0&postorder=asc&highlight=&sid=bdd30896cdc119a553b12e9ca6518699

_________________
Back to top
View user's profile Send private message Send e-mail
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Mar 15, 2009 8:52 pm    Post subject: Reply with quote

or you could just read a book or something and actually learn the subject...

void?
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Mar 15, 2009 9:15 pm    Post subject: Reply with quote

I agree with slovach.
You and all the other trolls that have just suddenly started pouring yourself in the general programming section.

I suspect you all know who you are Rolling Eyes.

On-topic:
Read 8 bytes and cast as a double. (memcpy/__movsb)

_________________
Back to top
View user's profile Send private message
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Sun Mar 15, 2009 9:44 pm    Post subject: Reply with quote

lurc wrote:
I agree with slovach.
You and all the other trolls that have just suddenly started pouring yourself in the general programming section.

I suspect you all know who you are :roll:.

On-topic:
Read 8 bytes and cast as a double. (memcpy/__movsb)


would I mem copy to an array? Or memcpy to a double??

memcopy(array or double,Base,8);

_________________
Back to top
View user's profile Send private message Send e-mail
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sun Mar 15, 2009 10:06 pm    Post subject: Reply with quote

Code:

double watwat = 0.00;

memcpy( (double)watwat, (void*)addr, 8 );


wat.
Back to top
View user's profile Send private message
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Sun Mar 15, 2009 10:09 pm    Post subject: Reply with quote

S3NS4 wrote:
Code:

double watwat = 0.00;

memcpy( (double)watwat, (void*)addr, 8 );


wat.


Thanks S4NS3

Rep + (if can)

EDIT:

5456 seconds

_________________
Back to top
View user's profile Send private message Send e-mail
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sun Mar 15, 2009 10:11 pm    Post subject: Reply with quote

AlbanainRetard wrote:
S3NS4 wrote:
Code:

double watwat = 0.00;

memcpy( (double)watwat, (void*)addr, 8 );


wat.


Thanks S4NS3

Rep + (if can)

EDIT:

5456 seconds

S3NS4.
Back to top
View user's profile Send private message
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Sun Mar 15, 2009 10:24 pm    Post subject: Reply with quote

S3NS4 wrote:
AlbanainRetard wrote:
S3NS4 wrote:
Code:

double watwat = 0.00;

memcpy( (double)watwat, (void*)addr, 8 );


wat.


Thanks S4NS3

Rep + (if can)

EDIT:

5456 seconds

S3NS4.


1>c:\users\mike williams\desktop\my\code\hacks\albanain\main.cpp(2Cool : error C2440: 'type cast' : cannot convert from 'DOUBLE' to 'void *'
1>c:\users\mike williams\desktop\my\code\hacks\albanain\main.cpp(2Cool : error C2664: 'memcpy' : cannot convert parameter 1 from 'double' to 'void *'

DOUBLE FrogBase = 0x00994658;
double FrogDouble = 0.0;
memcpy( (double)FrogDouble, (void*)(FrogBase+0x8), 8 );

_________________
Back to top
View user's profile Send private message Send e-mail
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sun Mar 15, 2009 10:42 pm    Post subject: Reply with quote

oops try replacing double with void*. I never messed with doubles before.
Back to top
View user's profile Send private message
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Mon Mar 16, 2009 12:57 am    Post subject: Reply with quote

S3NS4 wrote:
oops try replacing double with void*. I never messed with doubles before.


Two:

1. This compiles
Code:

DOUBLE FrogBase = ;//Removed for reasons
            DOUBLE FrogNew1 = *((DOUBLE*)&FrogBase) + 0x8;
            DOUBLE FrogNew2 = *((DOUBLE*)&FrogNew1) + 0x30;
            
            DOUBLE FrogValue = 100000.0;
            
            memcpy((void *)&FrogValue,(void *)&FrogNew2,8);


But doesn't that get the value of that pointer, ie: 1000.

2. So this would be to set it?

memcpy((void *)&FrogNew2, (void *)&FrogValue, 8 );

But the desired effect does not work.

_________________
Back to top
View user's profile Send private message Send e-mail
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Mon Mar 16, 2009 3:38 am    Post subject: Reply with quote

Do you have any idea how are you casting your pointers and why? I'd break down the very first DWORD pointer thing and study how it works. Then do the same for doubles. Memcpy is a little useless if you just fixed your pointers and their offsets. By breaking it down I mean something like this:
Code:
double *base = addy;
double value = 0;
base += offset;
value = *base;
Then after analyzing the stuff you actually do, you could try doing it with pure casting. Besides, I think Irwin wrote a ReadPtr function and posted it here. You could try it, but I think it was limited to 4 bytes -> Just do it twice, but add 4 bytes to your addy on the second time :)

The code which comples, fails at pointers too (I'd guess, no idea how's your struct, but I bet it's not like you write the code.)

S3NS4 seems to have no idea about pointers either. Double is just an another type, there's no difference to int when it comes to pointers.
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Mar 16, 2009 8:29 am    Post subject: Reply with quote

Code:
*(DWORD*)(*(DWORD*)MyBase + 0x30) = 100000;



>>

Code:
*(double*)(*(double*)MyBase + 0x30) = 100000.00;



O.O ?

_________________
Back to top
View user's profile Send private message Send e-mail
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Mon Mar 16, 2009 11:42 am    Post subject: Reply with quote

kitterz wrote:
Code:
*(DWORD*)(*(DWORD*)MyBase + 0x30) = 100000;



>>

Code:
*(double*)(*(double*)MyBase + 0x30) = 100000.00;



O.O ?


Already tried that: error C2440: 'type cast' : cannot convert from 'double' to 'double *'

and with "DOUBLE" it says wrong type.

_________________
Back to top
View user's profile Send private message Send e-mail
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Mon Mar 16, 2009 2:37 pm    Post subject: Reply with quote

iono...
Code:

DWORD MyBase;
*(double*)((DWORD)(MyBase+0x30)) = 100000.00;


regards BanMe
Back to top
View user's profile Send private message MSN Messenger
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Mar 16, 2009 3:12 pm    Post subject: Reply with quote

Code:

*(double*)(*(DWORD*)MyBase + 0x30) = 100000.00

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
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
Goto page 1, 2  Next
Page 1 of 2

 
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