Skip to content

Instantly share code, notes, and snippets.

=== gen.py ===
#!/usr/bin/python3
def glob_format(s):
g = globals().copy()
if 'n' in g:
g['n_inc'] = (g['n'] + 1) % 256
g['n_dec'] = (g['n'] - 1) % 256
g['n_c'] = chr(g['n'])
if 'c' in g:
window.onload = function() { alert('XSS!'); }
@bennydictor
bennydictor / gist:c4e005808bd17a834fe8
Created May 15, 2015 21:15
Factorial written is GNU Assembler
.text
.global _start
_start: # syscall is done by %rax(%rdi, %rsi, %rdx)
# read(fd, buf, count)
# we want read one char from stdin, so %rax = 1; %rdi = 1; %rsi = buffer; %rdx = 1
movq $buffer, %rsi # pointer to buffer
movq $0, %rdi # STDIN_FILENO
movq $1, %rdx # one char
rchar: movq $0, %rax # syscall read number (as defined in asm/unistd.h)