简体   繁体   中英

PIN - get process ID for the Binary being instrumented?

Hi does anyone know how to get the process ID for the binary that is being instrumented by PIN? So for example if I have something like:

pin -t MyTool -- somebinary

How do I get the process ID for 'somebinary' inside the PINTool that I'm trying to write. I checked the documentation but there doesn't seem to be anything I can use, or maybe I've overlooked something? Thanks.

I think you can directly use getpid()? This is how I do when making Pin tools.

http://man7.org/linux/man-pages/man2/getpid.2.html

Pin also provides process related APIs

http://software.intel.com/sites/landingpage/pintool/docs/62732/Pin/html/group__PIN__PROCESS__API.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM