Skip to content

A tool that takes a snapshot of ELF execution context and run it with unicorn-engine.

License

GPL-2.0, MIT licenses found

Licenses found

GPL-2.0
LICENSE
MIT
LICENSE-udbserver.txt
Notifications You must be signed in to change notification settings

rota1001/snapcorn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snapcorn

A tool that take a snapshot of a ELF execution context and run it with unicorn-engine.

It captures memory, registers, mappings during runtime and deliver them to unicorn-engine.

Features

  • Take snapshot at specific address (or entry point)
  • Take snapshot of process by PID
  • Save/Load the context to/from file
  • x86 AVX support with hooking
  • Remote debugging via udbserver

Dependencies

Please checkout my blog to install the dependencies.

Build

Just use make to compile.

make

Usage

I use a simple elf build/example as an example, you can input your name and it will say hello to you.

Load ELF file with snapcorn

Use the following command, it will take a snapshot when hitting the entry point and start emulating it in unicorn.

./snapcorn build/example

In this example, you will see this:

...
[+] Getting FPU/MMX/SSE Registers (ST, XMM)...
[+] Getting AVX/AVX-512 Registers (YMM, ZMM, K)...
[+] Start Emulating
===========================================

And you can enter your name, it will say hello to you:

aaa
Hello, aaa
===========================================
[+] DONE

Take snapshot by pid

You can first execute your program, use ps aux to find the pid of that process (for example 12345), and attach to it with -p option:

./snapcorn -p 12345

Export the context to file

For the above to snapshot method, you can both output the context to file with -o option:

./snapcorn -p 12345 -o out

Import the context from file

You can use -l to load the context from the exported file and start the simulation:

./snapcorn -l out

GDB server

You can use -gdb to start a gdb server at a specific port (for example 1234):

./snapcorn -l out -gdb 1234

Future Works

  • kernel support?
  • more arch suport?

License and Third-Party Software

This project is licensed under GPLv2 and includes the following third-party software:

  1. unicorn
  2. udbserver

About

A tool that takes a snapshot of ELF execution context and run it with unicorn-engine.

Resources

License

GPL-2.0, MIT licenses found

Licenses found

GPL-2.0
LICENSE
MIT
LICENSE-udbserver.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published