Posts

Showing posts with the label NET

Guidelines for inspecting old (circa 1998 - 2007) receiver control and updater software

Image
Old control/updater programs are usually written in VB6, Delphi/C++ Builder or .NET VB, C#. DetectItEasy can show PE32 info which usually and almost allways shows which development tool/framework is used. DetectItEasy strings function shows ASCII strings inside .EXE file. Sometimes there is code embedded inside exe, usually as Motorola S-Record format. E.g. with Python script is easy to extract it and remove unnecessary characters. import re re.sub(r'[^S0-9A-F\r\n]+', '', text) ...  or use Linux stings command.  Installers are usually msi or innoextract. Can be extracted e.g with unzip, msiexec, msiextract (Linux) or innoextract (Linux). Sometimes embedded code is inside in a one of the extracted files. SRecord is a set of tools for inspecting/converting etc. S-Record data. VB6 programs can be further examined e.g. with VB6 decompiler lite. .NET programs, dotPeek can export to VS solution. Even in deobfuscated .NET programs it is possible to find some quite clean code (...

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.   

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...

Upgrading SDR# TETRA demod plugin to .NET7

Image
  26.3.2022 Upgrading SDR# TETRA demod plugin to .NET7 SDR# TETRA demod plugin version 1.0.14.0 dotPeek Visual Studio 2022 NET upgrade assistant Reverse-engineering with dotPeek to VS project NET upgrade assistant   Visual Studio 2022 Plugin displayname change Rebuild solution. NET 7 assembly is located in net7.0-windows directory. SDRSharp.Tetra\bin\Release\net7.0-windows SDR# version 1910 For the newer (obfuscated) versions of the TETRA demod plugin one can try to deobfuscate by using e.g. de4dot, dnSpy and de4dot-cex to get code at level which is buildable with VS (and upgradeable to .NET7).

Some ideas for modifying SDR# DCS plugin to GMDSS/DSC-VHF

  28.8.2023 Some ideas for modifying SDR# DCS plugin to GMDSS/DSC-VHF Visual Studio 2022 dotPeek for reverse engineering/exporting SDR# DCS decoder plugin to VS project. DCSDecoderPanel.cs // Decompiled with JetBrains decompiler // Type: SDRSharp.DCSDecoder.DCSDecoderPanel // Assembly: SDRSharp.DCSDecoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null using SDRSharp.Common; using SDRSharp.PanView; using SDRSharp.Radio; using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace SDRSharp.DCSDecoder {   public class DCSDecoderPanel : UserControl   {     private const int CodeWordLengthInBit = 23;     private AudioProcessor _audioProcessor; ... => namespace SDRSharp.DCSDecoder {   public class DCSDecoderPanel : UserControl   {     private const int CodeWordLengthInBit = 10;     private AudioProcessor _audioProcessor; .....

Fixing old SDR# MSYS2 Tetra decoder plugin

Image
 11.5.2023 Fixing old SDR# MSYS2 Tetra decoder plugin https://www.rtl-sdr.com/tetra-decoder-plugin-for-sdr-now-available/ SDR# 1.0.0.1715 tetra plugin msys2 dotPeek Reverse engineer SDRSharp.Tetra.dll to Visual Studio project with dotPeek. Fix build errors. Change BeginInvoke((Delegate -> Action       if (flag)       {         this._oneChannelIsActive = true;         this.BeginInvoke((Action) (() => this._controlInterface.AudioIsMuted = false));       }       else       {         this._oneChannelIsActive = false;         this.BeginInvoke((Delegate) (() => this._controlInterface.AudioIsMuted = true));   // --> (Action instead of Delegate)       } Fix pointer errors:   =...

Upgrading SDR# SignalStrengthLogger plugin

Image
  29.9.2022 Upgrading SDR# SignalStrengthLogger plugin Visual Studio 2022 .NET 4.61 dotPeek SignalStrength plugin https://www.apritch.co.uk/sdrsharp_plugins.htm Upgrading SignalStrengthLogger plugin for the SDR# version 1.0.0.1715 Reverse engineer plugin with dotPeek and generate to VS project. SDRSharp.Common and SDRSharp.Radio DLLs from SDR# version 1.0.0.1715 Upgrade solution level in VS Change .NET target framework Build solution Add method public UserControl Gui and rebuild

Upgrading SDR# shortwave info plugin

Image
  18.8.2022 Upgrading SDR# shortwave info plugin Visual Studio 2022 .NET 4.6.1 dotPeek - for reverse engineering SDRSharp.ShortWaveInfo to VS solution   Upgrading dotPeek generated VS project to VS 2022 SDRSharp.Common.dll from SDR# v1.0.0.1715 sdrsharpcommon-from-sdrsharp-v1.0.0.1715 Solution target .NET Framework to 4.6.1 Build project: Severity    Code    Description    Project    File    Line    Suppression State Error    CS0535    'ShortWaveInfoPlugin' does not implement interface member 'ISharpPlugin.Gui'    SDRSharp.ShortWaveInfo_for_net_2.0    C:\Utils\dotpeek3\SDRSharp.ShortWaveInfo_for_net_2.0\ShortWaveInfoPlugin.cs    12    Active Fix:     public UserControl Gui     {             get { return _myPluginPane...

Developing plugins for the SDR# .NET 6.0 Telerik - 2

Image
 18.10.2022 Developing plugins for the SDR# .NET 6.0 Telerik - 2 If you get error: fail: [SDRSharp.Empty]: Failed to load assembly: ....UserAppData\SDRSharp.Common.dll System.BadImageFormatException: Could not load file or assembly 'SDRSharp.Common fail: .... SDRSharp.Radio.dll fail: .... SDRSharp.PanView.dll when loading SDR# SDK sample plugin project in VS 2022.   Resolution: Ensure you have downloaded the latest SDR# SDK from Airspy.com (in case you downloaded SDK many months ago) and install latest Visual Studio 2022   For debugging plugins in Visual Studio, click SDRSharp.Diagnostics Plugins.xml file add key lines are not needed anymore, just copy plugin dll to SDR# plugins folder SDK sample plugin should be visible here: namespace SDRSharp.Empty {     public class EmptyPlugin : ISharpPlugin, ICanLazyLoadGui, ISupportStatus, IExtendedNameProvider     {         private ControlPanel _gui;   ...

Developing plugins for the SDR# .NET 6.0 Telerik

Image
 9.10.2022 Developing plugins for the SDR# .NET 6.0 Telerik The latest SDR# version uses .NET 6.0 and UI has based on Telerik UI since .NET 5.0 version of the SDR#. SDR# SDK for Plugin Developers: https://airspy.com/download/ Previous .NET 5.0 based SDR# SDK required many settings adjustments in Visual Studio (https://techcoderadio.blogspot.com/2025/04/developing-plugins-for-sdr-net-5-desktop.html), now the SDK sample project builds ok right away in Visual Studio 2022 with .NET 6 Windows x86 SDK installed.   From SDR# .NET 5.0 version SDRSharp. assemblies are embedded in SDRSharp.exe.   Telerik & SDRSharp controls.   Modify SDK example plugin to show RDS info EmptyPlugin.cs ...         public void LoadGui()         {             if (_gui == null)             {     ...

Updating very old SDR# plugins for newer SDR# versions - 1

Image
 15.6.2022 Updating very old SDR# plugins for newer SDR# versions - 1 I downloaded ScopeView plugin for SDR# from here: https://www.rtl-sdr.com/sdrsharp-plugins/ ScopeView Plugin (Not working with 1400+) Adds a simple audio scope to the plugin window. The package contains source code so no need for reverse engineering (dotPeek) First change target .NET framework to 4.6.1 and copy newer DLL versions to project folder (SDRSharp.Common and SDRSharp.Radio) Try to build the project. This time Visual Studio showed error message for unsafe code Severity    Code    Description    Project    File    Line    Suppression State Error    CS0227    Unsafe code may only appear if compiling with /unsafe    SDRSharp.ScopeView   Code is quite old and needs re-engineering (audio processor handling is changed from the SDR# version for which it was developed) Rewri...

SDR# ScopeView plugin mods

Image
3.7.2022 SDR# ScopeView plugin mods 433 MHz ASK/OOK signal (AM demodulation) _control.RegisterStreamHook(_scopeViewProcess, ProcessorType.FilteredAudioOutput);   _control.RegisterStreamHook(_scopeViewProcess, ProcessorType.DemodulatorOutput);   graphics.SmoothingMode = SmoothingMode.HighQuality;   graphics.SmoothingMode = SmoothingMode.AntiAlias;   graphics.InterpolationMode = InterpolationMode.Bicubic;   graphics.InterpolationMode = InterpolationMode.Bilinear; graphics.InterpolationMode = InterpolationMode.NearestNeighbor;           public void Render(float* samples, int length)         {             if (true)             {                 RenderLockBits(samples, length);      ...

SDR# ScopeView plugin mods - 3

Image
 4.8.2022 SDR# ScopeView plugin mods - 3 Activating another scope mode (code not used in original ScopeView plugin) and saving scope data to text file. Green scope checkbox activates "green scope" mode. Save (S) button saves scope data to text file if green scope selected else it saves scope display as jpg. Active checkbox starts/stops scope view display. Future enhancements (to-do): very large (adjustable?) scope display area, data save trigger when amplitude exceeds set value and stop data saving when amplitude is below threshold for certain (adjustable) time. https://github.com/OH1GIU-P/SDRSharp.ScopeView     using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using SDRSharp.Common; using System.Drawing.Drawing2D; using System.Drawing.Imaging; namespace SDRSharp.ScopeView {     [DesignTimeVisible(true)]     [C...