Skip to content

Instantly share code, notes, and snippets.

View richo's full-sized avatar

richö butts richo

View GitHub Profile
#!/usr/bin/env ruby
class Butts
def foo
a = 1
a += 42
puts "hi #{a}"
end
end
puts RubyVM::InstructionSequence.disasm(Butts.new.method(:foo))
richo@hostname:~$ curl -v r.psych0.tk/enhooken > /tmp/enhooken
* About to connect() to r.psych0.tk port 80 (#0)
* Trying 192.30.252.153... % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected
> GET /enhooken HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: r.psych0.tk
> Accept: */*
>
#![feature(exit_status)]
#![feature(rustc_private)]
extern crate syntax;
extern crate rustc_back;
use rustc_back::svh::Svh;
use syntax::{parse,ast,diagnostic};
use std::path;
use std::io;
package main
import (
"crypto/rand"
"fmt"
"log"
"math/big"
"os"
)
package main
import (
"fmt"
"math/rand"
)
func main() {
fmt.Println(rand.Int())
}
@richo
richo / main.rs
Last active August 29, 2015 14:25
use std::io::Read;
enum Direction {
North,
South,
East,
West,
}
impl Direction {
int X509_verify_cert(X509_STORE_CTX *ctx)
{
X509 *x,*xtmp,*chain_ss=NULL;
int bad_chain = 0;
X509_VERIFY_PARAM *param = ctx->param;
int depth,i,ok=0;
int num;
int (*cb)(int xok,X509_STORE_CTX *xctx);
STACK_OF(X509) *sktmp=NULL;
if (ctx->cert == NULL)
int X509_verify_cert(X509_STORE_CTX *ctx)
{
X509 *x,*xtmp,*chain_ss=NULL;
int bad_chain = 0;
X509_VERIFY_PARAM *param = ctx->param;
int depth,i,ok=0;
int num;
int (*cb)(int xok,X509_STORE_CTX *xctx);
STACK_OF(X509) *sktmp=NULL;
if (ctx->cert == NULL)
pub opaque type Foo = usize;
pub fn frob(f: Foo) -> usize {
f as usize
}
#!/usr/bin/env ruby
def add1(a)
a + 1
end
puts RubyVM::InstructionSequence.disasm(method(:add1))