Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22122

how do you intercept the address of an instruction that is writing to a segment of memory?

$
0
0

Imagine we have a usual instruction such as this one

mov [eax], ebx

and eax contains some address that we would like to write to.

The idea is to write a c program that tells you which address contains the instruction, if we already know the address that it's going to be writing to.

The real question: write a c program using the free sony pspsdk that would accomplish the same thing.

The psp uses MIPS III / IV and the instruction would look something like

sw a0 $00(t0)
##which literally spells out store register a0 at offset t0 + 0 bytes. where t0 would
## contain something like 0x08800000

disclaimer: it is still useful to know how to do this on windows, so if somebody only knows how to do this on windows or even osx, That would still be appreciated as it could provide relevant information on similar programming practices to accomplish this particular task.


Viewing all articles
Browse latest Browse all 22122

Trending Articles