totalcommanderftppasswordrecovery

package module
v0.0.0-...-e5f665d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

Total Commander FTP password recovery (Go)

Total Commander (formerly known as Windows Commander) is a classic file manager for Windows, Windows CE, Windows Phone, and now also Android.

Total Commander has a built-in FTP/FXP client and it keeps the FTP logins and encrypted passwords in wcx_ftp.ini configuration file.

Total Commander FTP Password Recovery Tool

I have reverse engineered and recreated the password decoding algorithm years ago.

It was made available by me to another FlashFXP software to import FTP connection profiles from Total Commander.

I give you source codes for both the original assembly decoding algorithm and a Go implementation of this algorithm.

Total Commander Online Password Decoder

You can either use one of the provided source codes or use my own online implementation to make things faster:

https://www.pelock.com/products/total-commander-ftp-password-recovery

Installation

The preferred way to install the library is via Go modules.

go get github.com/PELock/Total-Commander-FTP-Password-Recovery-Go

The module path is github.com/PELock/Total-Commander-FTP-Password-Recovery-Go.

Usage examples

Example — simple/main.go
/******************************************************************************
 * Total Commander FTP Password Recovery usage example.
 *
 * Version        : v1.0.1
 * Language       : Go
 * Author         : Bartosz Wójcik
 * Web page       : https://www.pelock.com
 *
 *****************************************************************************/

package main

import (
	"encoding/hex"
	"fmt"
	"os"

	totalcommanderftppasswordrecovery "github.com/PELock/Total-Commander-FTP-Password-Recovery-Go"
)

func main() {
	const cipherHex = "00112233445566778899aabbccddeeff"
	decoder := totalcommanderftppasswordrecovery.New()
	plain, err := decoder.DecryptPassword(cipherHex)
	if err != nil {
		fmt.Fprintln(os.Stderr, "Decode failed.")
		os.Exit(1)
	}
	fmt.Println(string(plain))
	fmt.Println("hex: " + hex.EncodeToString(plain))
}

See the examples/ directory in this repository for complete samples.

References

Author

Bartosz Wójcik

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HexStringToByteArray

func HexStringToByteArray(str string) []byte

HexStringToByteArray decodes an even-length hex string. Returns nil on invalid input.

func Rol8

func Rol8(value, counter int) int

Rol8 rotates the low 8 bits of value left by counter&7.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder decrypts Total Commander FTP passwords stored in wcx_ftp.ini. Checksum validation present in Total Commander is not implemented here.

func New

func New() *Decoder

New creates a password decoder.

func (*Decoder) DecryptPassword

func (d *Decoder) DecryptPassword(passwordHex string) ([]byte, error)

DecryptPassword decrypts hex ciphertext and returns UTF-8/raw plaintext bytes.

func (*Decoder) DecryptPasswordString

func (d *Decoder) DecryptPasswordString(passwordHex string) (string, error)

DecryptPasswordString decrypts hex ciphertext to a Latin-1 string (matches PHP chr() output).

func (*Decoder) NextRandMax

func (d *Decoder) NextRandMax(nMax int) int

NextRandMax advances seed = seed*0x8088405+1 and returns the high 32 bits of seed*nMax.

func (*Decoder) SeedPrng

func (d *Decoder) SeedPrng(seed int)

SeedPrng sets the uint32 LCG seed.

Directories

Path Synopsis
examples
simple command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL