Inspecting Alinco DJ-G29T firmware
Alinco DJ-G29T firmware updater softwate
DJ-G29T ver.1.10NEW.msi => unzip, Instal01,cab => unzip
File named PO1_A3 ... contains compiled code and data section in Motorola S-record format.
Remove lines before and after data section and with some Python scripts clean the data section.
import re
import argparse
import sys
def clean_file(path: str) -> None:
try:
with open(path, 'r', encoding='ansi') as f:
text = f.read()
except FileNotFoundError:
print(f"File not found: {path}", file=sys.stderr)
sys.exit(1)
cleaned = re.sub(r'[^S0-9A-F\r\n]+', '', text)
with open(path, 'w', encoding='ansi', newline='') as f:
f.write(cleaned)
def main() -> None:
parser = argparse.ArgumentParser(
description='Keep characters S,0-9,A-F'
)
parser.add_argument('file', nargs='?', default='srec_section.txt', help='file to fix')
args = parser.parse_args()
clean_file(args.file)
if __name__ == '__main__':
main()
with open('srec_section.txt', 'r', errors='ignore') as file:
fc = file.read()
fc = fc.replace('S', '\nS')
with open('srec_section.s19', 'a') as f:
f.write(fc)
CPU is M16/60
Ghidra:




Comments
Post a Comment