Skip to content

Instantly share code, notes, and snippets.

View lingol's full-sized avatar
🎯
Focusing

Guo Ling lingol

🎯
Focusing
View GitHub Profile
#include <pthread.h>
#include <cstdint>
#include <cstring>
/// a POC of OHOS's libc pthread mutex memory corruption bug
/// this file is published in BSD 3-Clause License
static void pthreadMutexMemoryCorruptPOC() {
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
@lingol
lingol / hyper_function.hpp
Last active February 9, 2023 06:35
A std::function-like util, with the feature of accepting inheritance function.
//
// hyper_function.hpp
// libkinda_objc
//
// Created by Ling Guo on 2019/1/31.
//
#ifndef hyper_function_h
#define hyper_function_h
@lingol
lingol / edit_dynamic_entry_library_name.txt
Created July 13, 2018 03:58
How to edit dynamic library's dynamic-entry-library name
How to edit dynamic library's dynamic-entry-library name.
Using LIEF lib (https://github.com/lief-project/LIEF).
GUOLING-MC4:~/Desktop$ pip install setuptools --upgrade
GUOLING-MC4:~/Desktop$ pip install lief 130
GUOLING-MC4:~/Desktop$ python
Python 2.7.15 (default, May 1 2018, 16:44:08)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lief