[C++/ASM] Help in DEcompiling this code
Hi all im decompoling a File, i hve quite of success while doing this, until here i get an strange type of code ( The file was compiled on Visual C++ 6.0 Debug Type)
Code:
004E59CF |. 8B45 08 MOV EAX,[ARG.type]
004E59D2 |. 99 CDQ
004E59D3 |. 83E2 0F AND EDX,0F
004E59D6 |. 03C2 ADD EAX,EDX
004E59D8 |. C1F8 04 SAR EAX,4
004E59DB |. C1E0 05 SHL EAX,5
004E59DE |. 8B55 08 MOV EDX,[ARG.type]
004E59E1 |. 81E2 0F000080 AND EDX,8000000F
004E59E7 |. 79 05 JNS SHORT GameServ.004E59EE
004E59E9 |. 4A DEC EDX
004E59EA |. 83CA F0 OR EDX,FFFFFFF0
004E59ED |. 42 INC EDX
004E59EE |> 03C2 ADD EAX,EDX
004E59F0 |. 8945 F8 MOV [LOCAL._type],EAX
so i wrote in c++ this
Code:
int _type; // type is an int
_type=((type/16*32))+UNKMACRO(type)
well the thing is that i don't know how to emulate the UNKMACRO that produce this code
Code:
004E59DE |. 8B55 08 MOV EDX,[ARG.type]
004E59E1 |. 81E2 0F000080 AND EDX,8000000F
004E59E7 |. 79 05 JNS SHORT GameServ.004E59EE
004E59E9 |. 4A DEC EDX
004E59EA |. 83CA F0 OR EDX,FFFFFFF0
004E59ED |. 42 INC EDX
This part do this
save ARG.type on EDX register
limit the EDX with 8000000F
if it is signed it will decrease the EDX, will OR it with 0xFFFFFFF0 and will increase it
so the MAcro should be
#define MACROLIMIT ( number, limit) ( .. code here )
but the problem is that i don't know any Macro that can emulate this, or any instruction that can handle the sign Flag in Debug, i would very gratefull if someone could help me in finding this strange macro
Re: [C++/ASM/Reverse] Help in DEcompiling this code
I try but I just don't understand what it is you want to do.
Re: [C++/ASM/Reverse] Help in DEcompiling this code
Well im a noob but i think i got what he's trying.
Is that the asembly code u extracted from a serial/code generator algorthm and you are trying to reverse to make a keygen?
if it is i have no freaking idea of cracking but XD at least i recogniced the assembly code ^_^
Re: [C++/ASM/Reverse] Help in DEcompiling this code
Quote:
Originally Posted by
Negata
I try but I just don't understand what it is you want to do.
i need to reverse this code to c++
Code:
004E59CF |. 8B45 08 MOV EAX,[ARG.type]
004E59D2 |. 99 CDQ
004E59D3 |. 83E2 0F AND EDX,0F
004E59D6 |. 03C2 ADD EAX,EDX
004E59D8 |. C1F8 04 SAR EAX,4
004E59DB |. C1E0 05 SHL EAX,5
004E59DE |. 8B55 08 MOV EDX,[ARG.type]
004E59E1 |. 81E2 0F000080 AND EDX,8000000F
004E59E7 |. 79 05 JNS SHORT GameServ.004E59EE
004E59E9 |. 4A DEC EDX
004E59EA |. 83CA F0 OR EDX,FFFFFFF0
004E59ED |. 42 INC EDX
004E59EE |> 03C2 ADD EAX,EDX
004E59F0 |. 8945 F8 MOV [LOCAL._type],EAX
but i only got until the JNS jump, aftert that i can't get a JNS produced by the Visual c++ 6.0
Re: [C++/ASM/Reverse] Help in DEcompiling this code
Signed double-precision qord op of some sort.
Re: [C++/ASM/Reverse] Help in DEcompiling this code
Quote:
Originally Posted by
username1
Signed double-precision qord op of some sort.
do you know any macro or function that can emulate that?