-1

I am getting Access violation writing location 0xB7066CBC while running this code.Unable to figure out whats going on, any suggestions?

int main(void)

{
unsigned int SIG = 0x00000000;
unsigned int *base = (unsigned int *)0xb7066CBC;
SIG = 0x5a5a5a5a;
memcpy(base ,&SIG, 4);
}

Here are the values I am getting when I encounter this failure.

&SIG 0x003bf7c0 {0x5a5a5a5a}
SIG  0x5a5a5a5a
base 0xb7066cbc {???}
Kalangu
  • 135
  • 10

1 Answers1

0

I am getting Access violation writing location 0xB7066CBC while running this code.Unable to figure out whats going on

What's going on is that the 4 bytes at location 0xB7066CBC are not writable.

Your problem most likely lies in whatever reasoning led you to believe that these bytes are (or should be) writable, but since you didn't provide any clue as to what that reasoning might be, it's hard to offer any help.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • Got it. That memory location is processor specific and has to run on a different environment than my local machine. Thanks the above exploitation helped. – Kalangu Oct 16 '18 at 17:46