Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the address of a variable

Tags:

c

Is there a way to set an integer variable at the absolute address 0x67a9 to the value 0xaa55? The compiler is a pure ANSI compiler.

How to accomplish this?

This is a program related to embedded systems. As in there we can access a specific memory location.

like image 384
Angus Avatar asked Oct 16 '25 12:10

Angus


1 Answers

Try this:

*((int*)0x67a9) = 0xaa55;

like image 179
Bill Avatar answered Oct 19 '25 05:10

Bill