pintool | reversing challenges in CTFs events | Hacking library
kandi X-RAY | pintool Summary
kandi X-RAY | pintool Summary
This tool can be useful for solving some reversing challenges in CTFs events. Implements the technique described here:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Solve a password .
- Return a character set from a number .
- Start the program .
- Get pin count .
- detect length of password
- Add char to initpass .
pintool Key Features
pintool Examples and Code Snippets
Community Discussions
Trending Discussions on pintool
QUESTION
I'm trying to write a pintool on windows. One thing I want to do is print stack trace after specific instructions. According to the Pin Manual, the PIN_Backtrace is only available on Linux and Mac OS. Is there any equivalent solutions on Windows?
...ANSWER
Answered 2022-Jan-09 at 21:34Create a shadow stack instead instrumenting all the routines in all the modules using RTN_InsertCall at both IPOINT_BEFORE and IPOINT_AFTER, and modifying the Shadow stack(s) accordingly.
This way you can print the Shadow stack and don't need the backtrace.
QUESTION
I want to clobber all load instructions - essentially, I want to find all load instructions, and after the load is complete I want to modify the value in the register that stores the value that was read from memory.
To do so, I instrument all instructions and when I find a load I insert a call to some function that will clobber the write register after the load. I pass in the register that needs to be modified (i.e. the register containing the data loaded from memory) using PIN_REGISTER*
.
Assuming I know the type of data that was loaded (i.e. int, float, etc.) I can access the PIN_REGISTER
union according to the data type (See this). However, as you can see in the link, PIN_REGISTER
stores an array of values - i.e. it doesn't store one signed int but rather MAX_DWORDS_PER_PIN_REG signed ints.
Will the value loaded from memory always be stored at index 0? If for instance, I load a 32 bit signed int from memory into a register, can I always assume that it would be stored at s_dword[0]
? What if for instance I write to the 8 bit AH/BH/CH/DH registers? Since these correspond to "middle" bits of 32 bit registers, I assume the data would not be at index 0 in the array?
What's the easiest way for me to figure out which index in the array the loaded data is stored at?
...ANSWER
Answered 2020-Jul-06 at 20:15If for instance, I load a 32 bit signed int from memory into a register, can I always assume that it would be stored at s_dword[0]?
Yes.
If you are in long mode and have, e.g., the RAX register, you have two DWORDs: the lower less significant 32 bits (index 0 in s_dword
) and the higher most significant 32 bits (index 1 in s_dword
).
What if for instance I write to the 8 bit AH/BH/CH/DH registers? Since these correspond to "middle" bits of 32 bit registers, I assume the data would not be at index 0 in the array?
Note: AH
is rAX[8:16]
(rAX is RAX or EAX), not really in the 'middle'.
It really depends on which member of the union you are accessing. If we stay with the s_dword
member (or dword
), then AH
is still in the "lowest" DWORD (index 0) of the 32 or 64-bit register. It' is at the same time in the high part (most significant 8 bits) of the lowest WORD (16-bit quantity).
QUESTION
I have an example C program test.c
that defines three functions only: main
, fn1
and fn2
:
ANSWER
Answered 2020-May-14 at 23:54is there any way to differentiate these from the other application symbols?
No.
I can't find a way to filter my instrumentation pintool written in C++ to the routines within the .text section that I care about
It's your application. Surely you can either use consistent naming, or collect a list of symbols you care about, and use that.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pintool
You can use pintool like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page