baruch Posted May 1, 2016 Posted May 1, 2016 Hello, I have a realy stupid question but i spent on it 3 hours and I surrender:( Im trying to write keygen to :"LaFarge CrackMe #2". So the code in asm is: (EAX=631698A, its when you enter "baruch" as name to this crackme,and the address(406549) at 401261 is empty area) After the loop,the address 406549 look like: Now,because i dont know how to code assembly DIV in c++ i did "inline assembly": //equivalent to address 406549 In visual studio i put break point to see what happend after that code: //table6 address And here my problem. Its not the same as in olly's dump! Instead of : 22 27 1f 23 20 etc should be: 34 39 31 35 etc. Please,how to fix it??
kao Posted May 1, 2016 Posted May 1, 2016 (edited) "add dl, 30" is the cause of the problem. Olly uses hexadecimal by default. Visual Studio by default uses decimal. Change it to "add dl, 30h" or "add dl, 0x30" and you shall be happy. Edited May 1, 2016 by kao 2
baruch Posted May 1, 2016 Author Posted May 1, 2016 Wow! I can't believe! You right! it works! Thank You very much kao
e0qs Posted May 3, 2016 Posted May 3, 2016 (edited) Hey.... 9 div 4 = 2 ( C/C++: 9 / 4 ) 9 mod 4 = 1 ( C/C++: 9 % 4 ) #include <iostream> using namespace std; using std::hex; int main() { int sum, sum2, sum3; int a; int b; a = 0x71; b = 0xA; std:: cout << "71h / Ah = B" << endl; sum = a / b; std::cout << std::hex << std::uppercase << "Sum = " << sum << endl; } eq Edited May 3, 2016 by e0qs 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now