Skip to content
Korcan Karaokçu edited this page Jun 29, 2016 · 23 revisions

I'll upload videos and pictures when the first release is done. Until that day, this will remain as a text guide

Attaching:

Click the computer icon on top-left to select the process

PINCE working logic:

It's the same with gdb's all-stop mode. You have to stop your process to make PINCE work, if you try to use PINCE without stopping, you'll get the "inferior is running" warning from the terminal(or some exceptions haha). Press F2 to stop the process, F3 to continue*(You can configure these hotkeys in settings)*. Once the process have been stopped, the title that shows process name and PID will turn red and there'll be a text next to it as "[stopped]". Example: 4174-KMines(black)...Pressed F2...4174-KMines[stopped](red)

Variable Inspection&Modification:

To add variables click the "AddAddressManually" button and select the type of the variable with an expression, expression can be a function name with an offset(malloc, printf+42, _start+567 etc.) or an address(0x00400000 etc.). To modify the contents of list elements, just double click on them and edit as you like. Multiple selection works. Smart casting mechanism will try to understand your expression in the most retarded ways, this lets you set "ff" to a float variable(it'll be 255.0).

Code Injection:

To inject your code into the process before attaching, compile your code into a .so file and rename it as "InitialCodeInjections.so" then move it to "Injection" folder in PINCE. An example and compile notes can be found in "Injection" folder. However, there's some nasty technical background to this. PINCE uses a simple dlopen call to inject your library at runtime, but it won't work on the targets that doesn't support dlopen. Fortunately, PINCE have another option called "linux-inject", it works even when dlopen isn't found in the target, but on the other hand, it has a very high chance to crash the target process if the target is multi-threaded. The injection method can be changed from the Settings(on the top right in main window)

PINCE working modes:

All-stop: PINCE's working mode by default, this is same with the gdb's all-stop mode
PINCE-non-stop: This is similar to gdb's non-stop mode. But! It has a very unique mechanism which lets PINCE to run ANY gdb command without stopping. With gdb's non-stop mode you can also achieve this feature on some commands, but you'll have to stop the target again for running most of the commands. PINCE-non-stop mode avoids this by injecting a thread to the target and then interrupting it. Whenever a command that requires stopping runs, PINCE automatically switches to that thread, runs the command and then switches back to the old thread. This is the true non-stop mode. But unfortunately, I had to drop the support for this mode. As I'm getting close to the debugging part of this project, I've noticed that PINCE-non-stop mode is going to cause some serious problems because of concurrency. Also PINCE needs hookpost feature of gdb for this and it's broken at some critical parts. The old codes that made this mode alive can be found in the "pince-non-stop-files" folder. This mode WILL RISE FROM IT'S GRAVE once the basic features of PINCE has been done.

Logging:

All logging output is redirected to both terminal and the logfile. Logfile can be found in "/tmp/PINCE-connection/$pid/gdb_async_output.txt"

Q&A

Q: Why did you put so many buttons if they aren't implemented yet?
A: Because knowing that, someday, I'll provide all the functionality for those buttons fills me with D E T E R M I N A T I O N

Clone this wiki locally