Skip to content

Instantly share code, notes, and snippets.

View mini-ninja-64's full-sized avatar
😳
swag on

Mini mini-ninja-64

😳
swag on
View GitHub Profile

The software, provided by WCH, has an update firmware feature where it writes the attached binary overr usb (extracted from the WCH software it is stored as a windows app resource or soemthing like that, whatever microsoft calls them, I just used a windows resource extractor to get it and ghidra to find the update fuunction etc)

this firmware blob is sent to a ch582 MCU, the firmware is split into like 64 byte usb packets, the device itself actually has 3 mcu's one for each antenna, each running the same firmware

the general usb data packets are formtd like this:

[2 byte command][2 byte packet length][n bytes of data]

COMMANDS:
@mini-ninja-64
mini-ninja-64 / proxify example.ts
Last active July 6, 2025 23:52
JavaScript/TypeScript Proxy object helpers
const targetObject = {
message1: "hello",
message2: "everyone",
test1: function () { console.log(this); },
test2: () => { console.log(this); },
test3: () => ({ nest1: () => ({ nest2: () => "value" }) }),
test4: { foo: { bar: () => ({ a: 1 }) } },
};
const proxy1 = proxify(targetObject, {
@mini-ninja-64
mini-ninja-64 / sigmoid.cpp
Created March 19, 2017 13:50
sigmoid functions
float activate(float x)
{
return 1.0/(1.0+exp(-x));
}
float activateDerivative(float x)
{
return activate(x)*(1.0 - activate(x));
}