![]() |
|
#1
|
|||
|
|||
|
IDA IDC-script: cannot shift right properly
I have a little problem with idc-script
Here's an example: Message("\n%X",0xC0665A84>>31); Message("\n%X",0xC0665A84/0x80000000); First resuls 0xFFFFFFFF, and second - 0; What's a damn? The result must be 1 in both cases. I have to implement ROR and ROL instructions in my IDC-script, but I can't 'cause the reason above. Could someone tell me another way? Thank you. |
|
#2
|
|||
|
|||
|
IDC uses signed arithmetic. Shift Right corresponds to SAR. Nevertheless you can still implement ROL and ROR keeping this in mind.
|
|
#3
|
|||
|
|||
|
2 ninio:
Thanks a lot. If someone need: #define ROL(x,n) x<<n|(~(0xFFFFFFFF<<n)&x>>32-n) #define ROR(x,n) x<<32-n|(~(0x80000000>>n-1)&x>>n) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| IDA can't properly deal with RUST strings | WhoCares | General Discussion | 3 | 07-08-2021 10:46 |
| Don't get Olly to work properly | squareD | General Discussion | 3 | 06-12-2006 01:31 |
| F9->Shift-F9 Exception passing in Olly | bgrimm | General Discussion | 15 | 02-15-2005 05:06 |