Posts

Motorola S-record - old Python code enhanced #2

https://techcoderadio.blogspot.com/2025/04/motorola-s-record-old-python-code.html https://github.com/gabtremblay/pysrec Code optimized New option -a which stores data section as ASCII Tested with Python 3.14.4 #!/usr/bin/python # srecparser.py # # Copyright (C) 2011 Gabriel Tremblay - initnull hat gmail.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA...

Enhancing old heatmap.py

Python 3.14.3 original code: https://github.com/keenerd/rtl-sdr-misc/blob/master/heatmap/heatmap.py   Enhanced code. Optimizations and works with latest pillow (12.x.x) versions #! /usr/bin/env python # fix for the pillow 12 from PIL import Image, ImageDraw, ImageFont import os, sys, gzip, math, argparse, colorsys, datetime from collections import defaultdict urlretrieve = lambda a, b: None try:     import urllib.request     urlretrieve = urllib.request.urlretrieve except:     import urllib     urlretrieve = urllib.urlretrieve # todo: # matplotlib powered --interactive # arbitrary freq marker spacing # ppm # blue-less marker grid # fast summary thing # gain normalization # check pil version for brokenness vera_url = "https://github.com/keenerd/rtl-sdr-misc/raw/master/heatmap/Vera.ttf" vera_path = os.path.join(sys.path[0], "Vera.ttf") tape_height = 25 tape_pt = 10 if not os.path.isfile(vera_path):     urlretrieve(vera_url, vera_path)...

Inspecting Uniden BC-246T firmware

Image
run BearMock to get decoded Motorola S-record format file https://techcoderadio.blogspot.com/2025/04/bearmock-for-python-3.html CPU is probably M16C/60N Ghidra:    

Inspecting Uniden BC796D firmware

Image
run BearMock to get decoded Motorola S-record format file https://techcoderadio.blogspot.com/2025/04/bearmock-for-python-3.html CPU is probably M16C/60N Ghidra:    

Inspecting AOR AR5700D firmware updater

Image
AR5700Updater.exe Detect It Easy   Lots of Motorola s-record inside exe. Too many strings for the Detect It Easy Strings feature. Linux strings cmd works. strings AR5700Updater.exe | grep -E "S[0-9]+" > AR5700.txt remove non S-record format lines in head and tail and in the middle (find with e.g. srec_info tool). srec_info:  Termination records (S9) should be last => use e.g Python to get data blocks into several files. n = 1 print("start") s = "" f = open("ar5700.txt", "r") lines = f.readlines() for line in lines:     s = s + line     if line[:2] == "S9":         with open("ar5700-" + str(n) + ".txt", "w") as w:             w.writelines(s)         print("ar5700-" + str(n) + ".txt")         n = n + 1         s = "" f.close() print("end")   => 10 files of S-Records Some maybe DSP code and four which are highly probable SuperH SH-2 code ...

Optimized no Pandas Python band scope for the Uniden scanners

Image
Works with all Uniden scanners which have PWR remote command. https://techcoderadio.blogspot.com/2025/05/optimized-python-uniden-pwr-command.html   Optimized, Pandas removed import serial import matplotlib.pyplot as plt import csv import os import time from datetime import datetime SER_PORT = 'COM14' SER_BAUD = 115200 SER_TIMEOUT = 0.5 SER_CMD = b'PWR\r' READ_SIZE = 19 OUT_DIR = r"c:\temp" OUT_FILE = os.path.join(OUT_DIR, 'unidenscope.csv') def out_dir():     try:         os.makedirs(OUT_DIR, exist_ok=True)     except Exception:         pass def main():     ser = serial.Serial(SER_PORT, SER_BAUD, timeout=SER_TIMEOUT)     print(ser.name)     readings = {}     log_data = []     plt.ion()     fig, ax = plt.subplots()     ax.set_xlabel("Frequency")     ax.set_ylabel("RSSI")     fig.set_figwidth(15)     fig.set_figheight(9) ...

Inspecting Uniden BCi96D firmware

Image
Unzip BCi96DVUP_V1_03.zip extract BCi96DVUP_V1_03.cab (unzip) run admin regsvr32 comctl32.ocx run BCi96DVUP_V1_03.exe  run BearMock to get decoded Motorola S-record format file https://techcoderadio.blogspot.com/2025/04/bearmock-for-python-3.html BCi96DVUP is VB6 (Detect It Easy) Code inside .exe CPU is M16C/60   Ghidra can disassemble M16C/62N