notpidgey / EagleVM

Native code virtualizer for x64 binaries
GNU General Public License v3.0
393 stars 47 forks source link

Possible std::string comparison operator call bug #11

Closed Smellon69 closed 7 months ago

Smellon69 commented 7 months ago

Describe the bug its just always "not ud"

To Reproduce

  std::string key;
  std::cout << "license key: ";
  std::cin >> key;

  fnEagleVMBegin();

  if (key == "1337") {
      printf("ud");
  }
  if (key != "1337") {
      printf("not ud");
  }

  fnEagleVMEnd();

Expected behavior ud/not ud

Additional context always not ud

Smellon69 commented 7 months ago

it works on C character sets, just not C++ character sets. The code below works

    fnEagleVMBegin();

    char key[100];

    printf("Enter a key: ");
    scanf("%s", key);

    printf("You entered: %s\n", key);

    if (key == "1337") {
        printf("ud");
    }

    MessageBoxA(NULL, "Ultra Detected", (LPCSTR)key, MB_OK | MB_ICONINFORMATION);

    fnEagleVMEnd();
Smellon69 commented 7 months ago

still always not ud

Smellon69 commented 7 months ago

ok fixed the if statements but it does not work AT ALL on C++ character sets

    fnEagleVMBegin();

    char key[100];

    printf("Enter a key: ");
    scanf("%s", key);

    printf("You entered: %s\n", key);

    MessageBoxA(NULL, "Ultra Detected", (LPCSTR)key, MB_OK | MB_ICONINFORMATION);

    if (strcmp(key, "1337") == 0) {
        printf("ud\n");
    }
    else {
        printf("not ud\n");
    }

    fnEagleVMEnd();
notpidgey commented 7 months ago

https://github.com/notpidgey/EagleVM/issues/11#issue-2193039101 I can't replicate this. Please upload the binary produces after compiling EagleVMSandbox. Please state whether you are compiling for Release or Debug as well. Make sure you pull the latest changes.

--

In the most respectful way, you are driving me crazy with the issues being posted. 5 issues open and you just keep leaving them inconclusive. I have not a single idea how you have problems compiling the project and when I try to help instead of explaining the issue, you just open a new one and leave the previous one open. Stop doing this. This is not a place to shitpost.

If I'm going to spend my time trying to help you solve your problems, take some effort to allow me to help you (by properly formatting issues instead of spamming). And pay back the same respect by concluding issues and verifying that the solution works or how you fixed the problem. This doesn't go just for me, but any open-source project and people in general.

I think I've asked on 3 separate occasions if you're using the most up to date version of the project for a reason which you have not responded to. Matter of fact, almost none of the questions I've asked to try to help you, you have not answered!

So, I will ask, go back to the previous issues and confirm the solution. VERIFY that you have the most recent version of the project by cloning the project again or using Git to pull the most recent changes.

Thanks

notpidgey commented 7 months ago

I would also like to encourage you to learn about x86 assembly as it might help you better understand the cause of the problems you are encountering. Open up IDA, take a look at the graph view, and don't press F5. Go one by one instruction and understand what's going on.

You can compare this with the result of the virtualized binary as well. Maybe you won't be able to easily understand what's going on with the virtualized code, but the control flow should be the same and you'll see the flow of instructions since conditional jump instructions are not yet virtualized.

🙂

notpidgey commented 7 months ago

If you are still having problems with all your other issues, this most likely resolves all of them. This bug was caused by randomness on release builds which I was not getting because I used a static random seed for debug builds.

Please comment and close issues accordingly.

Smellon69 commented 7 months ago

#11 (comment) I can't replicate this. Please upload the binary produces after compiling EagleVMSandbox. Please state whether you are compiling for Release or Debug as well. Make sure you pull the latest changes.

--

In the most respectful way, you are driving me crazy with the issues being posted. 5 issues open and you just keep leaving them inconclusive. I have not a single idea how you have problems compiling the project and when I try to help instead of explaining the issue, you just open a new one and leave the previous one open. Stop doing this. This is not a place to shitpost.

If I'm going to spend my time trying to help you solve your problems, take some effort to allow me to help you (by properly formatting issues instead of spamming). And pay back the same respect by concluding issues and verifying that the solution works or how you fixed the problem. This doesn't go just for me, but any open-source project and people in general.

I think I've asked on 3 separate occasions if you're using the most up to date version of the project for a reason which you have not responded to. Matter of fact, almost none of the questions I've asked to try to help you, you have not answered!

So, I will ask, go back to the previous issues and confirm the solution. VERIFY that you have the most recent version of the project by cloning the project again or using Git to pull the most recent changes.

Thanks

I've been unable to test it because of a few issues with Zydis. I downgraded from the latest Zydis to the v4 version to fix some incompatabilities with your source that occur on the latest Zydis version. My only issue now is MNEMONIC_VM_PUSH_RFLAGS not existing. You use this inside of cmp.cpp but I can't seem to find where this is defined anywhere.

notpidgey commented 7 months ago

@Smellon69 Go ahead and try again

Smellon69 commented 7 months ago

@Smellon69 Go ahead and try again

works :D you can close all issues related to this.