Posts

Showing posts with the label Uniden

Optimizing Uniden bearmock srecutils

https://techcoderadio.blogspot.com/2025/04/bearmock-for-python-3.html Some optimizations   # srecutils.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  02111-1307  USA """     Motorola S-Record utis     - Kudos to Montreal CISSP Groupies """ from functools...

Inspecting Uniden BC346XT firmware

Image
I am interested in finding unknown remote commands and test modes. Ghidra and a bit of Python code.

Inspecting some Uniden scanners firmware strings

Image
with srecparser.py https://techcoderadio.blogspot.com/2026/04/motorola-s-record-old-python-code.html     Uniden BR330T BCT15 BCD396T  

Inspecting Uniden BC898T 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 BCT8 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 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:    

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    

Bearmock for BC VUP Version 3

Image
https://techcoderadio.blogspot.com/2025/04/bearmock-for-python-3.html   from time import sleep from serial import Serial __MODEL = 'BCT15X' __PORT = 'COM4' __SPEED = 9600 __TIMEOUT = 0  # non-blocking __READ_SLEEP_SECS = 0 __OUT = 'bct15x-decoded.s19' __ACTIONS = {     'æ€\r': 'ERR\r',  # Empty, just reply     '\r': 'UNKNOWN COMMAND\r', #Empty, just reply .... Strange chars coming first ... just reply error XON/XOFF software flow control if __name__ == "__main__":     try:         port = Serial(__PORT, __SPEED, timeout=__TIMEOUT, bytesize=8, parity='N', stopbits=1, xonxoff=True)     except Exception as ex:         print(ex)         exit()  

Inspecting BC125AT_SS software

BC125AT_SS.exe can be reverse engineered to Visual Studio solution with dotPeek. It is not necessary to install BC125AT_SS, it can be extracted with msiexec, e.g. msiexec /a setup.msi /qb targetdir=g:\temp\uss\ex Visual Studio 2022 proposes to upgrade the solution to .NET 4.8, it is ok to upgrade it to 4.8. Modify .csproj file, add line: <LangVersion>12.0</LangVersion> otherwise there is err messages: Feature 'primary constructors' is not available in C# 8.0. Please use language version 12.0 or greater #nullable disable is not supported searchserialportform.cs, modify line where str variable is defined, add initilization of str var, string str = "" Many Uniden scanners have quite similar specs (remote protocol, mem organization, modes, etc...). It is possible to change BC125AT_SS to work (to some extent without big mods) with other models by changing the code in where there is a check which model string scanner responds to MDL cmd.   

Bearmock experiments

Image
  https://techcoderadio.blogspot.com/2025/04/bearmock-for-python-3.html Bearmock seems to work better when running in Python 3.14.1 and BC_VUP_V2 with 38400 bps COM speed setting BC125AT scn file decoded with Bearmock: srec_info bc125at-decoded.s19 Format: Motorola S-Record Header: "" Execution Start Address: 00000000 Data:   000000 - 03FFFF BR330T scn file: BC_VUP_V2 showed error: the firmware file is too old for the scanner. After changing the model variable in Bearmock code as UBC3500XLT decoding runs ok. from time import sleep from serial import Serial __MODEL = 'UBC3500XLT' __PORT = 'COM4' __SPEED = 9600 __TIMEOUT = 0  # non-blocking __READ_SLEEP_SECS = 0 __OUT = 'br330t-decoded.s19' .... Firmware data seems to be partly scrambled

Inspecting Uniden BC246T firmware

Bearmock https://techcoderadio.blogspot.com/2025/04/bearmock-for-python-3.html BC246T firmware updater is BC_VUP V3 SW used BC_VUP V2 BC_VUP V2 can show msg which says registration key is required -- just click ok. Select speed 38400 or 57600 for most reliable operation and also try with port.flush() Processed firmware file contains many interesting strings

Inspecting Uniden BC898T firmware

https://techcoderadio.blogspot.com/2025/04/bearmock-python-3-and-virtual-serial.html    __MODEL = 'BC898T' __PORT = 'COM12' __SPEED = 9600 __TIMEOUT = 0  # non-blocking __READ_SLEEP_SECS = 0 __OUT = 'bc898t-decoded.s19' __ACTIONS = {     '\r': 'UNKNOWN COMMAND\r',  # Empty, just reply     '*SUM\r': 'CHECKSUM= DEADH\r',  # Fake checksum     '*SPD 1\r': 'SPEED 9600 bps\r',     '*SPD 2\r': 'SPEED 19200 bps\r',     '*SPD 3\r': 'SPEED 38400 bps\r',     '*SPD 4\r': 'SPEED 57600 bps\r',     '*SPD 5\r': 'SPEED 115200 bps\r',     '*PGL 11000000000\r': 'OK\r',     '*PGL 110000000\r': 'OK\r',     '*PGL 1000000000000000000\r': 'OK\r',     '*PGL 1100000\r': 'OK\r',   Comment out port.flush() if printing err messages after retrys. Notepad++ Remove first line Replace S224 with null Plugins: Convert HEX -...

Inspecting Uniden BC296D with Ghidra

Image
 After processing firmware with https://techcoderadio.blogspot.com/2025/04/bearmock-python-3-and-virtual-serial.html It is possible to inspect it with Ghidra (Motorola Hex, M16C 60), ASCII and disassembly  

Some C# for processing bin files and some mod ideas for BC_VUP_V3

Visual Studio, dotPeek Do XOR op for the bin file and convert it to hex file   using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace FileBin {     internal class Program     {         static void Main(string[] args)         {             char[] ct = new char[16]             {                 '0',                 '1',                 '2',                 '3',                 '4',                 '5',                 '6',                 '7',       ...

Mods for BC_VUP_V3

Visual Studio 2022 dotPeek C#  After dotPeeking Uniden BC_VUP_V3 to VS solution it is quite easy to do some mods for it, e.g. modifying it to write firmware to file without Uniden radioscanner connected to COM port. Mainform.cs comment out CheckScanner() SelectCom.cs comment out !usscRemote.CanOpen ... replace if and else with code in else section usscRemote.cs TransferPacket, comment out ComPort.WriteLine and ComPort.ReadLine and add e.g. System.IO.File.AppendAllText(..., Packet ... WritingDialogbox.cs TransferFile add return; after analyzefirmware .. analyzefirmware, after while ... add e.g. File.AppendAllText(@..., str + Environment.NewLine, Encoding.ASCII); first case statement, add e.g. File.WriteAllText(@..., checksum.ToString(), Encoding.ASCII); bintostring, add e.g. File.AppendAllText(@..., stringBuilder.ToString(), Encoding.UTF8); analyzefirmwarebin, add e.g. File.AppendAllText(@..., checksum.ToString(), Encoding.ASCII); getstringinfoot add e.g. File.AppendAllText(@..., En...

Upgrading Uniden BC_VUP_V3 to NET 8

 dotPeek Visual Studio 2022 NET Upgrade assistant VS extension csproj add <PropertyGroup>   <Nullable>enable</Nullable>   <LangVersion>8.0</LangVersion> </PropertyGroup>   <ItemGroup>     <PackageReference Include="System.IO.Ports" Version="8.0.0" />   </ItemGroup> error: Cannot implicitly convert type 'System.IntPtr' to 'int'. An explicit conversion exists (are you missing a cast?) num3 = num3 + (uint) file[(IntPtr) index] & (uint) ushort.MaxValue; --> num3 = num3 + (uint) file[(int)(IntPtr) index] & (uint) ushort.MaxValue;    AllowFullAccess modify, comment out try section rows and add FileInfo/FileSecurity          //FileSecurity accessControl = File.GetAccessControl(PathName);         //accessControl.AddAccessRule(new FileSystemAccessRule("Users",         FileSystemRights.FullControl,AccessControlType.All...

Optimized Python Uniden PWR command band scope

Image
import serial import pandas as pd import matplotlib.pyplot as plt import csv from datetime import datetime ser = serial.Serial('COM14', '115200', timeout = 0.5) print(ser.name) serialCmd = b'PWR\r' readSize = 19 loop = True freq = "" rssi = 0 data = [] log_data = [] cols = ['Frequency', 'RSSI', 'Timestamp'] plt.xlabel("Frequency") plt.ylabel("RSSI") plt.xticks(rotation = 90) plt.ion() try:     while (loop == True):         ser.write(serialCmd)         res = ser.read(readSize).decode()         if (len(res) > 15):             r = res.replace('\r', '').split(",")             freq = r[2]             rssi = int(r[1])             log_data.append([freq, rss...

Log Uniden close call hits with Python

Image
Uniden remote command PWR returns frequency value 00000000 and background noise RSSI value when there is no CC hit. When Close Call found PWR returns frequency and RSSI values. import serial import pandas as pd import matplotlib.pyplot as plt import csv from datetime import datetime ser = serial.Serial('COM14', '115200', timeout = 0.5) print(ser.name) serialCmd = b'PWR\r' readSize = 19 loop = True freq = "" rssi = 0 data = [] log_data = [] cc_data = [] cols = ['Frequency', 'RSSI', 'Timestamp'] plt.xlabel("Frequency") plt.ylabel("RSSI") try:     while (loop == True):         ser.write(serialCmd)         res = ser.read(readSize).decode()         if (len(res) > 15):             r = res.replace('\r', '').split(",")             freq = r[2]    ...