Skip to content

Instantly share code, notes, and snippets.

View Sucareto's full-sized avatar

Sucareto

View GitHub Profile
@Sucareto
Sucareto / Asp2Core.py
Last active May 1, 2022 14:47
Asphyxia转Asphyxia Core的数据转换工具
from random import sample, randint
from string import ascii_letters, digits
import json
from re import search
from time import time
import shutil
from colorama import init
init(autoreset=True)
# 全局变量
appealID = 0
@Sucareto
Sucareto / bh3_auto.py
Last active January 29, 2022 08:11
崩坏3自动洗词缀工具。已失效,仅留作文本识别和自动化操作示例。
# encoding:utf-8
from pyautogui import moveTo, click, easeOutQuad
from random import randint, uniform
from base64 import b64encode
from requests import post, get
from re import compile, search
from time import sleep
from PIL.ImageGrab import grab
from io import BytesIO
from logging import basicConfig, WARNING, warning
@Sucareto
Sucareto / Make.bat
Last active February 7, 2021 10:11
一种Arduino上传HEX的方式。通过打包刷写程序和HEX,可以在没有IDE和源码的环境更新固件。
@echo off
echo "确保文件夹内包含 avrdude.exe,avrdude.conf,libusb0.dll,32u4Serial.ino.promicro.hex,Upload.py,Upload.spec,icon.ico 这些文件"
pause
pyinstaller -F -i icon.ico Upload.spec
pause
@Sucareto
Sucareto / svo2dds.py
Created May 14, 2021 06:18
从svo文件导出dds图像。
import os
for i in os.listdir('source'):
with open('source/' + i, 'rb') as f:
print(i + " : ")
data = f.read()
index = data[0:].find(b'DDS')
os.mkdir(i[:-4])
while True:
endindex = data[index+1:].find(b'DDS')
if endindex == -1:
@Sucareto
Sucareto / ArduinoMifare.ino
Created August 11, 2021 15:49
简单的穷举mifare密钥方法。
#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
PN532_I2C pn532i2c(Wire);
PN532 nfc(pn532i2c);
#define SerialDevice SerialUSB //32u4,samd21
@Sucareto
Sucareto / SerialDataCheck.py
Created January 29, 2022 08:09
某串口数据校验工具
str1 = "E0 06 00 0F 40 01 03 59"
REQ = str1.split(" ")
print(REQ)
rSYN, rESC, rLEN, rSUM, rESCsw = 0, 0, 0, 0, False
if REQ[0] == "E0":
rSYN = "E0"
rESC = "D0"
rLEN = int(REQ[1], 16)
@Sucareto
Sucareto / HID-Printer.py
Last active August 2, 2022 13:06
从控制台读取文字,通过HID打印。应用场景:Android识别文字后模拟键盘发送到PC。
from time import sleep
keycode = {
"KEY_1": '\x1e', # Keyboard 1 and !
"KEY_2": '\x1f', # Keyboard 2 and @
"KEY_3": '\x20', # Keyboard 3 and #
"KEY_4": '\x21', # Keyboard 4 and $
"KEY_5": '\x22', # Keyboard 5 and %
"KEY_6": '\x23', # Keyboard 6 and ^
"KEY_7": '\x24', # Keyboard 7 and &
"KEY_8": '\x25', # Keyboard 8 and *
@Sucareto
Sucareto / Mafuyu_Cursor_Install.inf
Last active June 10, 2022 14:26
Auto install custom mouse cursors for https://twitter.com/L9525/status/1531337918656446464. You can modify Mafuyu_Cursor in lines 61 and 62 to other names for distinction.
[Version]
signature="$CHICAGO$"
[DefaultInstall]
CopyFiles = Scheme.Cur
AddReg = Scheme.Reg,Wreg
[DestinationDirs]
@Sucareto
Sucareto / create-dell-key.sh
Last active May 26, 2024 11:10
使用 USB Gadget 功能,创建一个“键盘+鼠标+存储”复合设备,设备 ID 来自 Dell KB216 键盘。可配合 https://github.com/Sucareto/Android_HID_Keyboard 使用。
#!/bin/sh
# https://github.com/Sucareto/Android_HID_Keyboard
device_path="/config/usb_gadget/KB216"
ms_file="/data/data/com.termux/files/home/storage/tmp/mass_storage.img"
# create mass_storage image file
# dd if=/dev/zero of=$ms_file bs=1024MiB count=1
# fallocate -l 1G $ms_file
# loop_device=$(losetup -f)
@Sucareto
Sucareto / 切换Hyper-V.bat
Created November 20, 2022 06:20
修改参数而不是添加启动项,切换启动时的 Hyper-V 状态,允许 VMware 使用嵌套虚拟化。
@echo off
pushd %~dp0
%1 start "" mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c ""%~s0"" ::","","runas",1)(window.close)&&exit
echo "判断当前状态..."
bcdedit /enum {default} | find /I "hypervisorlaunchtype Auto" > nul
if %errorlevel% == 0 (
bcdedit /set {current} HyperVisorLaunchType OFF
echo "Hyper-V 已关闭!"
) else (