ptrace usage in ARM

612 Views Asked by At

I'm trying to analyse how a third party software is controlling some hardware. The board is i.mx7 based running i.MX Linux kernel 3.14.52.

The board is a development board and is running some demo software which I do not have the code for. Most of the configuration is done via ioctl calls and I've trying to use strace to learn more about information is being set/get.

As an example I get the following from strace:

ioctl(4, FBIOPUT_VSCREENINFO, 0x19fcebc)

I would like in some way to dereference the pointer in the third argument to see the data. I know the structure of the data, and from what I've read, if strace doesn't already know your structure, then you have no luck.

I have also read about writing my own code using ptrace to do something similar, but every single example is not for ARM. The code I've seen uses ORIG_EAX and EAX registers and ARM I believe uses orig_r and r7, but I have no idea how to access the "registers". I'm quite new to programming for Linux.

What's surprising is I can't even easily find anything in exhaustive Googling. Some threads allude to it but I cannot find specifics. I can't be the only person who needs to use ptrace on ARM? Admittedly I might be the only person trying to use it you don't know how!

Failing getting ptrace working, I would be happy just peeking at the memory where the strace indicates the structures are and I could rebuild them manually. How would I go about this?

Thanks for any hints or pointers, I'm really hitting a brick wall.

0

There are 0 best solutions below