Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7159339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:12:53+00:00 2026-05-28T13:12:53+00:00

Say I got something like this.. bool isPatched; I have a few other GUI’s

  • 0

Say I got something like this..

bool isPatched;

I have a few other GUI’s where I set isPatched= true; and isPatched= false;, isPatched = !isPatched;

void __declspec( naked ) test(void) { //
    __asm {
        PUSHAD
        PUSHFD

        MOV EAX, isPatched
        CMP EAX, 0
        je noPatched
            MOV EAX, DWORD PTR DS:[ESI+0x77C]
            MOV John.oldA, EAX
            MOV EAX, John.A
            MOV DWORD PTR DS:[ESI+0x77C], EAX
            JMP finish
noPatched:
            PUSH EDX
            MOV DWORD PTR DS:[ESI+0x77C], EDX
        finish:
        POPFD
        POPAD

        JMP gotoAddressBack

    }
}

Is it possible to use bool operator in inline assembly?

I think it thinks isPatched is a label.. from this error message.
error C2094: label 'isPatched' was undefined

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:12:54+00:00Added an answer on May 28, 2026 at 1:12 pm

    You want to TEST or CMP. TEST is the easiest in this case:

    XOR EAX,EAX
    MOV AL,isPatched //isPatched would be a byte, hence we need correct operand sizes
    TEST EAX,EAX
    JE NotSet
    Set:
    //handle true case
    JMP End
    NotSet:
    //handle false case
    End:
    //continue
    

    Depending on other cases you can also use SUB, SETcc or MOVcc


    Your issue is one of scoping, isPatched is not in scope when used by the ASM, so it assumes it to be a DWORD, and then fails to find a memory label (the symbol name) for it when generating the addresses. You also need to use the correct operand size for bool as well.

    A dirty litte test for MSVC

    bool b = true;
    int __declspec( naked ) test(void) {
        __asm {
            xor eax,eax
            MOV al, b
            TEST eax,eax
            JE NotSet
            mov eax,1
    NotSet:
            RETN
    
        }
    }
    
    int _tmain(int argc, _TCHAR* argv[])
    {
        printf("%d\n", test());
        system("pause");
        return 0;
    }
    

    this outputs 1 when b is true, or 0 when b is false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say that I have got a vector like this. std::vector<a_complicated_whatever_identifier *> *something =
Say I've got something like this public void run(){ Thread behaviourThread = new Thread(abstractBehaviours[i]);
Say if've got a set of items with some data on them like this:
How to combine values (strings) in XPath? Say we've got something like this: <entry>
Say I have something like this (and I do) class QueBean extends JPanel {
Say that I have simple command line application, that looks something like this #
Lets say I have something like this: public ActionResult Test(SomeModel m) { try {
Say I've got a class where the sole data member is something like std::string
Say I've got a domain model created from C# classes like this: public class
Say I got two Controllers like this Table1sController , and Table2sController . With corresponding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.