https://github.com/zehmatt/pickyprofiler
Selective x86/x64 sourceless function profiling
https://github.com/zehmatt/pickyprofiler
profiler selective sourceless x86-64
Last synced: 12 months ago
JSON representation
Selective x86/x64 sourceless function profiling
- Host: GitHub
- URL: https://github.com/zehmatt/pickyprofiler
- Owner: ZehMatt
- License: mit
- Created: 2020-02-19T15:52:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-19T23:27:34.000Z (over 6 years ago)
- Last Synced: 2025-04-07T01:52:36.609Z (about 1 year ago)
- Topics: profiler, selective, sourceless, x86-64
- Language: C++
- Size: 33.2 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PickyProfiler
Experimental selective x86/x64 function profiler. The profiler will measure functions
specified by a text file. Right now it only measures enters/exits and the average time
the function takes, this is open for improvement.
# How it works
The profiler will create a call at start of the function procedure and swaps the return
address to a routine that will take care of timing and control flow fixups. So whenever
a function enters it will notify the profiler of a function enter with a unique function id
and once the function returns the profiler will be called again to notify the exit and restores
the original return address. Each function gets its own entry/exit routine generated with AsmJIT
to have a small footprint.
# NOTE
Currently only x86 is fully supported, x64 support is planned.
# Dependencies
Requires Zydis and AsmJIT, the best way to get them is to use vcpkg.
# Usage
Create a Functions.txt next to your target binary so that the folder structure
would look like following:
```
Directory of C:\MyApp
Functions.txt
MyApp.exe
```
The Functions.txt format goes as following:
```
[]
```
Example:
```
0x0027A462 myapp_function_1
0x0028820B myapp_function_2
0x0028840B
```
The last entry will be nameless and will show up as sub_(*).
Now all that is left to do is to start the process via the Loader
Example:
```
Loader.exe MyApp.exe
```
Which should result in a new text file called ProfilerReport.txt.
You can also inject the dll with other injectors or if you have the
source code available you can also just load the Picky.dll into your
process.