0

I am writing a short C program, which runs in Android environment. I like to know if there is an object I can reference which would have a pointer to the same executable. I think it would be kind of like "this" pointer in Java. My goal is to get information about he executable itself. Ideally I like to have the start address and offset of the executable in memory. I like to know the answer for a native C code as well as an apk which I would potentially develop later. If you know the function I need to use, please let me know. I have complete control over the build and target environment. That is I can get root access on the target. I can also put the app on the image to be flashed on the phone vs. pushing it via IDE to /data partition.

I guess in C, I can use the current pointer?

user3326293
  • 817
  • 1
  • 14
  • 37

1 Answers1

0

Look at /proc/<pid>

This is the best you can get without hacking into the kernel

skoperst
  • 2,259
  • 1
  • 23
  • 35