Skip to content

Instantly share code, notes, and snippets.

View mkow's full-sized avatar

Michał Kowalczyk mkow

View GitHub Profile
@mkow
mkow / baby_vm2_assembler.py
Created April 4, 2018 20:27
Baby VM 2 - 0CTF 2018 - solver
from struct import pack
def make_insn(op, mode):
assert 0 <= op < 0x40
assert 0 <= mode < 4
return chr(op | (mode << 6))
DATA=0
ADDR=2
BOOL=3
@mkow
mkow / baby_vm_assembler.py
Created April 4, 2018 20:25
Baby VM - 0CTF 2018 - solver
from struct import pack
def make_insn(op, mode):
assert 0 <= op < 0x40
assert 0 <= mode < 4
return chr(op | (mode << 6))
DATA = 0
ADDR = 2
BOOL = 3
@mkow
mkow / nope.py
Created January 1, 2018 20:29
nope challenge solution from 34C3 CTF
from struct import pack, unpack
from sys import stdout, stderr, stdin
import socket
host = '35.198.126.67'
port = 4444
s = socket.create_connection((host, port))
def p64(x):
return pack('<Q', x)
[P5564] set tcb to 0xffe9658
[P5564] host: Linux-SGX
[P5564] initial random value: 6b40e37d9d091092
[P5564] allocate internal heap at 0xb9a4000 - 0xbaa4000
[P5564] User space range given from PAL: 0x10000-0xbaa4000
[P5564] setting initial heap to 0x10000-0xbaa4000
[P5564] bkeep_mmap: 0xb9a4000-0xb9ae000
[P5564] bkeep_mmap: 0xbaa0000-0xbaa4000
[P5564] bkeep_mmap: 0xba9b000-0xbaa0000
[P5564] bkeep_mmap: 0xba94000-0xba9b000