Giter Club home page Giter Club logo

libpawn's Introduction

libpawn

Developer Language Forks Stars CodeFactor

C library that is intended for providing methods for executing and injecting code.

Features

  • Supports different ways of loading executable files in-memory.
  • Supports most common executable file formats: ELF, PE and Mach-O.
  • Lightweight and small library that can be ported to almost every single program.

Building libpawn

cmake -B build
cd build
make
sudo make install
Arch Support
x64 yes
aarch64 yes
armv5l yes
i486 yes
mips yes
powerpc yes
s390x yes
armv5b yes
mips64 yes
mipsel yes
powerpc64le yes

API usage

#include <pawn.h>

Mach-O

Execute main function from Mach-O bundle from buffer and pass argv and env as arguments.

int pawn_exec_bundle(usigned char *bundle, size_t size, char *argv[], char *env[]);

ELF

Execute ELF from buffer and pass argv and env to it.

int pawn_exec(unsigned char *elf, char *argv[], char *env[])

NOTE: This method does not work for statically linked targets since it uses dynamic interpreter as a part of ELF loading chain.

Write ELF to the file descriptor from buffer and execute it.

int pawn_exec_fd(unsigned char *elf, char *argv[], char *env[])

Examples

libpawn's People

Contributors

enty8080 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

libpawn's Issues

Can the project modified to load a .so file without call dlopen()?

Hi.

A .so file is also an ELF file, so can the project modified to load a .so file without call dlopen()? And is it easy to do that based on the project?

Specifically, a process call something like "pawn_dlopen" and load a .so file into current process, and then get the export function address and call it.

Thank you.

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.