My CM4 doesn't have wifi, so I tried with a couple devices:
Both support monitor-mode and injection. I'm not sure, but I think kali's extended kernel has support for them buit in, but it also doesn't have Gpi2 LCD support.
| #!/bin/bash | |
| wget https://github.com/raysan5/raylib/releases/download/4.5.0/raylib-4.5.0_webassembly.zip | |
| unzip raylib-4.5.0_webassembly.zip | |
| cd raylib-4.5.0_webassembly/ | |
| wget https://raw.githubusercontent.com/raysan5/raylib/master/examples/core/core_basic_window.c | |
| emcc -Os -I./include -s USE_GLFW=3 -s ASYNCIFY -DPLATFORM_WEB -o index.html core_basic_window.c lib/libraylib.a | |
| npx -y live-server |
| import getWasmInterface from './get_wasm_interface.js' | |
| // usage | |
| const bytes = await fetch('mine.wasm').then(r => r.arrayBuffer()) | |
| const m = await WebAssembly.compile(bytes) | |
| // imports is minimal stub (empty functions) and exports is a list of things it exports | |
| const { imports } = await getWasmInterface(m) | |
| // now I can inject my own functions |
| .PHONY: help clean | |
| help: ## Show this help | |
| @python tools/help.py "$(MAKEFILE_LIST)" | |
| clean: ## Remove all built files | |
| @rm -f FILES |
My CM4 doesn't have wifi, so I tried with a couple devices:
Both support monitor-mode and injection. I'm not sure, but I think kali's extended kernel has support for them buit in, but it also doesn't have Gpi2 LCD support.
| #!/bin/bash -e | |
| apt install -y build-essential debootstrap unzip git | |
| # create image | |
| qemu-img create -f qcow2 -o preallocation=metadata rknullos.qcow2 2G | |
| modprobe nbd max_part=8 | |
| qemu-nbd --connect=/dev/nbd0 rknullos.qcow2 | |
| # paritition |
I am using a mac M1 (arm64), so I didn't need binfmt-support/qemu-user-static installed.
docker run --platform="linux/arm64/v8" -it --rm -v $(pwd):/workdir -w /workdir ubuntu:eoan bash
cat << EOF > /etc/apt/sources.list
deb http://old-releases.ubuntu.com/ubuntu eoan main universe
deb http://old-releases.ubuntu.com/ubuntu eoan-updates main universe
| if (typeof atob === 'undefined') { | |
| var atob = a => new Buffer(a).toString('base64') | |
| } | |
| if (typeof btoa === 'undefined') { | |
| var btoa = a => Buffer.from(a, 'base64').toString('utf8') | |
| } |
| import serial | |
| port = serial.Serial('/dev/ttyTHS1', baudrate=115200, timeout=1) | |
| # Turn on the GPS | |
| port.write(b'AT+CGNSPWR=1') | |
| # Ask for the navigation info parsed from NMEA sentences | |
| port.write(b'AT+CGNSINF') |
| import { loadFile } from 'std' | |
| const regexes = { | |
| func: /^RLAPI ([\*A-Za-z0-9 ]+) ([\*A-Za-z0-9]+)\((.+)\);\W+(.+)/gm | |
| } | |
| // TODO: I need a lot more in/out types | |
| // map of input-type to function that the function-body to convert it | |
| const inputTypes = { |
| // I use this to generate a stub from MDN docs about canvas | |
| // run with deno run --allow-net tools/getdocs.js | |
| /* global fetch */ | |
| import { DOMParser } from 'https://deno.land/x/deno_dom/deno-dom-wasm.ts' | |
| function getDocs (doc, parent) { | |
| const info = {} | |
| if (doc?.querySelectorAll) { |