Skip to content

Instantly share code, notes, and snippets.

<peremen> 깻잎^cloud: TSP_로 시작하는 펌웨어는 mxt224E 수정 드라이버에서 불러올 거고요
<peremen> a225/a300은 Adreno 같아 보이고
<peremen> vics.* 이거는 퀄컴 비디오 인코딩 엔진이고
<peremen> es310_fw.bin 이거는 통화 오디오 앰프용 펌웨어임
//I will not use NULL terminated string for performance.
typedef struct charwithlen_struct {
char *data;
size_t len;
} charwithlen_t;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define CHUNK_SIZE 128
//I will not use NULL terminated string for performance.
@perillamint
perillamint / dumpcode.c
Created March 24, 2015 16:02
Ohhara's dumpcode - Linux kernel version.
#include <linux/kernel.h>
int isprintable(unsigned char c)
{
if(0x20 <= c && 0x7E >=c)
return 1;
return 0;
}
void printchar(unsigned char c)
@perillamint
perillamint / C_hacky_queue.c
Created March 26, 2015 16:44
Hacky OOP in C.
#include <stdio.h>
#include <stdlib.h>
//Some macro hack.
//new(constructor, object)
//delete(object)
#define new(x, o) o -> _constructor = x; o -> _constructor(o)
#define delete(x) x -> _destructor(x)
typedef struct queuenode_s {
@perillamint
perillamint / syscalltester.c
Created March 29, 2015 10:23
syscalltester.c
#include <unistd.h>
#include <stdio.h>
#if __x86_64__
#define __NR_my_enqueue 300
#define __NR_my_dequeue 301
#else // Assume X86_32
#define __NR_my_enqueue 338
#define __NR_my_dequeue 339
#endif
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.35.6-legolas+ (perillamint@Legolas) (gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC) ) #6 SMP Tue Mar 24 00:09:49 KST 2015
[ 0.000000] Command line: ro root=/dev/mapper/vg_legolas-lv_root rd_LVM_LV=vg_legolas/lv_root rd_LVM_LV=vg_legolas/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
[ 0.000000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
[ 0.000000] BIOS-e820: 0000000000100000 - 000000003ffdf000 (usable)
[ 0.000000] BIOS-e820: 000000003ffdf000 - 0000000040000000 (reserved)
@perillamint
perillamint / pperlgit.c
Created March 31, 2015 04:11
흔한_반도의_뻘짓.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define CHUNK_SIZE 128
//I will not use NULL terminated string for performance.
@perillamint
perillamint / cwithoutmain
Created April 1, 2015 19:24
cwithoutmain
#include <sys/syscall.h>
#include <unistd.h>
_start() {
char *hello = "Hello, World!\n";
syscall(__NR_write, 1, hello, 14);
syscall(__NR_exit, 0);
}
systemd-+-NetworkManager-+-dhclient
| |-{NetworkManager}
| |-{gdbus}
| `-{gmain}
|-accounts-daemon-+-{gdbus}
| `-{gmain}
|-at-spi-bus-laun-+-dbus-daemon
| |-{dconf worker}
| |-{gdbus}
| `-{gmain}