Skip to content

Instantly share code, notes, and snippets.

View spacemeowx2's full-sized avatar

imspace spacemeowx2

  • 05:21 (UTC +08:00)
View GitHub Profile
@spacemeowx2
spacemeowx2 / slp_udpping.js
Created December 13, 2018 12:18
slp_udpping.js
const dgram = require('dgram')
const crypto = require('crypto')
function udpPing (server, port = 11451, timeout = 1000) {
return new Promise((resolve, reject) => {
const socket = dgram.createSocket('udp4')
const myReject = (err) => {
socket.close()
reject(err)
}
@spacemeowx2
spacemeowx2 / slp_servers.json
Last active October 10, 2018 09:20
server list example for switch-lan-play
{
"update_time": 153916320,
"list": [{
"name": "服务器1",
"address": "0.0.0.0:1234",
"description": "服务器描述, 比如服务器官网之类的"
}]
}
@spacemeowx2
spacemeowx2 / import.py
Created October 9, 2018 06:51
ida python
from idaapi import *
from idc import *
from idautils import *
@spacemeowx2
spacemeowx2 / build_lan_play_termux.sh
Last active October 15, 2020 23:08
build switch lan play on termux
pkg install -y cmake make clang libpcap-dev git
git clone https://github.com/spacemeowx2/switch-lan-play.git
mkdir switch-lan-play/build
pushd switch-lan-play/build
cmake ..
make
popd
cp ./switch-lan-play/build/src/lan-play .
@spacemeowx2
spacemeowx2 / my_alias.bat
Last active August 22, 2018 16:36
my_alias.sh
alias mcpeserver=docker run -p 19132:19132/udp -d mcpeserver
alias project=cd /d D:\project\
alias run-daemon=docker run -p 127.0.0.1:5666:5666 -p 6881:6881 -p 6882:6882/udp -v E:\downloads:/downloads -d space-daemon
set TERM=xterm-256color
((async () => {
const sleep = ms => new Promise(r => setTimeout(r, ms))
class IdleUnload {
/**
* @param obj Unloadable 对象
* @param idleTime 超时时间 单位为秒
*/
constructor(obj, idleTime) {
this.obj = obj;
this.loaded = false;
@spacemeowx2
spacemeowx2 / brcmfmac43340-sdio.txt
Last active March 1, 2021 11:57
/lib/firmware/brcm/brcmfmac43340-sdio.txt
# /lib/firmware/brcm/brcmfmac43340-sdio.txt works on my CHUWI Hibox
# previous version 5G does not work
manfid=0x2d0
prodid=0x0653
vendid=0x14e4
devid=0x4386
boardtype=0x0653
boardrev=0x1203
boardnum=22
macaddr=02:0A:F7:2A:3B:4C
@spacemeowx2
spacemeowx2 / downloader.js
Last active August 16, 2018 10:29
Downloader for one game
const axios = require('axios').default
const http = require('http')
const https = require('https')
const path = require('path')
const fs = require('fs')
const Transform = require('stream').Transform
const promisePipe = require('promisepipe')
const mkdirp = require('mkdirp')
const SpaceProgress = require('./space-progress')
const spaceProgress = new SpaceProgress(process.stderr)
@spacemeowx2
spacemeowx2 / p.bin.note
Last active May 28, 2018 12:02
simple vm @ RCTF 2018
15 00 01 00 00 // X = 0x100
LABEL:
0E // X++
12 // A = [X]
0B // putchar(A)
0C 00 01 00 00 // loop
15 10 01 00 00
0E // X++
@spacemeowx2
spacemeowx2 / USB HID Report Descriptor.txt
Created March 24, 2018 17:42
Switch Pro HID Report Descriptor
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x15, 0x00, // Logical Minimum (0)
0x09, 0x04, // Usage (Joystick)
0xA1, 0x01, // Collection (Application)
0x85, 0x30, // Report ID (48)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (0x01)
0x29, 0x0A, // Usage Maximum (0x0A)
0x15, 0x00, // Logical Minimum (0)