Reading the cpu registers from c++ MFC

I need to know how i can get the cpu registers value using c++ code.
i have a programm this programm will load assembly file .asm then i need to commpile the file by using the msasm then i need to run the code in c++ code then i need to know all the registers value like AX etc ... could any one help me.

Comments

  • : I need to know how i can get the cpu registers value using c++ code.
    : i have a programm this programm will load assembly file .asm then i need to commpile the file by using the msasm then i need to run the code in c++ code then i need to know all the registers value like AX etc ... could any one help me.
    :
    :

    this has nothing to do with MFC. Just use inline assembly code to copy the registers to C unsigned long variables. For example
    [code]
    void foo()
    {
    unsigned long _eax;
    _asm
    {
    mov eax,[_eax]
    }
    };
    [/code]
  • : : I need to know how i can get the cpu registers value using c++ code.
    : : i have a programm this programm will load assembly file .asm then i need to commpile the file by using the msasm then i need to run the code in c++ code then i need to know all the registers value like AX etc ... could any one help me.
    : :
    : :
    :
    : this has nothing to do with MFC. Just use inline assembly code to copy the registers to C unsigned long variables. For example
    : [code]
    : void foo()
    : {
    : unsigned long _eax;
    : _asm
    : {
    : mov eax,[_eax]
    : }
    : };
    : [/code]
    :
    Thank you this could help but could you please explain to me how i can
    run dynamic assembly code; this means that i need to load the assembly file while programm is running so how i will know that i have mov statement or should i need to parse the assemly file.... i hope you got my question again thank you for your help.

  • : :
    : Thank you this could help but could you please explain to me how i can
    : run dynamic assembly code; this means that i need to load the assembly file while programm is running so how i will know that i have mov statement or should i need to parse the assemly file.... i hope you got my question again thank you for your help.
    :
    :

    you can't do that in either C or C++ because they are not interpreted languages. You could, however, write DLLs or libraries, then swap them out for which ever ones you want
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories