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] Writing to a double pointer
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
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Fri Jun 19, 2009 5:15 pm    Post subject: [C] Writing to a double pointer Reply with quote

Im attempting to write to a DOUBLE pointer, where i found the address in CheatEngine, and im injecting a .dll into an application.

i try to do this:
Code:
*(DOUBLE*)0x00A8F4D4 = 500;


But it crashes my app (or, i do exceptions, but without those, it would crash...), why is it being so evil?
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Jun 19, 2009 7:32 pm    Post subject: Reply with quote

first of all is that address writable ?

secondly.. try declaring something like :
DOUBLE number = 500;

then assigning it then. the reason i ask you to do that is that normal numbers, ints and stuff are stored differently in memory than double/floats. not sure how the compiler handles it when you write that but no harm in giving my idea a go
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Fri Jun 19, 2009 8:31 pm    Post subject: Reply with quote

Slugsnack wrote:
first of all is that address writable ?

secondly.. try declaring something like :
DOUBLE number = 500;

then assigning it then. the reason i ask you to do that is that normal numbers, ints and stuff are stored differently in memory than double/floats. not sure how the compiler handles it when you write that but no harm in giving my idea a go

Surely someone who says he's pro at C should know you'll need .f.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Jun 19, 2009 8:48 pm    Post subject: Reply with quote

surely a faggot fanboy of me, aka you, would know that i program assembly and only started C 2 days ago
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Fri Jun 19, 2009 8:50 pm    Post subject: Reply with quote

Slugsnack wrote:
surely a faggot fanboy of me, aka you, would know that i program assembly and only started C 2 days ago
Rofl, didn't you say you knew more about C++ than me? You were bragging about how good you were on MSN, surely someone with your knowledge should know this, correct? Anyways, you didn't start C 2 days ago. Dll injector in coder section @ GzN. GJ. Hurrrrrrrrrrr.
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Fri Jun 19, 2009 9:44 pm    Post subject: Reply with quote

lmfao, what are you retarded void ?

i'd love to see an example of somebody using an "F" after setting a DOUBLE value ahah

way to have less skill than a kid that's been doing C for 2 days ;[
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Fri Jun 19, 2009 10:07 pm    Post subject: Reply with quote

smartz993 wrote:
lmfao, what are you retarded void ?

i'd love to see an example of somebody using an "F" after setting a DOUBLE value ahah

way to have less skill than a kid that's been doing C for 2 days ;[
What are you lurking now? You're still the same pussy that you always were. You and Megan should go jump in a river and die.
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Fri Jun 19, 2009 10:19 pm    Post subject: Reply with quote

ahaha


sluggy let me know about your recent General Programming retard escapades..

also, i'm not so sure i'm lurking..see what i did there ? it's called a post
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Fri Jun 19, 2009 11:02 pm    Post subject: Reply with quote

smartz993 wrote:
ahaha


sluggy let me know about your recent General Programming retard escapades..

also, i'm not so sure i'm lurking..see what i did there ? it's called a post
Anymore, key word. Lol Mike calling a pussy for backup, because he can't defend for himself.
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Fri Jun 19, 2009 11:06 pm    Post subject: Reply with quote

; wrote:
smartz993 wrote:
ahaha


sluggy let me know about your recent General Programming retard escapades..

also, i'm not so sure i'm lurking..see what i did there ? it's called a post
Anymore, key word. Lol Mike calling a pussy for backup, because he can't defend for himself.


He seemed to be doing a fine job, seen as how you fucked yourself over on the little float/double mishap
Back to top
View user's profile Send private message
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Sat Jun 20, 2009 12:12 am    Post subject: Reply with quote


Just sayin.

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

Joined: 20 Apr 2007
Posts: 668

PostPosted: Sat Jun 20, 2009 4:11 am    Post subject: Reply with quote

Nice picture manc! Very Happy

This still gives me an exception:
Code:
void Function(){
   addr = 0x00A8F4D4;
   DWORD origProtect;
   VirtualProtect((LPVOID)addr, sizeof(DOUBLE), PAGE_READWRITE, &origProtect);
   DOUBLE value = 500;
   *(DOUBLE*)addr = value;
   VirtualProtect((LPVOID)addr, sizeof(DOUBLE), origProtect, &origProtect);
}
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sat Jun 20, 2009 8:57 am    Post subject: Reply with quote

smartz993 wrote:
; wrote:
smartz993 wrote:
ahaha


sluggy let me know about your recent General Programming retard escapades..

also, i'm not so sure i'm lurking..see what i did there ? it's called a post
Anymore, key word. Lol Mike calling a pussy for backup, because he can't defend for himself.


He seemed to be doing a fine job, seen as how you fucked yourself over on the little float/double mishap
Let's ride his dick shall we.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Jun 20, 2009 9:22 am    Post subject: Reply with quote

void why do you always seem to start fights about the most random shit and to say someone doesn't know anything about C coming from your mouth is just fucking stupid.

Anywho back on track here. Did you try to memcpy/__movsb the memory at that VA to a DOUBLE?

Try it. (This is reading btw, switch the src and dest parameters if you want to write.)

Code:
DOUBLE *theDouble = new DOUBLE;
memcpy((LPVOID)Addy, &theDouble, sizeof(DOUBLE));

..
delete theDouble;


play around with it and see what happens.

_________________


Last edited by lurc on Sat Jun 20, 2009 11:22 am; edited 1 time in total
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Sat Jun 20, 2009 10:46 am    Post subject: Reply with quote

I havent done alot work with new and delete, but this gives acces violation aswell...:

Code:
   DWORD origProtect;
   VirtualProtect(LPVOID(addr), sizeof(DOUBLE), PAGE_READWRITE, &origProtect);
   DOUBLE* theDouble = new DOUBLE;
   *theDouble = 500;
   memcpy(LPVOID(addr), &theDouble, sizeof(DOUBLE));
   VirtualProtect(LPVOID(addr), sizeof(DOUBLE), PAGE_READWRITE, &origProtect);
   delete theDouble;


I can write to the pointer using CheatEngine, but not from within my DLL Sad
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