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 7169235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:56:46+00:00 2026-05-28T14:56:46+00:00

I have the following struct john { int oldA; int A; } myJohn; DWORD

  • 0

I have the following

struct john {
    int oldA;
    int A;
} myJohn;
DWORD gotoAddressBack = 0x00401000;

void __declspec( naked ) test(void) {
    __asm {
        MOV myJohn.oldA, DWORD PTR DS:[ESI+0x77C]
        MOV DWORD PTR DS:[ESI+0x77C], myJohn.A
        JMP gotoAddressBack
    }
}

You can tell that both MOV’s generate the error C2415: improper operand type.

As you can see what I want to do is store [ESI+0x77C]’s value into myJohn.oldA

Then I want to replace the same [ESI+0x77C]’s value with myJohn.A

  • 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-28T14:56:47+00:00Added an answer on May 28, 2026 at 2:56 pm

    There is no memory/memory operand for MOV instruction. You should use a register for such usages. This is something like that:

    void __declspec( naked ) test(void) {
        __asm {
            MOV EAX, DWORD PTR [ESI+0x77C]
            MOV myJohn.oldA, EAX
    
            MOV EAX, myJohn.A
            MOV DWORD PTR [ESI+0x77C], EAX
    
            JMP gotoAddressBack
        }
    }
    

    BTW, I really suspect that you really have to deal with segment registers under modern OSes (due to virtual memory, i.e. you can use direct addresses). You should check your code after above changes.

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

Sidebar

Related Questions

I'm using C++, and I have the following structures: struct ArrayOfThese { int a;
I have the following code: class outer { struct inner { int var1; int
I have the following problem: list.c struct nmlist_element_s { void *data; struct nmlist_element_s *next;
I have the following use case, a struct with some boolean and int variables
I have the following code struct Node { int accnumber; float balance; Node *next;
I have the following types: struct X { int x; X( int val )
I have the following struct: struct Records { int Number; char Name[20]; float Salary;
I have the following structs struct A { int i; A() { i =
I have the following struct: typedef struct { int someArray[3][2]; int someVar; } myStruct;
Suppose I have the following struct: struct sampleData { int x; int y; };

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.