Skip to content

A strace implementation in Golang using C wrappers with ptrace

Notifications You must be signed in to change notification settings

InfiniteVerma/gostrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gostrace

A process tracer CLI written in golang.

The design is rather straightforward. We get sys calls via ptrace functions using C wrappers and on each sys call type found, get it's arguments from memory and print it in human readable format.

Usage

go build .
./gostrace -p <pid>
go build .
./gostrace <path_to_binary>

Demo

2024-09-22.11-39-25.mp4

Setup

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

Sys calls implemented:

  • write
  • clock_nanosleep
  • close
  • lseek
  • openat
  • brk

About

A strace implementation in Golang using C wrappers with ptrace

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published