Instantly share code, notes, and snippets.

View hexdump_tool_by_yandros.c
/* Hexdump tool to "copy-paste" binaries into a shell.
* Useful for VM challenges.
* Compile with:
* $ cc -std=c99 -o slice slice.c
* By Yandros (
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
/* The following lib tests illustrate a lack of consistency in rust:
* the &identifier binding leads to 2 different behaviors based on whether
* - the identifier is the special 'self' first argument of a method,
* - or a simple variable / argument (called slf in the following tests)
#![allow(dead_code, unused_variables, unused_parens)]
/* compiler ensures that check_ref::<T>(x) can only be called iff x: &T */
fn check_ref<T> (_: &T) {}