Skip to content

Instantly share code, notes, and snippets.

View dixyes's full-sized avatar
🧧
<-- this is a 红包

Yun Dou dixyes

🧧
<-- this is a 红包
View GitHub Profile
@dixyes
dixyes / some.php
Created September 1, 2021 07:38
php -x
<?php
$file = explode("\n", file_get_contents(__FILE__));
\Swow\Debug\registerExtendedStatementHandler(function () use ($file) {
$bt = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1)[0];
if ($bt['file'] === __FILE__) {
echo $bt['line'] . ':' . $file[$bt['line'] - 1] . PHP_LF;
}
});

Naming scheme

hyperf php base images

hyperf/php:<php version>[-<distro kind>[-<distro version>]]

which:

@dixyes
dixyes / dllinspect.c
Last active May 23, 2021 06:32
show dll load and unload
#include <wchar.h>
#include <windows.h>
#include <detours.h>
/* common */
LONG (NTAPI* LdrRegisterDllNotification)(ULONG Flags, PVOID cb, PVOID Context, PVOID *Cookie);
LONG (NTAPI* ZwQueryInformationProcess)(HANDLE ProcessHandle, int ProcessInformationClass, PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength);
void getkernelfuncs(void){
static int fucked = 0;
if(fucked){
@dixyes
dixyes / config.list.example
Last active September 5, 2020 14:21
my mc mod updater
AbyssalCraft-1.12.2-1.10.2.jar:AbyssalCraft*
astralsorcery-1.12.2-1.10.26.jar:astralsorcery*
BuildingGadgets-2.8.4.jar:BuildingGadgets*
gregtech-1.12.2-1.10.0.546.jar:gregtech*
industrialcraft-2-2.8.220-ex112.jar:industrialcraft*
Jade-0.1.0.jar:Jade*
jei_1.12.2-4.16.1.301.jar:jei_1.12.2*
just-enough-harvestcraft-1.12.2-1.7.2.jar:just-enough-harvestcraft-*
levelup2-1.5.6.jar:levelup2*
LittleMaidAppendPack-1.0.3.jar:LittleMaidAppendPack*
@dixyes
dixyes / sms4.patch
Created January 9, 2020 10:34
SMS4 in mbedtls
diff --git a/include/mbedtls/cipher.h b/include/mbedtls/cipher.h
index 96efd937f..bd0027b7e 100644
--- a/include/mbedtls/cipher.h
+++ b/include/mbedtls/cipher.h
@@ -92,6 +92,7 @@ typedef enum {
MBEDTLS_CIPHER_ID_ARC4, /**< The RC4 cipher. */
MBEDTLS_CIPHER_ID_ARIA, /**< The Aria cipher. */
MBEDTLS_CIPHER_ID_CHACHA20, /**< The ChaCha20 cipher. */
+ MBEDTLS_CIPHER_ID_SMS4,
} mbedtls_cipher_id_t;
@dixyes
dixyes / extinst.lua
Last active June 27, 2022 19:29
use luajit, ncurses(w) to create a command line ui
#!/home/dixyes/awsl/pl/luajit
--[[
gist: https://gist.github.com/dixyes/cd945d8a195889de32cb524254d90d33
First to say : ffi niubi!
This file is ncursesw command line ui written in lua, using luajit and some C things.
Note: pits here:
1. variables created by ffi.new("sometype") may be gced at anytime (maybe use ffi.typeof() to create type can resolve this.);
workaround: use ffi.C.malloc instead
2. struct index may be not reliable: for example a structure struct sStruct{u32 lFirst; u64 llSecond;}; when use instSStruct[0].llSecond, it will use area from llSecond's half to out of bound 4 bytes as llSecond.

使用类似

void replaceOnReceive(int (*cb) (/*arguments of php_swoole_OnReceive...*/)){
    void * pSwooleG = dlsym(/*arguments to get SwooleG...*/);
    void * pServ = pSwooleG+OFFSET_SERV;
    void * pOnReceive2Replace = (*pServ)+OFFSET_ONRECV;
    assert(*pOnReceive2Replace == php_swoole_OnReceive);
    *pOnReceive2Replace = cb;
}
@dixyes
dixyes / README.md
Last active October 13, 2018 14:03
截图抽奖

截图抽奖

使用了opencv的python接口

注意使用了非自由的sift/surf(需要编译nonfree的opencv-contrib-python库) 效果

基本思路

  • 准备:
@dixyes
dixyes / zimifi.py
Last active September 11, 2020 14:46
zimifi router SMS receive / send
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# test python file for zmifi MF855
# using default password zimifi
# WTFPL
import re, hashlib, random, json, datetime
import requests
from collections import defaultdict
@dixyes
dixyes / ext.py
Created April 17, 2018 07:21
badapple! bootloader
import cv2
vc = cv2.VideoCapture('ba.mp4')
c=1
fs = 1
count = 0
fuckl = lambda x : b"#" if x > 20 else b" "