| View previous topic :: View next topic |
| Author |
Message |
kot1990 Expert Cheater
Reputation: 1
Joined: 06 Sep 2009 Posts: 131 Location: Greece
|
Posted: Sat Mar 06, 2010 5:30 pm Post subject: pls help.... |
|
|
I hate those type conversions in C, they are driving me crazy!! I am trying to write byte-byte all bytes to a DWORD.
| Code: |
*(BYTE*)(&playerId) = someByte;
*(BYTE*)(&playerId+1) = someByte2; //&playerId+1 gives +4bytes address and not the next byte
|
,, I also tried
| Code: |
*(BYTE*)((&playerId)+1) = someByte2; //but that also failed as hell
|
Finally I did this,, but that's odd, I don't want a new value for this:
| Code: |
BYTE* ptr = (BYTE*)&playerId;
*(ptr+1) = someByte2
|
EDIT: sorry for the thread,, I found it xD
| Code: | | *((BYTE*)(&playerId)+1) = someByte2; |
|
|
| Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Sat Mar 06, 2010 7:52 pm Post subject: |
|
|
Idiot.
| Code: |
*(BYTE*) (&Address) = SomeByte
|
You dont need the '&' operator.
| Code: |
*(BYTE*) Address = SomeByte
|
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25848 Location: The netherlands
|
Posted: Sat Mar 06, 2010 8:16 pm Post subject: |
|
|
Don't call people idiot without knowing the full situation
I am assuming that playerId isn't an address specifier, so just a variable(multibyte variable)
then the method the original poster gave is a proper solution: First get the address of playerId, then increase that result as if it's a pointer to a byte, and then dereference that pointer.
by just adding +1 to the pointer specifier it'd be treated as a int pointer which is why it went +4 instead
also for the original poster, you could also just assign an byte array to the start of the playerId address and then read it out as byte[0], byte[1], etc...
And then still, why do you need it as seperate bytes?
WriteProcessMemory ? Just give it the address of playerid and size 4.
CopyMemory? Just give it the address of playerid and size 4
etc... _________________
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 |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Sat Mar 06, 2010 8:21 pm Post subject: |
|
|
| iPromise wrote: | Idiot.
| Code: |
*(BYTE*) (&Address) = SomeByte
|
You dont need the '&' operator.
| Code: |
*(BYTE*) Address = SomeByte
|
|
A bit ironic calling him an idiot while you are even more of an idiot? *hint*your memory engine*hint* |
|
| Back to top |
|
 |
|