| View previous topic :: View next topic |
| Author |
Message |
DAVHEED How do I cheat?
Reputation: 0
Joined: 27 Apr 2016 Posts: 1
|
Posted: Wed Apr 27, 2016 9:33 am Post subject: C++ Data type problem |
|
|
Hey,
I have a CE script I'd like to add to my C++ application, but I have encountered a small problem.
In the script I have this, which works perfectly.
| Code: |
alloc(val, 8)
registersymbol(val)
...
hook:
mov [val], eax
...
|
But in my C++ source I have tried doing this, which works with values under 4294967295, but overflows when above that.
| Code: |
unsigned __int64 val;
__asm
{
mov dword ptr[val], eax
}
|
Removing/replacing "dword ptr" (which makes it 4 bytes, I know) throws me an "error C2443: operand size conflict", which I have tried digging around on google for.
Is there any way to read the "missing" 4 bytes? Some smart ror/rol thing that I don't know of?
|
|
| Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Wed Apr 27, 2016 10:15 am Post subject: |
|
|
What missing four bytes?
EAX can only store 4 bytes total, so your 8 bytes variable will always have 4 "empty" bytes (which are zero).
So either use "rax" here or an unsigned int32 (not int64).
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Apr 27, 2016 4:54 pm Post subject: |
|
|
Your variable should be
| Code: | | unsigned __int32 val; |
|
|
| Back to top |
|
 |
|