Coder Social home page Coder Social logo

hartl3y94 / binflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elfmaster/binflow

0.0 0.0 0.0 1.36 MB

This is the new ftrace (https://github.com/elfmaster/ftrace) - Much faster, better resolution but not complete yet! :)

Makefile 0.14% C 17.22% C++ 41.41% Python 1.22% Java 1.83% Shell 0.03% OCaml 0.87% Ruby 0.01% PHP 37.27% Tcl 0.01%

binflow's Introduction

DISCLAIMER: This software sucks, I wrote it in about a day, and never finished it. The code base is terrible!
Feel free to use the code if it helps you, but realize that it was a half-baked prototype that I never completed.
The idea is to write a version of github.com/elfmaster/ftrace that sets breakpoints instead of singlestepping naively.
There is an even faster method which avoids the use of ptrace all together, and will be possible to write quite easily
once this ul_exec_trace debugging functionality is added into github.com/elfmaster/libelfmaster

With that said:

binflow v0.0.1

This software is a re-design of ftrace (https://github.com/elfmaster/ftrace)
which was somewhat popular but has some naive implementation qualities that
make it slow, and not suitable for some applications. 

binflow is much faster, and has better argument resolution and will be able
to handle multi-threaded applications/processes. Currently it is only 30%
complete and does not yet handle return values.

Stay tuned. Here is an example of binflow tracing a binary that was compiled
from the following source code:

int f(int a, int b, int c)
{
	printf("%d, %d, %d\n", a, b, c);
}

int main(void)
{
	int j = 0;
	int i;
	char *ptr = strdup("Hello");
	char buf[255];
	strncpy(buf, "hello", 8);
	printf("%s\n", buf);
	printf("%s\n", ptr);
	f(3, 2, 1);
	for (i = 0; i < 3; i++)
		f(1 + i, 2, 3 + i);
}

$ ./binflow -s -b ./test
PLT_call@0x4005b4: __libc_start_main()
LOCAL_call@0x4007ae: _init()
LOCAL_call@0x4006d3: strdup("Hello")
PLT_call@0x4006f3: strncpy((stack_t *)7fffef7a1c90, "hello", 0x8)
PLT_call@0x400702: puts("hello")
hello
PLT_call@0x400711: puts("Hello")
Hello
LOCAL_call@0x400725: f(0x3, 0x2, 0x1)
PLT_call@0x4006a3: printf("%d, %d, %d\n", 0x3, 0x2, 0x2)
3, 2, 1
LOCAL_call@0x40074f: f(0x1, 0x2, 0x3)
PLT_call@0x4006a3: printf("%d, %d, %d\n", 0x1, 0x2, 0x2)
1, 2, 3
LOCAL_call@0x40074f: f(0x2, 0x2, 0x4)
PLT_call@0x4006a3: printf("%d, %d, %d\n", 0x2, 0x2, 0x2)
2, 2, 4
LOCAL_call@0x40074f: f(0x3, 0x2, 0x5)
PLT_call@0x4006a3: printf("%d, %d, %d\n", 0x3, 0x2, 0x2)
3, 2, 5
$

binflow's People

Contributors

elfmaster avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.