Skip to content

Instantly share code, notes, and snippets.

@jtpaasch
jtpaasch / Compilers-Notes.md
Last active November 8, 2021 16:13
Notes about compilers.
@jtpaasch
jtpaasch / Webassembly.md
Created July 21, 2021 20:22
Notes about webassembly
@jtpaasch
jtpaasch / Ghidra-Info.md
Last active January 23, 2024 15:26
Ghidra info
@jtpaasch
jtpaasch / PL-resources.md
Last active October 15, 2021 23:53
Resources for Programming Language foo
@jtpaasch
jtpaasch / toyl.cls
Created March 25, 2021 21:17
A latex class for books
% ----------------------------------------------------------
% Custom document class
%
% Name: toyl
% Author: JT Paasch
% ----------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{bizboy}[2021/03/01 v.1 A demo LaTeX document class]
@jtpaasch
jtpaasch / examples.ml
Created March 11, 2021 19:33
Some examples of using OCaml's Format
(** Examples of OCaml Format pretty-printing.
Add a dune file:
(executable (name example))
Compile and run: dune exec ./example.exe
*)
(* First an easy one.
@jtpaasch
jtpaasch / ARM-with-Qemu.md
Last active September 28, 2022 01:45
Compiling and running C programs for ARM
apt install -y qemu qemu-user gcc-arm-linux-gnueabi binutils-arm-linux-gnueabi
arm-linux-gnueabi-gcc -marm main.c -o main
QEMU_LD_PREFIX=/usr/arm-linux-gnueabi qemu-arm main
@jtpaasch
jtpaasch / my_bap_loader.ml
Created August 27, 2020 21:20
Custom BAP loader
module Loader = struct
let empty_with_program filename prog =
let arch = `unknown and code = Memmap.empty and data = Memmap.empty in
Project.Input.create arch filename ~code ~data
~finish:(fun proj -> Project.with_program proj prog)
let load filename =
let prog = Program.create () in (* empty prog for now *)
empty_with_program filename prog
@jtpaasch
jtpaasch / SimpleMonadFunctorApplicativeExample.hs
Created April 3, 2020 20:46
Nice little example of monads, functors, and applicatives, from https://stackoverflow.com/a/47932927
- Otherwise you can't do the Applicative instance.
import Control.Applicative
-- Simple function
foo :: String -> String
foo x = do
x ++ "!!!"
-- Helper for printing Monads