Skip to content

Instantly share code, notes, and snippets.

@jtpaasch
jtpaasch / Option_tutorial_for_Jane_Street_Core.md
Last active January 22, 2023 05:48
Tutorial/cheat sheet for Jane Street Core's Option.

Option (from Jane Street Core)

Convert a value to an optional something:

let some_message = Option.some "goodbye";;

Suppose you have some data:

@jtpaasch
jtpaasch / OCaml_Compiling_and_Running.md
Last active December 17, 2022 13:35
Tutorial/cheat sheet for compiling/running OCaml programs.
@jtpaasch
jtpaasch / json.ml
Last active August 30, 2018 16:45
Simple JSON parser (OCaml)
module Token = struct
type t =
| L_array_bracket
| R_array_bracket
| L_object_bracket
| R_object_bracket
| Colon
| Comma
@jtpaasch
jtpaasch / functors.ml
Created January 14, 2019 13:24
Functors in OCaml
(*********************************************************)
(** Simple functor example. *)
(** A simple signature. *)
module type X = sig
val x : int
end
(** Here's a fuctor.
* It takes an input: [M], which is an implementation
@jtpaasch
jtpaasch / Bap.BIL.notes.md
Created January 17, 2019 18:22
Bap BIL notes
@jtpaasch
jtpaasch / primus_evaluator_example.ml
Last active February 4, 2019 15:47
An example of a BAP/Primus component that evaluates assignments and jump targets.
(**
MAKEFILE:
plugin = primus_evaluator_example
all: clean build install
build:
bapbuild -pkg bap-primus -tags 'warn(A)' $(plugin).plugin
@jtpaasch
jtpaasch / Qemu-quickstart.md
Last active November 5, 2025 15:31
A quick cheatsheet/tutorial for using QEMU (on macOS, but should work on Linux too).
@jtpaasch
jtpaasch / primus_set_register_example.ml
Created February 13, 2019 13:46
A simple example of how to set registers with Primus
(*
plugin = primus_set_register_example
all: clean build install
build:
bapbuild -pkg bap-primus -tags 'warn(A)' $(plugin).plugin
install:
@jtpaasch
jtpaasch / primus_set_regs.ml
Last active February 19, 2019 22:02
Example of a Primus component that sets register values before running a function.
(*
MAKEFILE:
plugin = primus_set_regs
all: clean build install
build:
bapbuild -pkg bap-primus -tags 'warn(A)' $(plugin).plugin