Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊

Pamplemousse

🍊
View GitHub Profile
View bap-shell.nix
/*
Using this `shell.nix`, here is how to install BAP using `opam`:
```
opam init --comp=4.09.0
eval $(opam env)
opam install bap
```
*/
with import <nixpkgs> { };
@Pamplemousse
Pamplemousse / tag_parameter_definitions_decorator.py
Created Nov 4, 2020
Decorate function handlers in `angr`'s RDA to highlight definitions passed as parameter to external functions.
View tag_parameter_definitions_decorator.py
def tag_parameter_definitions(func):
"""
Add a `ParameterTag` to the definitions of the arguments of the function simulated by the handler.
"""
@functools.wraps(func)
def wrapper(self, state: 'ReachingDefinitionsState', codeloc: 'CodeLocation'):
arch = state.arch
tag = ParameterTag(
function = codeloc.ins_addr,
View cross-shell.nix
with import <nixpkgs> { };
let
armhfDependencies = [
pkgsCross.armv7l-hf-multiplatform.buildPackages.targetPackages.glibc
pkgsCross.armv7l-hf-multiplatform.buildPackages.targetPackages.ncurses5
pkgsCross.armv7l-hf-multiplatform.buildPackages.targetPackages.readline5
];
in stdenv.mkDerivation {
name = "cross-environment";
View firmware-analysis-shell.nix
with import <nixpkgs> { };
let
python38WithPackages = python38.withPackages(ps: with ps; [
binwalk
]);
firmware-mod-kit = fetchFromGitHub {
owner = "rampageX";
repo = "firmware-mod-kit";
View zap-shell.nix
with import <nixpkgs> { };
stdenv.mkDerivation rec {
name = "ZAP";
buildInputs = [
openjdk
];
shellHook = ''
View contribute_to_nixpkgs_cheatsheet.md

Contribute to nixpkgs cheatsheet

Tips and tricks for one who wants to write expressions to contribute to NixOS/nixpkgs .

Build a package from local nixpkgs

nix-build <PATH_TO_NIXPKGS> -A <PACKAGE>
View r2_backward_slicing.py
"""
Backward slice from a given sink.
Unfortunately, the BB definition used by Radare2 is too limiting:
https://github.com/radareorg/radare2/issues/7170#issuecomment-631579110
"""
from functools import reduce
import r2pipe
import sys
View microcorruption-shell.nix
/*
* Help write shellcodes targetting MSP430:
* ```
* msp430-elf-as shellcode.s -o shellcode.o
* msp430-elf-objcopy --dump-section .text=shellcode shellcode.o
* od -An -t x1 shellcode | tr -d ' '
* ```
*/
with import <nixpkgs> {
View display_networkx_graph.py
import os
from networkx.drawing.nx_agraph import write_dot
write_dot(netowrkx_graph, 'graph.dot')
os.system('dot -Ksfdp -Tsvg -o graph.svg graph.dot')
View ctf-shell.nix
with import <nixpkgs> { };
let
python3WithCoolPackages = python3.withPackages(ps: with ps; [
flask
ipdb
ipython
lxml
manpages
pycrypto
You can’t perform that action at this time.