Category Archives: Programming

PLAYING OLD .XM FILES

#84 Playing old .xm music files

Back when Keygens and Trainers were the go to applications for poor kids wanting to play the latest games or experiment with the latest software’s the chiptune went hand in glove with these tiny applications. These applications were almost exclusively found on Windows computers

These applications were designed to be as small as possible many of them were written in Assembly or C++ and had all the resources embedded in the .exe at highly compressed ratios.

Even with the music file and the graphics accommodating the functionality of these programs they still managed to stay very small in size.

Thus a whole culture surrounding the traditional past time of “cracking” was born. Unfortunately there’s not much practical use for these activity’s in this day and age. Almost everything revolves around the “Internet Browser” and “Web Applications”. However artistically the past time lives on and we can still create these applications in Assembly, C#, C++ etc. as desktop applications.

Intresting links:

http://keygenmusic.org

https://modarchive.org

https://www.winasm.org

https://github.com/Xyl2k/Xylitol-MASM32-snippets

https://github.com/kitsune94/XM-Resource-Demo

https://www.un4seen.com

WHY .NET AND THE DIFFERENCES

#83 The differences between .Net Framework and .Net Core

.Net Framework was created around the year 2000. It’s not just C#, languages are built on top of the .Net Framework. they language like C# are converted into the common intermediate language (CIL).

.Net Framework is now over 20 years old. there’s a lot of checks and processes that have been added which bloat the system. However this is necessary because the .Net Framework still needs to work with older applications E.G an app made in the early 2000s.

So basically the .Net Framework is slowing down apps in the new world of software so many new advancements can’t be leveraged by the .Net Framework.

In 2016 Microsoft started the process of .Net Core. which is a new improved version of the .Net Framework with changes like how processes are executed and what is supported/not supported. Also a lot of backward compatibility has been removed for things no longer needed.

.Net Core has a massive speed increase compared to .Net Framework. Also the code in .Net Framework will run 97% of the time in .Net core however some structures and 3rd party dependencies will have to be changed this is true as of [.Net Core 5].

.Net Framework will still be supported for many years, however new development should be using .Net Core.

LARAVEL WINDOWS SETUP

#80 Laravel setup on Windows systems.

One of the best scalable and flexible back-end frameworks for PHP is the Laravel system. This system offers user front-end and an admin panel, APIs can also be written with authentication and many so called “blade” templates are available for purchase or you can make your own front-end.

The walk-through setup files and README.md documentation is available on my GitHub here.

CURSOR ON TARGET

#73 Cursor On Target (COT) protocol

Example flow

Cursor on Target is a simple exchange standard that is used to share information about targets. Its loosely coupled design led to multiple implementations and is used to facilitate interoperability of several systems with already fielded military software. Cursor on Target was originally developed by MITRE in 2002 in support of the U.S. Air Force Electronic Systems Center. Mitre first demonstrated Cursor on Target during a combined joint task force exercise in 2003, during which a Predator unmanned aircraft was able to operate in coordination with manned aircraft.

COT text example

For more detailed info read this and this document.

The COT protocol is used with ATAK to provide an exchange between sensors + coms etc.

FREETAKSERVER MANAGER

#70 FreeTAKServer Windows Manager Concept

FreeTAKServer manager control panel concept.

Just a quick C# working example of a FreeTAKServer Manager application for the Windows OS.

WinForms & WPF versions are supported.


The FreeTAKServer Manager C# application was created to make using the current v1.7 of FreeTAKServer more user friendly.

FreeTAKServer Manager has the ability to Start, Stop, Restart, Install and Uninstall the FreeTAKServer & FreeTAKServer-UI.

It can also start on startup, send alert emails, let the user test the API (localhost & custom), allow quick MainConfig.py & config.py edits, Open a portforward testing page.

The App requires Admin privilege in order to run cmd commands effectively.

Remove all previous Python environment variables (if you have them) because they mess up the paths.

N.B the application has been created with the microsoft Visual Studio 2019 Community IDE. (https://visualstudio.microsoft.com/vs/)

API testing form

https://github.com/Cale-Torino/FreeTAKServer_Manager

7ZIP EXAMPLE AUTOMATION

#67 7zipExample Automation Application In C#

Example Video

While creating a download page for a website I came across the problem where the browser would open a .PDF file instead of downloading it to the desktop of my PC when using the JavaScript window.location.href = "url/path/file.pdf"; function. A quick easy solution is to archive the .PDF document as a .ZIP file or .7z etc. Now when the function is called the file will be downloaded.

Using a quick C# WinForms application I was able to automate the process. Here I have included a small demo project which may be useful on windows machines.

The Main function is as below:

Example code of the main function.

A new process is started and Arguments are sent to the 7za.exe console application.

7za.exe can also be used in the CMD console as well as with scripting languages such as PowerShell or Batch.

TUYA SMART API

#55 TUYA API EXAMPLE USE

Tuya Smart is a China-based IoT provider. Tuya Smart provides all kinds of smart home gadgets and gizmos. A cloud support plat form exists as well as an app for Android and an app for IOS.

Here I have an example of the cloud API which can be queried from any device that has internet. The variables are passed as headers in each request.

PHP EXAMPLE:

cURL PHP query example

JavaScript jQuery EXAMPLE:

jQuery example query using headers.

C# WINDOWS FORMS EMAIL

#54 C# WINDOWS FORMS EMAIL TEST

Form C# Email Example

A simple C# WinForms desktop application to send a text email/send an attachment email.

This application uses no special class. The default mail classes are used namely:

using System.Net.Mail;

using System.Net.Mime;

The email text is sent in HTML format:

var mailMessage = new MailMessage{                     From = new MailAddress(Vars._mailFrom),//email            Subject = "C# WinForms Test Mail",                     Body = "<h1>Hello</h1>" + "<h2>C# WinForms Test Mail</h2>",                     IsBodyHtml = true,};

ESKOM’s LOAD SHEDDING API

#52 LOADSHEDDING API

Eskom has a load shedding (Rolling blackouts) API we can utilize. I still need to test the accuracy of the results as well as the functionality of the API.

The good news is that unlike Eskom’s electricity supply this API is always on and actually works (with HTTPS as well)

It looks like Eskom’s software team can do a half decent job. I realize that it’s a bit unfair to give them so much grief. The real issue here is corrupt officials in high places stealing from the people as much as they can before their clocks expire.

There is no excuse… the reality is that we are stuck between a rock and a hard place. I can only hope that the future generations are able to see it for what it is and focus on building South Africa instead of destroying and stealing what others are so desperately trying to improve…

One thing is for sure.. at this rate we are truly moving in the direction of retardation (backwards motion) there’s no middle ground or some type of constant speed things are literally degrading. It’s honestly terrifying to witness this as a youngster.

At least we are not a war torn country like many in the middle east so perhaps I can give credence to the South African police and intelligence agency’s no matter how corrupt they have become they have not stooped to the level of warmongers just yet… (I suppose elite gangsters and mobsters would be a better suited description at this time)

Below is an example of the API I have rewritten in markdown format. A simple four step process to get some usable data.

  1. Get Status
  2. Get Municipalities
  3. Get Surburb Data
  4. Get ScheduleM

    Checkout my practical example application on GitHub
    You can also find more info on my GitHub documentation and my tutorial article of the practical example.