astuder / ppld

PPLD - A PCBoard PPE Decompiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PPLD - PCBoard PPE Decompiler

This is a project of mine from back in 1994-1996. It was developed with the DOS versions of Borland C (Turbo C?) and Turbo Assembler (TASM), and I don't know whether it still compiles.

Released to the public domain for your entertainment. Warranty void.

Update: Mike Krüger recently ported PPLD to Rust and is working on improvements and possibly an emulator to run .PPE files. Check out his project here: https://github.com/mkrueger/PPLEngine

What does PPLD do?

Back in the heyday of dial-up BBS, PCBoard was one of the leading applications to operate them. To add custom functionality, PCBoard came with its own programming language (PPL) and a compiler (PPLC) that turned the code into an executable module (PPE). PPLD is a decompiler that converts compiled PPEs back into source code.

History

I built the first version of PPLD in 1994 when asked by a friend to check if a given PPE has a backdoor. When PPLD was originally released, backdoors were discoverd in quite a few popular PPEs.

The source code generated by PPLD can be compiled by PPLC, which allowed modification of 3rd part PPEs. As with all reverse engineering this feature was used for the good (adding functionality and fixing bugs) and the bad (removing licensing restrictions, distributing copies with added backdoors),

In 1996 PPLDebug was added to the package, adding source code debugging of a PPE while running on the BBS. PPLDebug is written in x86 assembler, and IIRC the majority of it was developed by @kschiess

Why put it on GitHub now?

I recently did major rework on the 8051 disassembler for the radare2 project, which reminded me of this reverse engineering project of mine from over 20 years ago. Excuse some of the language in the readme files, I was young, brash and in questionable control of the English language. ¯\_(ツ)_/¯

Addendum March 5 2024

There was no love lost between the PCBoard developers and us 1337 decompiler h4ck0rz. With version 15.3, PCBoard started encrypting PPEs. I still remember using Soft-ICE to rip the decryption routines from the running BBS software.

Recently, I was made aware that the source code of PCBoard 15.3 can be found on the internet. A file named CRYPT.C contains this nugget:

#define SUCKLEN   17
// static char *Suck = "DECOMPILERS SUCK!";  CRYPTO.EXE
static char Suck[SUCKLEN] = {0x8C,0x53,0xB8,0xA7,0x9E,0x0F,0x0A,0xCB,0x28,
  0x62,0x2D,0x50,0x7E,0x05,0x3D,0x4E,0x35};

void LIBENTRY encrypt3(char *Str, int Len) {
  int Recycle = SUCKLEN;
  for (char *p = Suck; Len; Str++, Len--) {
    *Str ^= *p + (char) Len;
    if (--Recycle)
      p++;
    else {
      p = Suck;
      Recycle = SUCKLEN;
    }
  }
}

As the PPLD source code doesn't contain the bytes of the Suck array, this may have been the moment when they won. I don't remember whether that's due to their crypto skillz, or whether I just got bored. :)

About

PPLD - A PCBoard PPE Decompiler


Languages

Language:Assembly 70.8%Language:C 29.1%Language:Batchfile 0.1%