Skip to content

Instantly share code, notes, and snippets.

@ekse
ekse / lib.rs
Created September 23, 2015 00:57
extern crate byteorder;
use std::io::{Read, Cursor, Seek, SeekFrom};
use std::fs::File;
use byteorder::{LittleEndian, ReadBytesExt};
pub type PeResult<T> = Result<T, PeError>;
[DISASM]
000000 //Instruction
aaaaaa //Directive
f3c5ff //Macro name
7e6082 //Register name
666666 //Other keywords
ffffff //Dummy data name
b9ebeb //Dummy code name
b9ebeb //Dummy unexplored name
bbecff //Hidden name
@ekse
ekse / keybase.md
Created February 7, 2016 21:03
keybase.md

Keybase proof

I hereby claim:

  • I am ekse on github.
  • I am ekse (https://keybase.io/ekse) on keybase.
  • I have a public key ASAjJhB91KqudymCaE1s1fqmK9wOeBDyN2LpAtdcVuE85Qo

To claim this, I am signing this object:

@ekse
ekse / ws.rs
Created January 31, 2018 19:25
extern crate ws;
use ws::{WebSocket, Sender, Handler, Factory, Message};
fn gimme_websocket() -> WebSocket<Factory<Handler = FnMut(Sender) -> (Fn(Message) -> ws::Result<()>)>> {
let f = |output: Sender| {
// The closure handler needs to take ownership of output
let handler = move |msg| {
println!("got '{}' ", msg);
};
int main(int argc, char* argv[]) {
return 0;
}
[lib]
crate-type = ["staticlib"]
#[no_mangle]
pub extern "C" fn print_hello() {
println!("hello world!");
}
cargo_build(NAME test-lib)
#ifndef TEST_LIB
#define TEST_LIB
#ifdef __cplusplus
extern "C" {
#endif
void print_hello();
#ifdef __cplusplus
#include "test_lib.h"
int main(int argc, char* argv[]) {
print_hello();
}