Skip to content

Instantly share code, notes, and snippets.

View hiromu's full-sized avatar

Hiromu Yakura hiromu

View GitHub Profile
@hiromu
hiromu / lazyk.c
Created December 8, 2011 10:33
Sample of sys_lazyk()
#include <string.h>
#include <stdio.h>
#include <asm/unistd.h>
#include <sys/syscall.h>
#ifdef __i386__
#define __NR_lazyk 349
#elif __x86_64__
#define __NR_lazyk 312
#elif __arm__
@hiromu
hiromu / bf.c
Created December 8, 2011 10:33
Sample of sys_brainfuck()
#include <string.h>
#include <stdio.h>
#include <asm/unistd.h>
#include <sys/syscall.h>
#ifdef __i386__
#define __NR_brainfuck 349
#elif __x86_64__
#define __NR_brainfuck 312
#elif __arm__
@hiromu
hiromu / 0001-Add-syscall-of-Lazy-K-interpreter-as-sys_lazyk.patch
Created December 8, 2011 10:28
sys_lazyk(): syscall of Lazy K interpreter
From b5fae6767cdee2dff093ab296b86926583f85512 Mon Sep 17 00:00:00 2001
From: Hiromu Yakura <hiromu1996@gmail.com>
Date: Thu, 8 Dec 2011 15:13:38 +0900
Subject: [PATCH] Add syscall of Lazy K interpreter as sys_lazyk
---
arch/arm/include/asm/unistd.h | 1 +
arch/arm/kernel/calls.S | 1 +
arch/x86/include/asm/unistd_32.h | 3 +-
arch/x86/include/asm/unistd_64.h | 2 +
@hiromu
hiromu / 0001-Add-syscall-of-brainfuck-interpreter-as-sys_brainf.patch
Created December 8, 2011 10:27
sys_brainfuck(): syscall of brainfuck interpreter
From 0696a912ecf5ba37bfb5670a79ec3840271c9591 Mon Sep 17 00:00:00 2001
From: Hiromu Yakura <hiromu1996@gmail.com>
Date: Thu, 8 Dec 2011 14:16:56 +0900
Subject: [PATCH] Added syscall of brainfuck interpreter as sys_brainfuck
---
arch/arm/include/asm/unistd.h | 1 +
arch/arm/kernel/calls.S | 1 +
arch/x86/include/asm/unistd_32.h | 5 +-
arch/x86/include/asm/unistd_64.h | 2 +
@hiromu
hiromu / Problem3.c
Created November 25, 2011 11:41
EPOCH Qualifier Problem3
__asm (
".data\n\t"
".weak __ildata_included\n\t"
".hidden __ildata_included\n\t"
".section __ildata, \"wa\"\n\t"
".byte 0\n\t"
".byte 6\n\t"
".byte 0\n\t"
".byte 0\n\t"
".byte 50\n\t"
@hiromu
hiromu / Problem2.c
Created November 25, 2011 11:41
EPOCH Qualifier Problem2
__asm__ (
".data\n\t"
".weak __ildata_included\n\t"
".hidden __ildata_included\n\t"
".section __ildata, \"wa\"\n\t"
".byte 0\n\t"
".byte 6\n\t"
".byte 0\n\t"
".byte 0\n\t"
".byte 50\n\t"
@hiromu
hiromu / Problem1.c
Created November 25, 2011 11:40
EPOCH Qualifier Problem1
__asm (
".data\n\t"
".weak __ildata_included\n\t"
".hidden __ildata_included\n\t"
".section __ildata, \"wa\"\n\t"
".byte 0\n\t"
".byte 6\n\t"
".byte 0\n\t"
".byte 0\n\t"
".byte 50\n\t"
@hiromu
hiromu / Problem1.c
Created October 8, 2011 08:14
EPOCH Qualifier
#include <stdio.h>
#include <stdlib.h>
int compare(const void *a, const void *b)
{
return (*(int *)b - *(int *)a);
}
int main(void)
{
@hiromu
hiromu / A* algorithm
Created September 12, 2011 01:35
GDD2011 Japan DevQuiz
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXSIZE 36
#define BLOCK -23
#define RC2P(r,c) ((r)*w+c)
#define P2R(p) (p/w)
#define P2C(p) (p%w)
@hiromu
hiromu / .config
Created July 25, 2011 16:38
kernel-3.0.0 config macbook4,1
#
# Automatically generated make config: don't edit
# Linux/x86_64 3.0.0 Kernel Configuration
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"