Skip to content

Instantly share code, notes, and snippets.

View llxiaoyuan's full-sized avatar
🚢
Where knowledge ended, speculation began.

Chase llxiaoyuan

🚢
Where knowledge ended, speculation began.
View GitHub Profile
@jokertarot
jokertarot / clfontpng.cc
Created November 21, 2013 15:43
How to render color emoji font with FreeType 2.5
// = Requirements: freetype 2.5, libpng, libicu, libz, libzip2
// = How to compile:
// % export CXXFLAGS=`pkg-config --cflags freetype2 libpng`
// % export LDFLAGS=`pkg-config --libs freetype2 libpng`
// % clang++ -o clfontpng -static $(CXXFLAGS) clfontpng.cc $(LDFLAGS) \
// -licuuc -lz -lbz2
#include <cassert>
#include <cctype>
#include <iostream>
#include <memory>
@rakesh-gopal
rakesh-gopal / listusb.c
Created January 7, 2015 13:02
List the USB devices connected
#ifdef __cplusplus
extern "C" {
#endif
#include <windows.h>
#include <tchar.h>
#include <setupapi.h>
#include <initguid.h>
@ilammy
ilammy / Makefile
Created April 5, 2015 18:31
Linux kernel system call table hooking
obj-m += afw.o
afw-objs := afw_main.o locate_sct.o ttgl.o
ccflags-y := -std=gnu99 -O2
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@yohhoy
yohhoy / ff2cv.cpp
Last active December 14, 2024 12:44
Read video frame with FFmpeg and convert to OpenCV image
/*
* Read video frame with FFmpeg and convert to OpenCV image
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>
@skochinsky
skochinsky / guids.txt
Created July 4, 2016 16:27
UEFI file/section GUIDs collection
; AMI
[GUID_FILE]
; ACPI tables
16D0A23E-C09C-407d-A14A-AD058FDD0CA1=ACPI
11D8AC35-FB8A-44d1-8D09-0B5606D321B9=DSDT
95DFCAE5-BB28-4d6b-B1E2-3AF3A6BF434F=PTID
FB045DB2-598E-485A-BA30-5D7B1B1BD54D=AOAC
60AC3A8F-4D66-4CD4-895A-C3F06E6665EE=iFfsAcpiTables
5B232086-350A-42c7-A70E-3497B5765D85=OEMSSDT
299141BB-211A-48a5-92C0-6F9A0A3A006E=PPMACPI
@AdrianKoshka
AdrianKoshka / make_ipxe_uefi_usb.md
Last active June 21, 2025 03:12
Making a UEFI bootable iPXE USB drive

Making a UEFI bootable iPXE USB drive

Build the UEFI executable for iPXE

# First we'll clone iPXE
$ git clone git://git.ipxe.org/ipxe.git
# Go into the src directory of the cloned git repo
$ cd ipxe/src
# Compile the UEFI iPXE executable
@w4kfu
w4kfu / dllinjshim.cpp
Last active June 17, 2024 02:12
DLL Injection via Shim
/*
-------- dllinjshim.cpp --------
> cl /Fe:dllinjshim.exe dllinjshim.cpp
> dllinjshim.exe
> sdbinst moo.sdb
/!\ On Windows 10 there is a new function `SdbIsKnownShimDll` called
in `SdbGetDllPath` which will check the DLL name against the following list:
@bwangelme
bwangelme / dns_lookup.py
Created April 19, 2018 07:02
Python DNS 查询时指定DNS服务器
#!/usr/bin/env python3
# -*- coding: utf-8 -*-"
import dns.resolver
myResolver = dns.resolver.Resolver()
myResolver.nameservers = ['223.5.5.5', '223.6.6.6']
myAnswers = myResolver.query("www.baidu.com", "A")
for rdata in myAnswers:
@Barakat
Barakat / kernel-shellcode.cpp
Created December 27, 2018 19:55
Windows x64 shellcode for locating the base address of ntoskrnl.exe
#include <wdm.h>
__declspec(dllexport)
__declspec(noinline)
void*
GetNtoskrnlBaseAddress()
{
//
// From Windows Internals part 1, chapter 2:
//
@adrianyy
adrianyy / drvscan.cpp
Created May 2, 2019 16:37
vulnerable driver scanner
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <filesystem>
#include <Windows.h>
#include <winternl.h>
static_assert( sizeof( void* ) == 8 );