| View previous topic :: View next topic |
| Author |
Message |
Xoujiro Advanced Cheater
Reputation: 0
Joined: 20 Mar 2006 Posts: 86
|
Posted: Fri Nov 14, 2008 10:20 pm Post subject: Pointers In DLL |
|
|
so, my address in ce is
this is what ive done so far
| Quote: |
LONG hackhex;
LONG *hackbase = (LONG*)0x342D8120;
LONG *hack1;
hackhex = *hackbase; |
I think this gives hackhex the value of hackbase in Decimal, but how do i change it to HEX?
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Fri Nov 14, 2008 10:38 pm Post subject: |
|
|
| Code: | | DWORD dwPtrVal = *((DWORD*)0x342D8120+0x13); |
If you want to view it in hex, output your string in hex instead...
| Code: | LPTSTR lpText = (LPTSTR)HeapAlloc(GetProcessHeap(), 0, sizeof(TCHAR)*64);
wsprintf(lpText, _T("Hex: 0x%X/Dec: %d"), dwPtrVal, dwPtrVal);
MessageBox(hWnd, lpText, _T("dwPtrVal"), MB_OK);
HeapFree(GetProcessHeap(), 0, (LPVOID)lpText); |
_________________
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Fri Nov 14, 2008 11:02 pm Post subject: |
|
|
LPCWSTR lpText;
DWORD dwPtrVal = *((DWORD*)0x342D8120+0x13);
sprintf(lpText, "Hex is %X08 Dec is %d", dwPtrVal, dwPtrVal);
OutputDebugString(lpText);
|
|
| Back to top |
|
 |
Xoujiro Advanced Cheater
Reputation: 0
Joined: 20 Mar 2006 Posts: 86
|
Posted: Fri Nov 14, 2008 11:56 pm Post subject: |
|
|
But doesnt
| Quote: | | DWORD dwPtrVal = *((DWORD*)0x342D8120+0x13); |
Give 0x342D8120+0x13 = 342d8133?
I want the value of 0x342D8120 into a hex(address) and that address + 0x13.
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat Nov 15, 2008 1:04 am Post subject: |
|
|
No, pointers work diffrently.
A pointer points to the base address value + the offset.
And there's no such thing as "hex" values or "decimal" values, everything is binary, it's just the way you output the strings is diffrent, as lurc showed.
|
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Nov 15, 2008 1:17 am Post subject: |
|
|
| Xoujiro wrote: | But doesnt
| Quote: | | DWORD dwPtrVal = *((DWORD*)0x342D8120+0x13); |
Give 0x342D8120+0x13 = 342d8133?
I want the value of 0x342D8120 into a hex(address) and that address + 0x13. |
| Code: | | DWORD dwPtrVal = *(DWORD*)((*(DWORD*)dwAddr)+dwOffset); |
try this?
|
|
| Back to top |
|
 |
Xoujiro Advanced Cheater
Reputation: 0
Joined: 20 Mar 2006 Posts: 86
|
Posted: Sat Nov 15, 2008 2:14 am Post subject: |
|
|
ok thanks lurc , i didnt know pointers can be used like that in c++ becuz in ce, its diff i think...
Last edited by Xoujiro on Sat Nov 15, 2008 2:42 am; edited 1 time in total |
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat Nov 15, 2008 2:25 am Post subject: |
|
|
| A pointer doesn't have to be static, it could be a pointer to a pointer to a pointer..... to a pointer.
|
|
| Back to top |
|
 |
Xoujiro Advanced Cheater
Reputation: 0
Joined: 20 Mar 2006 Posts: 86
|
Posted: Sat Nov 15, 2008 2:49 am Post subject: |
|
|
okay...so i got the dwPtrVal to the right address ,
okay now how do i change the value of dwPtrVal?
why cant
| Quote: | DWORD *change = (DWORD*)dwPtrVal;
*change = 9460300; |
work?
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat Nov 15, 2008 3:19 am Post subject: |
|
|
| What's the value of dwPtrVal?
|
|
| Back to top |
|
 |
Xoujiro Advanced Cheater
Reputation: 0
Joined: 20 Mar 2006 Posts: 86
|
Posted: Sat Nov 15, 2008 3:23 am Post subject: |
|
|
dwPtrVal = *(DWORD*)0x0100BECC+0x100;
and then the value is 16777216 which is 0x01000000 the correct one.
so..i meant how do i change the value of value of dwPtrVal...
Last edited by Xoujiro on Sat Nov 15, 2008 3:26 am; edited 1 time in total |
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Sat Nov 15, 2008 3:26 am Post subject: |
|
|
to set value:
| Code: | | *(DWORD*)( *(DWORD*)dwAddr + dwOffset) = yourvalue; |
_________________
|
|
| Back to top |
|
 |
Xoujiro Advanced Cheater
Reputation: 0
Joined: 20 Mar 2006 Posts: 86
|
Posted: Sat Nov 15, 2008 3:32 am Post subject: |
|
|
| Snootae wrote: | to set value:
| Code: | | *(DWORD*)( *(DWORD*)dwAddr + dwOffset) = yourvalue; |
|
ok thanks for your help.. it works perfectly now i can complete my dll ^^ btw i like your maplestory trainer
okay now, how do i get the value of a TEXT address into C++, i need to compare it with another text, ive tried string but it fails with this error
| Quote: | | if ( *(string*)( *(DWORD*)dwID + dwIDOff) == ID ) { |
| Quote: | c:\documents and settings\mathew\my documents\visual studio 2008\projects\matt\matt\dllmain.cpp(94) : error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion)
c:\program files\microsoft sdks\windows\v6.0a\include\guiddef.h(192): could be 'int operator ==(const GUID &,const GUID &)'
while trying to match the argument list '(std::string, std::string)' |
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
|
| Back to top |
|
 |
Xoujiro Advanced Cheater
Reputation: 0
Joined: 20 Mar 2006 Posts: 86
|
Posted: Sat Nov 15, 2008 11:00 am Post subject: |
|
|
| Quote: | LPCTSTR ID = "mystring";
LPCTSTR GG;
GG = (LPCTSTR)*(DWORD*) (*(DWORD*)dwID + dwIDOff);
if ( lstrcmp(GG,ID) == 0 ) {
do function
}
|
crashes me...i think its beause of the
| Quote: | | (LPCTSTR)*(DWORD*) (*(DWORD*)dwID + dwIDOff) | part...the address are 100% correct.
|
|
| Back to top |
|
 |
|