Snippets

Alex Memory dumper for Toshiba FlashAir W-03 wireless card (Lua)

Created by Alex
-- Dumper for Toshiba FlashAir W-03 wireless card

-- The Lua API from Toshiba includes an undocumented "dump" function,
-- which appears to read 4 bytes from the address passed as first argument.

-- Usage:
-- curl -s http://[IPofSDCard]/dumper.lua | python fixdump.py > 00000.bin

-- dump from here
addr = 0x000000
size = 0x10000

-- the memory map is not yet known, so there's a lot more to dump
-- bootloader is here:
--   1001 [ BootProgram  ]:Ver08.01 13:04:44,Jun 24 2014
-- Lua functions are around C8xxxx:
--   dump function: C8D1A8

-- note: print adds \n
print("HTTP/1.1 200 OK\r")
print("\r")

-- dump as hex; we'll convert it to binary later
for a = addr, addr+size-4, 4 do
    v = dump(a)
    print(string.format("%08X", v))
    
    -- Lua runs out of memory without this
    if a % 256 == 0 then collectgarbage() end
end

-- it's not the fastest dumper in the world - about 1K/s :)
1
2
3
4
5
6
import sys
import struct

for l in sys.stdin.readlines():
    v = int(l,16)
    sys.stdout.write(struct.pack('<I', v))

Comments (0)