Skip to content

Instantly share code, notes, and snippets.

View stevenjohnstone's full-sized avatar

Steven Johnstone stevenjohnstone

  • Smarter Grid Solutions
  • Glasgow
View GitHub Profile
package main
import (
"fmt"
// a branch of keystone golang bindings which builds on linux
"github.com/stevenjohnstone/keystone/bindings/go/keystone"
uc "github.com/unicorn-engine/unicorn/bindings/go/unicorn"
)
(set-logic QF_BV)
; Convention here is add a label to the end of the register
; to mark a step in the program for which the value applies.
; e.g.
; rdx0 is the first value of rdx, rdx1 is the value at the
; next step of the program, rdxN is the value at the Nth
; step.
;
; Essentially, we're turning an assembly program into SSA form
@stevenjohnstone
stevenjohnstone / 0x03.c
Created January 12, 2019 21:56
Embedding 0x03 in C
#include <stdio.h>
static int x3(int a, int b) {
int out;
asm(
// it's not stated in xchg rax,rax but it's
// intel syntax. Note the noprefix means we
// don't need % before registers
".intel_syntax noprefix;"