Skip to content

Instantly share code, notes, and snippets.

@7marcus9
Last active February 6, 2024 14:41
Show Gist options
  • Save 7marcus9/d46bd16fda8fa2c736a09c4dadd0621e to your computer and use it in GitHub Desktop.
Save 7marcus9/d46bd16fda8fa2c736a09c4dadd0621e to your computer and use it in GitHub Desktop.
Smart Building Gateway MT2683

Overview

  • SOC: AR9344-DC3A
  • RAM: 2x A3R13E40DBF-8E
  • Flash1: winbond 25Q80DVSOG
  • Flash2: ESMT F59L1G81A
  • ZWave PHY/µc: SD3502A-CNE3

UART

UART ist rechts neben dem SOC (4x Testpoint unter Quarz)

  • TP 5 = GND
  • TP 7 = RX
  • TP10 = TX (~2,6V)
  • TP13 = VCC? 2,6V

  • Baudrate 115200 8N1
  • Kommunikation mit 3.3V UART Wandler lief problemlos (CP2102)
  • 2,3KOhm (4,7k/2) Widerstand zwischen CP2102 TX und SOC RX

UBoot

ar7240> printenv
bootargs=console=ttyS0,115200 root=1f08 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:320k(Bootloader),192k(BootConfig),64k(Bootflags),64k(Baptization),64k(Config1),64k(Config2),256k(free);ath-nand:1152k@0k(Kernel),13440k@1152k(Filesystem),14592k@0k(Firmware),1152k@14592k(Rescue_Kernel),13440k@15744k(Rescue_Filesystem),14592k@14592k(UpdResc),101888k@29184k(OSGI)
bootcmd=dvlboot nand
bootdelay=1
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
eth1addr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
ipaddr=192.168.0.249
serverip=192.168.0.100
loadaddr=0x80060000
dir=
lu=tftp 0x80060000 ${dir}u-boot.bin&&erase 0x9f000000 +$filesize&&cp.b $fileaddr 0x9f000000 $filesize
lf=tftp 0x80060000 ${dir}db12x${bc}-nand-jffs2${ns}&&nand erase 0x120000 0x9e0000&&nand write $fileaddr 0x120000 $filesize
lk=tftp 0x80060000 ${dir}vmlinux${bc}.lzma.uImage&&nand erase 0x0 0x200000&&nand write $fileaddr 0x0 $filesize

Auslesen Flash

In den Bootargs ist die Liste der Partitionen mit größe und offset enthalten.

  • minicom starten
  • Beim Starten des Gerätes mit einer Taste im passenden Moment den Bootvorgang abbrechen Hit any key to stop autoboot:
#Kernel
nand read 0x80060000 0x0 0x120000
# Logging in Minicom einschalten (Separate Datei)
md.b 0x80060000 0x120000

#Filesystem
nand read 0x80060000 0x120000 0xD20000
# Logging in Minicom einschalten (Separate Datei)
md.b 0x80060000 0xD20000

#OSGI
#nand read 0x80060000 0x1C80000 0x6380000 geht vermutlich nicht, da zu groß, deswegen in 1/4 parts
nand read 0x80060000 0x1C80000 0x18E0000
# Logging in Minicom einschalten (Separate Datei)
md.b 0x80060000 0x18E0000


nand read 0x80060000 0x3560000 0x18E0000
# Logging in Minicom einschalten (Separate Datei)
md.b 0x80060000 0x18E0000
#Python skript um md.d log zu bin file zu konvertieren
fi = open("log_fs", "r")
fo = open("log_fs.bin", "wb")

started = False

for fil in fi:
    if started:
        p = fil.split("  ")[0].split(":")
        if len(p) < 2:
            print(fil)
            break
        b = bytes.fromhex(p[1])
        fo.write(b)


    else:
        if "md.b" in fil:
            started = True

entpacken des FS mit binwalk oder direkt mit jeffersson

Shell activation (TODO)

  • Change /etc/inittab from ttyS0::askfirst:-/tmp/bin/sh to ttyS0::askfirst:/bin/sh or
  • Change config read by /usr/sbin/baptization.config
    • etc/init.d/rcS: if [ "$SHELL" = "0" -a "$PRODUCTION_COMPLETED" = "yes" ];then
    • etc/init.d/rcS: if [ "$TELNETD" = "1" -o "$PRODUCTION_COMPLETED" != "yes" ]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment