| View previous topic :: View next topic |
| Author |
Message |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Fri Jun 19, 2009 5:15 pm Post subject: [C] Writing to a double pointer |
|
|
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 |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Fri Jun 19, 2009 7:32 pm Post subject: |
|
|
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 |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Fri Jun 19, 2009 8:31 pm Post subject: |
|
|
| 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 |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Fri Jun 19, 2009 8:48 pm Post subject: |
|
|
| surely a faggot fanboy of me, aka you, would know that i program assembly and only started C 2 days ago
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Fri Jun 19, 2009 8:50 pm Post subject: |
|
|
| 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 |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Fri Jun 19, 2009 9:44 pm Post subject: |
|
|
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 |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Fri Jun 19, 2009 10:07 pm Post subject: |
|
|
| 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 |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Fri Jun 19, 2009 10:19 pm Post subject: |
|
|
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 |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Fri Jun 19, 2009 11:02 pm Post subject: |
|
|
| 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 |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Fri Jun 19, 2009 11:06 pm Post subject: |
|
|
| ; 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 |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Sat Jun 20, 2009 12:12 am Post subject: |
|
|
Just sayin.
_________________
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Sat Jun 20, 2009 4:11 am Post subject: |
|
|
Nice picture manc!
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 |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Sat Jun 20, 2009 8:57 am Post subject: |
|
|
| 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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat Jun 20, 2009 9:22 am Post subject: |
|
|
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 |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Sat Jun 20, 2009 10:46 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
|