Skip to content

Instantly share code, notes, and snippets.

Avatar

Alfredo Beaumont abeaumont

View GitHub Profile
View algebraic.ml
module Lexer = struct
type token =
Num of int
| Id
| Plus
| Minus
| Product
| Division
| Exponent
| LPar
View t.py
if 0:
if 0:
if 0:
if 0:
if 0:
if 0:
if 0:
if 0:
if 0:
if 0:
View t.java
public class A{public static void x(){
if(0){
if(0){
if(0){
if(0){
if(0){
if(0){
if(0){
if(0){
if(0){
@abeaumont
abeaumont / C.pi
Last active May 1, 2017
GCJ 2017 Round 1C. Problem C. Core Training
View C.pi
import util, mip.
go(T, N, K, U, Xs) =>
X = new_array(N),
X :: 0.0..1.0,
foreach(I in 1..N)
X[I] #>= Xs[I],
X[I] #<= Xs[I] + U
end,
sum(X) #<= sum(Xs) + U,
@abeaumont
abeaumont / memory-addressing.py
Created Aug 11, 2016
Get memory addressing mode stats from a binary
View memory-addressing.py
#!/usr/bin/env python
import sys
from collections import Counter
from elftools.elf.elffile import ELFFile
from capstone import *
from capstone.x86 import *
def get_binary(file: str) -> (bytes, int):
with open(file, 'rb') as stream:
View xkcd.py
from pwn import *
for i in range(512, 768):
t = remote('xkcd_be4bf26fcb93f9ab8aa193efaad31c3b.quals.shallweplayaga.me', 1354)
t.send('SERVER, ARE YOU STILL THERE? IF SO, REPLY "' + 'A' * 512 + '" ({} LETTERS)\n'.format(i))
print t.recvline()
t.close()
@abeaumont
abeaumont / catch.c
Created May 10, 2016
Solution for Catch Me challenge in ASIS CTF 2016 Quals
View catch.c
#include <stdio.h>
int is_valid(unsigned char c) {
return c == 0 || c == 45 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c == 95 || c >= 97 && c <= 122;
}
int main () {
unsigned char h1[17] = {0x87, 0x29, 0x34, 0xC5, 0x55, 0xB0, 0xC2, 0x2D, 0xEE, 0x60, 0x34, 0xD4, 0x55, 0xEE, 0x80, 0x7C, 0};
unsigned char h2[17] = {0xEE, 0x2F, 0x37, 0x96, 0x3D, 0xEB, 0x9C, 0x79, 0xEE, 0x2C, 0x33, 0x95, 0x78, 0xED, 0xC1, 0x2B, 0};
View string-aref-test.dylan
module: string-aref-test
define function main ()
let t = "abcdefg";
let (a, b) = method() values(t[2], 'c') end();
format-out("%= %=\n", a, b);
let (c, d) = values(t[2], 'c');
format-out("%= %=\n", c, d);
let x = #[1, 2, 3, 4];
let (e, f) = method() values(x[2], 'c') end();
@abeaumont
abeaumont / tlang.lisp
Last active Aug 29, 2015
Solution for TLang problem, (ab)using reader macros https://contest.tuenti.net/resources/2011/Question_2.html
View tlang.lisp
(defun transform-expr (expr)
(if (symbolp expr)
(let ((s (symbol-name expr)))
(cond ((string-equal s "=") '+)
((string-equal s "@") '-)
(t expr)))
expr))
(defun read-next-object (delimiter &optional (stream *standard-input*))
(if (and delimiter (char= (peek-char t stream t nil t) delimiter))
@abeaumont
abeaumont / hitcon-polyglot
Created Aug 18, 2014
Hitcon CTF 2014 polyglot (C, Python 2, Python 3, Ruby, Haskell)
View hitcon-polyglot
a={-1//1,""""/=>3}
#if 0
BEGIN { puts `cat flag`; exit; }
__END__
"""} # "
import os; os.system('cat flag')
""" # "
#endif
};
main () { system("cat flag"); } /* -} 0