Skip to content

Instantly share code, notes, and snippets.

View coolxv's full-sized avatar
🏠
Working from home

coolxv coolxv

🏠
Working from home
  • Dalian, China
View GitHub Profile
@coolxv
coolxv / 00_readme.md
Created July 20, 2022 00:56 — forked from p4bl0-/00_readme.md
A complete compiler for a simple language (in less than 150 LoC)

This project is a tiny compiler for a very simple language consisting of boolean expression.

The language has two constants: 1 for true and 0 for false, and 4 logic gates: ! (not), & (and), | (or), and ^ (xor).

It can also use parentheses to manage priorities.

Here is its grammar in BNF format:

expr ::= "0" | "1"

@coolxv
coolxv / DetourHook.cpp
Created June 2, 2022 07:42 — forked from TheRouletteBoi/DetourHook.cpp
Hooking any function including imports and exports. PowerPC, PPC, PS3, Playstation 3
#include "DetourHook.hpp"
#define POWERPC_REGISTERINDEX_R0 0
#define POWERPC_REGISTERINDEX_R1 1
#define POWERPC_REGISTERINDEX_R2 2
#define POWERPC_REGISTERINDEX_R3 3
#define POWERPC_REGISTERINDEX_R4 4
#define POWERPC_REGISTERINDEX_R5 5
#define POWERPC_REGISTERINDEX_R6 6
#define POWERPC_REGISTERINDEX_R7 7
@coolxv
coolxv / .Cloud.md
Created June 16, 2021 00:35 — forked from imba-tjd/.Cloud.md
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@coolxv
coolxv / stack_traces.c
Created December 8, 2020 11:40 — forked from jvranish/stack_traces.c
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>
@coolxv
coolxv / veh_hook.cpp
Created October 12, 2020 01:28 — forked from ReubenBond/veh_hook.cpp
INT3 Vectored Exception Handler hooking
/**
veh_hook Vectored Exception Handler hooking library
Version: 24-March-2008
**/
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include "veh_hook.h"
static veh_list_t* list = NULL;