Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Help] asm code to inline asm in cpp need repair

Featured Replies

Posted

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)

1.PNG

After the loop,the address 406549 look like:

2.PNG

Now,because i dont know how to code assembly DIV in c++ i did "inline assembly":

3.PNG //equivalent to address 406549

4.PNG

In visual studio i put break point to see what happend after that code:

5.PNG

6.PNG//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.

7.PNG

 

Please,how to fix it??

"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 by kao

  • Author

Wow! I can't believe! You right! it works!

Thank You very much kao :)

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 by e0qs

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.