Secure FTP Plugin 10.3.0.0 in Total Commander: Per-Monitor V2 DPI UI, OpenSSL 4.1.0 + libssh2 1.11.1, and multi-transport session manager.
Engineering Status
Release
10.3.0.0compiles as standalonex64(SFTPplug.wfx64) andx86(SFTPplug.wfx) Total Commander plugins under MSVC C++20/W4 /WX, Control Flow Guard, CET shadow stack compatibility, and static/MTCRT linking with zero external DLLs. Cryptographic operations link OpenSSL 4.1.0 (including native Argon2id for PuTTY PPK v3) and patched libssh2 1.11.1 behindISshBackendandDllExceptionBarrier. Verification spans 34 unit suites (325,471assertions per architecture), Per-Monitor V2 DPI UI layout geometry checks across all 7 dialog variants and 16 languages, and live OpenSSH integration tests.
Complete C-to-C++20 rewrite of the original SFTP plugin by Christian Ghisler. Transport, authentication, and session subsystems use an interface-driven backend abstraction over statically linked OpenSSL 4.1.0 and libssh2 1.11.1, compiled under /W4 /WX, Control Flow Guard, and CET. At runtime, the plugin selects native SFTP, native SCP, shell chunk transfer via cat/dd/base64, PHP Agent over HTTP, or direct LAN Pair based on server capabilities.
| Protocol | Description |
|---|---|
| SFTP | Primary transport. Full subsystem support, streaming transfers, resume on interrupted downloads and uploads. |
| SCP (native) | Faster than SFTP on many servers. Includes >2 GB file detection via 64-bit server check. |
| Shell Fallback | cat / dd / base64 chunk pipeline for servers blocking SFTP subsystem and scp. Operates over a hidden interactive SSH channel. |
| Jump Host (ProxyJump) | Bastion-routed SSH via direct-tcpip tunneling. No external ssh.exe required. |
| PHP Agent (HTTP) | Standalone HTTP transfer mode backed by a single sftp.php file. Supports hosts with no SSH account or blocked subsystem. Directory uploads and batch file downloads transferred as a single TAR stream (opt-in via php_tar checkbox). TAR transfers replace thousands of individual HTTP requests with one POST/GET. |
| PHP Shell (HTTP) | Pseudo-terminal over HTTP via SHELL_EXEC in sftp.php. Persistent command history (Up/Down arrows, 128-entry ring buffer) stored in %APPDATA%\GHISLER\shell_history.txt. Maintains working-directory context across requests. |
| LAN Pair | Direct Windows-to-Windows pairing mode. Custom PAIR1 authentication protocol, LAN2 file-transfer command protocol, UDP broadcast peer discovery. |
| Method | Notes |
|---|---|
| Password | Standard password auth. |
| Keyboard-Interactive | Includes automated password-change-request handling. |
| PEM / OpenSSH | Traditional private key formats, passed directly to libssh2. |
| PPK v2 / v3 (native) | Built-in PuTTY key file parser. No external tools. BCrypt + Argon2d/i/id + AES-256-CBC. |
| Pageant | SSH Agent integration. Auto-launch from pageant.lnk in the plugin directory. |
| Fallback chain | Automatic progression: Pageant → key file → keyboard-interactive → password. |
CryptProtectData) for password storage at the Windows account level.CryptProc API with ! sentinel.SecureZeroMemory on all sensitive buffers after use.DllExceptionBarrier — C++ exception firewall at every exported entry point; prevents any exception from crossing the ABI boundary into Total Commander (which would cause an immediate host crash).putty.reg automatically (recursive search up to 4 levels deep).Sessions folder automatically (recursive search up to 4 levels deep); individual session files, only SSH sessions imported; stored passwords are automatically decrypted and saved to the plugin profile (DPAPI-protected).getaddrinfo, AF_INET6).locale command.~ home directory shortcut protection..lng file localization — 15 languages (EN/PL/RU/DE/FR/ES/IT/CS/HU/NL/PT-BR/RO/SK/UK/JA/ZH-CN) — dynamic dialog translation at runtime, auto-detected from TC wincmd.ini, language-aware control layout (ArrangeInlineRow)SFTPplug.wfx64) and x86 (SFTPplug.wfx) in a single ZIP.BG_DOWNLOAD / BG_UPLOAD flags).WFX API Layer
↓
DllExceptionBarrier (every exported Fs* function)
↓
Plugin Entry Points (FsFindFirst / FsGetFile / FsPutFile / FsExecuteFile / ...)
↓
┌───────────────────────────────────────────┐
│ Business Logic Layer │
│ ├─ ConnectionNetwork / ProxyNegotiator │
│ ├─ ConnectionAuth / SessionPostAuth │
│ ├─ SFTP / SCP / Shell fallback │
│ ├─ PHP Agent (HTTP) / PHP Shell │
│ └─ UI separation (IUserFeedback) │
└───────────────────────────────────────────┘
↓
ISshBackend Interface (ISshSession / ISshChannel / ISftpHandle)
↓
Libssh2Backend Implementation (libssh2 1.11.1 + OpenSSL 4.1.0 statically linked)
Full SFTP subsystem support via libssh2. Streaming reads and writes with configurable chunk sizes. Transfer resume implemented correctly: uses LIBSSH2_SFTP_ATTR_SIZE flag in fstat to determine the actual remote file size before seeking — fixing a regression where resumes always restarted from offset 0.
Handles the SCP wire protocol without the SFTP subsystem. Faster than SFTP on many servers due to lower protocol overhead.
>2 GB file support:
| Step | Implementation |
|---|---|
| Server architecture check | Remote file $(which scp) to detect 64-bit binary |
| Transfer mode | Automatic adjustment for large files |
| Fallback | Shell transfer if SCP limit is detected at runtime |
Requires libssh2 ≥ 1.7.0 for 64-bit size field support.
For servers where the SFTP subsystem is blocked and scp is unavailable. Uses a hidden interactive SSH shell channel.
Upload: Split data into 1024-byte chunks → base64-encode → send via printf '%s' | base64 -d → server appends decoded bytes.
Download: Fast path via cat. Fallback to base64 -w 0 when binary pipe is unreliable. Incremental decode (streaming, no full-file buffering).
Chunk size kept below 1024 bytes (1368 base64 characters) to stay within shell line-length limits on restricted hosts.
The base64 encoder is built in, with no external dependency.
Connects and authenticates to the bastion host, then opens a direct-tcpip channel to the final target. The full auth sequence (including PPK, Pageant, keyboard-interactive) runs on the jump host before the tunnel is established. No external ssh.exe binary involved.
Pick existing session as jump host. Next to the "Jump..." button on the F7 connection dialog there is a session-picker dropdown. Selecting an already-saved session uses its connection parameters (host, port, user, password, keys, agent) as the jump host — no need to retype them. The reference is stored as jumpsessionref=<name> in sftpplug.ini and resolved at connect time, so editing the referenced session propagates to every session that points at it (OpenSSH ProxyJump style). The "Jump..." button is disabled while a reference is active; pick (none) to switch back to manual configuration. Self-reference (picking the session being edited) is blocked at the UI level; chained or cyclic jump configurations are refused at connect time with a clear error.
File integrity verification directly on the server:
| Algorithm | Shell commands tried |
|---|---|
| MD5 | md5sum / md5 -q |
| SHA1 | sha1sum / sha1 -q |
| SHA256 | sha256sum / shasum -a 256 |
| SHA512 | sha512sum / shasum -a 512 |
Fail-fast local validation before any network auth attempt:
| Condition | Behavior |
|---|---|
privkeyfile not set |
Immediate local error — no fallback stall |
Explicit pubkeyfile missing from disk |
Immediate local error |
| Invalid PPK format | Precise error with MAC/KDF diagnostics |
This eliminates the minute-long UI freeze caused by impossible auth attempts in the original plugin.
Converts PuTTY Private Key files to traditional PEM format for libssh2 — no external tools, no puttygen.exe.
PPK v3 specification coverage:
| Component | Implementation |
|---|---|
| KDF | Argon2d / Argon2i / Argon2id — statically linked (argon2, /MT) |
| Encryption | AES-256-CBC |
| MAC | HMAC-SHA-256 over (algorithm ‖ encryption ‖ comment ‖ public_blob ‖ private_blob_plain) |
| MAC key source | Argon2 output bytes 48–79 (encrypted keys); empty string (unencrypted keys) |
| Key derivation | Windows BCrypt BCRYPT_SHA256_ALGORITHM with HMAC flag |
| Output | Traditional PEM, passed to libssh2_userauth_publickey_frommemory |
PPK v2 uses SHA-1-based key derivation, also fully handled natively.
SSH wire format helpers (AppendU32, AppendSshStr, ReadSshStr) are implemented inline without any external parser library.
Connects via named pipe to the running Pageant agent. If Pageant is not running and pageant.lnk exists in the plugin directory, the plugin launches it automatically before retrying agent auth.
| Mode | INI format | Description |
|---|---|---|
| TC Master Password | password=! |
Delegated to TC CryptProc API |
| DPAPI | password=dpapi:<base64> |
CryptProtectData, user-account scope |
| Explicit plaintext | password=plain:<text> |
Opt-in only |
| Legacy XOR | <decimal triplets> |
Read-only; written in 2000s versions |
After decryption, the plaintext buffer is SecureZeroMemory-zeroed before LocalFree. Base64 encoding/decoding uses Windows CryptBinaryToStringA / CryptStringToBinaryA.
Every call Total Commander makes into the plugin is wrapped, so a fault
inside it cannot reach TC's own code. You get a message describing what
went wrong, and Total Commander keeps running.
The XOR key is hardcoded because:
Documented explicitly in source to prevent well-meaning refactors that would break existing user profiles.
| Type | Auth |
|---|---|
| HTTP CONNECT | Basic (username:password) |
| SOCKS4 | None |
| SOCKS4a | None |
| SOCKS5 | None / username-password |
Sessions from other programs appear in an [Imports] folder in the plugin root, one subfolder per source. One adapter per source implements IExternalSessionSource; the enumerated lists are cached next to sftpplug.ini so they are available immediately at startup.
| Source | Auto-detected location | Custom location accepts |
|---|---|---|
| SecureCRT | %APPDATA%\VanDyke\Config\Sessions\ |
Any SecureCRT session tree |
| PuTTY | HKCU\Software\SimonTatham\PuTTY\Sessions |
A putty.reg export |
| WinSCP | HKCU\Software\Martin Prikryl\WinSCP 2\Sessions |
A portable WinSCP.ini |
| FileZilla | %APPDATA%\FileZilla\sitemanager.xml |
Any sitemanager.xml |
| KiTTY | %APPDATA%, %LOCALAPPDATA%, %USERPROFILE% under KiTTY\Sessions\, or the path behind the .kitty file association |
The Sessions\ folder or the install root |
Behaviour:
Enter connects using the settings read from the source; nothing is written to the plugin's own configurationF5 materialises the session into sftpplug.ini as a regular saved entry — Ctrl+A first to take a whole source at once[Refresh] re-reads one source; [Add custom location...] and [Manage custom locations] handle portable installsDefault Settings templates are filtered out.ppk v2/v3/ed25519 are converted nativelyMD5 fingerprint stored in INI per server. First connection prompts acceptance. Changed key raises an explicit warning dialog. Both behaviors use the IUserFeedback interface so they work correctly in background transfer mode.
Direct Windows-to-Windows file transfer without SSH. Uses a custom application-layer protocol stack over TCP/UDP on the local network.
A background thread broadcasts peer announcements and collects incoming ones.
| Parameter | Default |
|---|---|
| UDP broadcast port | 45845 |
| TCP pairing port | 45846 |
| Broadcast interval | 2000 ms |
| App tag | KVCPAIR/1 |
PeerAnnouncement fields: peerId, hostName, displayName, ip, tcpPort, role (Donor / Receiver / Dual), lastSeen.
Challenge-response over the TCP socket established after discovery. Wire exchange:
Client → Server: PAIR1 HELLO <peerId> <role> <clientNonceHex>
Server → Client: PAIR1 CHALLENGE <serverNonceHex> <saltHex> <serverPeerId> <displayName> <role> <port>
Client → Server: PAIR1 AUTH <proofHex>
Server → Client: PAIR1 OK <serverProofHex>
or: PAIR1 OKTRUST <serverProofHex> <issuedTrustHex>
Key derivation for auth proof:
key = PBKDF2-HMAC-SHA256(password, salt, 120 000 iterations, 32 bytes)
proof = HMAC-SHA256(key, clientNonce ‖ serverNonce ‖ "client")
Both client and server verify each other's proof. On first successful connection with password, the server issues a trust token (OKTRUST). On subsequent connections, the stored DPAPI trust key is used instead of the password — TOFU (Trust On First Use) model.
| Role | INI value | Behavior |
|---|---|---|
| Donor | lanpairrole=2 |
Starts the local LAN Pair file server; waits for incoming Receiver connections; refuses to initiate outgoing connections. Use on the machine whose files will be accessed remotely. |
| Receiver | lanpairrole=1 |
Does not start a local file server; connects as client to the Donor. Use on the machine that will browse and transfer files. |
| Auto | lanpairrole=0 |
Starts the local file server and shows a guided 60-second pairing wizard. |
In the Auto wizard: Yes = connect immediately to the discovered peer (this machine acts as Receiver/client); No = stay as server/Donor; Cancel = stop server.
When the Trusted Installer checkbox (lanparti=1) is enabled:
C:\Windows\, Windows Update caches, WindowsApps).Impersonation is per-connection (server) or per-transfer (client) and is always reverted after use. Requires SeDebugPrivilege (elevated TC). The TrustedInstaller service is started automatically if not already running.
Trust keys are held in DPAPI-protected storage, keyed by "lanpair_trust_srv_<serverPeerId>__<clientPeerId>". Trust is per peer-pair, per Windows user account. Trust keys are saved with CRYPTPROTECT_LOCAL_MACHINE flag for compatibility with TrustedInstaller context. If an old key cannot be decrypted (e.g. after enabling TI), it is deleted automatically and re-pairing is triggered.
After PAIR1, the authenticated TCP socket runs the LAN2 line-based command protocol for file operations:
Frame header: magic=0x4B564350 ("KVCP"), version=1, PairCommandType, reserved, payloadSize
PairCommandType values: Handshake, ListRoots, ListDirectory, StartSend, StartReceive, DataChunk, Ack, Error.
LanPairSession public API:
Session timeout configurable via setTimeoutMin(int minutes). When a non-zero timeout is set, every cmd() call checks elapsed time via std::chrono::steady_clock and closes the session automatically when the limit is reached. All methods are noexcept.
Single-file sftp.php deployed on the web server. The plugin communicates via WinHTTP (winhttp.lib), sending chunked multipart/form-data for uploads and receiving raw bytes for downloads.
Operations supported: PROBE, LIST, GET, PUT, MKDIR, REMOVE, RENAME, CHMOD, STAT, TAR_STREAM, TAR_EXTRACT, TAR_PACK, SHELL_EXEC.
When the php_tar checkbox is enabled in the connection profile, all directory copies and batch file transfers use a single TAR HTTP round-trip instead of individual PUT/GET requests. This eliminates per-request overhead — critical on shared hosting (OVH, home.pl) where even small files cost full HTTP round-trip latency.
Upload (TAR_EXTRACT)
TC's FsStatusInfo PUT_MULTI / PUT_MULTI_THREAD session is used to collect all files. The plugin runs a first pass to compute the exact total size, then streams the complete POSIX ustar TAR in a single WinHTTP POST to ?op=TAR_EXTRACT. The server script extracts files on-the-fly via a streaming parser (tar_extract_stream) — no temporary files created on the server. Content-Length is sent as a 64-bit header value (no 4 GB overflow). Regular .tar file uploads without php_tar enabled are unaffected.
Batch Download (TAR_PACK)
When TC signals a multi-file download (FsStatusInfo GET_MULTI / GET_MULTI_THREAD), each FsGetFileW call is intercepted and the remote path queued into TarDownloadSession. When the batch ends, a single POST to ?op=TAR_PACK is sent with all remote paths (newline-separated). The server streams the ustar TAR directly to php://output with no buffering — no 504 Gateway Timeout even for large archives. The plugin parses the TAR stream on the fly, writing files as each entry arrives.
Both directions support GNU LongLink (././@LongLink, typeflag L) for paths longer than 99 characters. Files exceeding 8 589 934 591 bytes (POSIX ustar limit) are skipped cleanly without corrupting the rest of the archive.
AgentUrl struct parsed from connection profile: secure (HTTPS), host, port, object path.
Uses the same sftp.php endpoint but routes commands through SHELL_EXEC. Maintains working-directory awareness across requests. Provides a pseudo-terminal experience for operational tasks on hosts with no SSH access.
The shell console maintains a persistent command history that survives session restarts and plugin reloads.
Navigation
| Key | Action |
|---|---|
↑ Up arrow |
Recall previous command |
↓ Down arrow |
Move forward through history (↓ after reaching the end clears the input line) |
Storage location
%APPDATA%\GHISLER\shell_history.txt
This is the same directory Total Commander uses for its own configuration, keeping all related data in one place. The file is a plain UTF-8 text file, one command per line, and can be opened or inspected in any text editor.
Capacity — ring buffer
The file holds a maximum of 128 entries. When the 129th command is added, the oldest entry is dropped from the top. The file is always rewritten in full on every addition — at 128 short lines this is a negligible I/O cost and eliminates any possibility of stale data from a partial write.
Duplicate suppression
Consecutive identical commands are not added to history (equivalent to bash HISTCONTROL=ignoredups). Running the same command twice in a row records it only once.
Clearing history
History can be cleared from inside the shell console without leaving it:
history -c
or equivalently:
clear history
Both commands erase all entries from memory and delete shell_history.txt from disk immediately. The cursor resets to an empty state. This is equivalent to history -c in bash and is the recommended way to clear sensitive command traces (e.g. after typing a password inline).
Note:
exitandlogoutclose the console window but do not clear history — existing entries are preserved for the next session.
Power-loss and crash safety
Each write uses an atomic two-step pattern:
shell_history.txt.tmp) in the same directory.MoveFileExA with MOVEFILE_REPLACE_EXISTING renames the temp file over the real file.On NTFS, a rename within the same volume is a single metadata operation. If power is lost or the process is killed between steps 1 and 2, the previous shell_history.txt remains intact — it is never truncated or partially overwritten. The worst-case outcome is a leftover .tmp file containing the most recent history, which can be renamed manually if needed.
Critical:
sftp.phpand the plugin are a matched pair — after
updating the plugin, upload thesftp.phpthat came with it, or
transfers relying on newer operations will fail against the old script.Also: the
sftp.phpin the release package ships with no password configured. Uploading it before saving a session in the plugin will result in HTTP 503 on every connection attempt. Always follow the order below.
Step 1 — Configure and save the session in Total Commander
Open the plugin connection dialog (Net → Connect). Fill in:
| Field | Value |
|---|---|
| Connect to | Full URL to sftp.php on your server, e.g. https://example.com/sftp.php |
| Transfer mode | PHP Agent (HTTP) (or PHP Shell (HTTP)) |
| Password | Your chosen shared secret |
| Session name | Any label, e.g. My Hosting |
Click Save. The plugin writes a salted SHA-256 hash (AGENT_PSK_SALT + AGENT_PSK_SHA256) into its local copy of sftp.php. The password itself is never stored in the file.
Step 2 — Upload the modified sftp.php
Copy the local file (containing your hash) to the server:
...\Total Commander\plugins\wfx\SFTPplug\sftp.php → https://example.com/sftp.php
Use FTP, cPanel File Manager, or any other method. Do not upload the original from the download package — it has empty PSK fields.
Step 3 — Verify the endpoint
Open https://example.com/sftp.php?op=PROBE in a browser:
| Response | Meaning |
|---|---|
HTTP 200 {"ok":true,...} |
Ready — proceed to connect |
| HTTP 401 Unauthorized | Script running, awaiting auth — also OK |
| HTTP 503 Service Unavailable | PSK not configured — wrong file uploaded; repeat from Step 1 |
| HTTP 404 Not Found | Wrong URL or file not yet uploaded |
Step 4 — Connect
Select the saved session in Total Commander and connect.
Security model
| Location | Stored | Password exposed? |
|---|---|---|
sftpplug.ini (your PC) |
Password encrypted with Windows DPAPI | No |
sftp.php (server) |
AGENT_PSK_SALT + SHA-256(salt + password) |
No — one-way hash |
| Network | Password in the X-SFTP-AUTH header of every request |
Over HTTPS no (TLS); over plain HTTP yes |
Reading sftp.php on the server gives only the hash, which does not log in; a long random password keeps it from being guessed offline. HTTPS is required beyond local testing.
PHP Shell runs commands as the web server user, outside AGENT_ROOT too. Set AGENT_ALLOW_SHELL = false in sftp.php when the shell is not needed.
All operations are available over SFTP, SCP, and PHP Agent modes (where applicable).
| Operation | SFTP | SCP/Shell | PHP Agent |
|---|---|---|---|
| Directory listing | Native SFTP readdir | ls -la + __WFX_LIST_BEGIN__ / __WFX_LIST_END__ markers |
Agent LIST command |
| Download | Native, with resume | Shell / cat |
Agent GET |
| Upload | Native, with resume | Shell / dd / base64 |
Agent PUT |
| Rename / Move | SFTP rename |
Remote mv |
Agent RENAME |
| Delete file/tree | SFTP unlink / recursive |
Remote rm -rf |
Agent REMOVE |
| Create directory | SFTP mkdir |
Remote mkdir |
Agent MKDIR |
| Chmod | SFTP setstat |
Remote chmod |
Agent CHMOD |
Set attributes (FsSetAttrW) |
SFTP lstat → RMW write bits → setstat | — | — |
| Timestamps | SFTP setstat |
Remote touch |
— |
| Symlink resolution | SFTP realpath |
Parsed from ls -la output |
— |
| Remote checksum | Shell command | Shell command | — |
| File properties | SFTP stat |
Shell stat |
Agent STAT |
Symlinks are parsed from ls -la long-entry format and followed recursively. Special protection against downloading the literal string ~ as a file: the plugin detects this case, reconnects, and retries with the resolved home path.
Real SSH servers vary in shell behavior (prompts, echo, MOTD, systemd OSC 3008, bracketed paste ESC[?2004h). The plugin injects unique markers to delimit directory output reliably and filters ANSI/ECMA-48 control sequences (TerminalText.cpp):
| Marker | Purpose |
|---|---|
__WFX_LIST_BEGIN__ |
Start of ls -la output |
__WFX_LIST_END__ |
End of ls -la output |
echo $? |
Exit code detection after command |
| Scenario | Mitigation |
|---|---|
| SFTP subsystem blocked or non-standard path | Custom sftp-server init command, or fall through to SCP / shell fallback |
scp not available |
Multi-line base64 / cat / dd chunk transfer (up to 49,152 B per command) |
| Noisy shell prompts / OSC sequences | ECMA-48 terminal filter with marker anchoring |
| Delayed output (slow server) | Staggered read timeouts per stage |
No 64-bit scp (>2 GB) |
Automatic detection, fallback to shell transfer |
Remote locale command output is parsed to determine the server's character encoding (UnicodeHelpers.cpp / TextConversion.cpp), preserving non-codepage Unicode paths end-to-end.
Verification uses three automated test suites targeting both x64 and Win32 Release builds, plus a containerized PHP Agent harness:
| Suite | Runner | Scope and Methodology |
|---|---|---|
| Unit tests | tests\run-unit-tests.ps1 |
34 test suites and 325,471 assertions per architecture. Validates PPK v2/v3 parsing and OpenSSL 4.1.0 Argon2id decryption against deterministic RSA, ECDSA P-256/P-384/P-521, and Ed25519 fixtures in tests\fixtures\ppk, UTF-8 and CRLF conversion, ECMA-48 control-sequence stripping, LAN Pair PAIR1/PBKDF2 cryptography, DPAPI/legacy password codecs, wildcard matching, and batch download error state transitions. |
| UI layout tests | tests\run-ui-tests.ps1 |
Instantiates all 7 Win32 dialog templates, including download-error, across all 16 localizations under Per-Monitor V2 DPI scaling. Computes rendered glyph extents against control bounding boxes to fail on clipped text, overlapping controls, or out-of-bounds geometry. |
| Integration tests | tests\run-integration-tests.ps1 |
Loads the compiled .wfx plugin via PluginHarness.cpp against a live OpenSSH server across 5 transfer paths: SFTP, SCP data, SCP-only, shell fallback, and CRLF/LF text conversion. |
| PHP Agent harness | tools\php-agent-test\docker-compose.yml |
Reproduces HTTP TAR upload, TAR streaming download, and SHELL_EXEC workflows against a local PHP container. |
build.ps1 (project root) compiles the plugin using MSBuild with the MSVC v145 toolset. Both x64 and x86 targets are built by default and packaged together in a single ZIP.
Default (all languages in one binary, x64 + x86):
.\build.ps1
Single-language builds (smaller binary):
.\build.ps1 -en # English
.\build.ps1 -pl # Polish
.\build.ps1 -de # German
.\build.ps1 -fr # French
.\build.ps1 -es # Spanish
Single-language mode strips unused RC language blocks before compile and restores them afterward. Both x64 and x86 are still built.
Output after a successful build:
bin\SFTPplug.zip — only file remaining in bin\; auto-deployed to TC plugin directorySFTPplug.wfx64 (x64) and SFTPplug.wfx (x86)2030-01-01 00:00:00 (dependency-free release marker)build\bin\, build\.intermediates\) are fully removedRelease configuration:
stdcpp20 (C++20), stdc17 (C17)MaxSpeedMultiThreaded (/MT, static CRT — no VC++ Redistributable required)NDEBUG defined → SFTP_DEBUG_ENABLED=0, SFTP_DEBUG_TO_FILE=0Debug configuration:
SFTP_DEBUG_ENABLED=1 → OutputDebugString outputSFTP_DEBUG_TO_FILE=0 by default; set to 1 manually for file logging to C:\temp\sftpplug_debug.logRebuilding dependency libraries (third_party/build.ps1):
All dependency static libs (argon2 and libssh2) can be rebuilt from source:
.\third_party\build.ps1 # Build all (argon2 + libssh2, x64 + x86)
.\third_party\build.ps1 -argon # argon2 only
.\third_party\build.ps1 -libssh2 # libssh2 only
.\third_party\build.ps1 -x64only # x64 only
.\third_party\build.ps1 -x86only # x86 only
Output libs are placed in src\lib\ (suffixed: argon2_a_x64.lib, argon2_a_x86.lib, libssh2_x64.lib, libssh2_x86.lib). The script verifies /MT (LIBCMT) linkage in every output lib before copying.
| Component | Requirement |
|---|---|
| Windows | Windows 7 or later (Windows 10/11 recommended) |
| Total Commander | Version 9.0 or later (x64 or x86) |
| Architecture | x64 (SFTPplug.wfx64) and x86 (SFTPplug.wfx) |
| Compiler (build) | Visual Studio 2026, MSVC v145 toolset, C++20 |
| libssh2 | Statically linked (1.11.1), built against OpenSSL |
| OpenSSL | Statically linked (3.5.9) — the crypto backend libssh2 runs on |
| Dependencies | None — OpenSSL, libssh2 and argon2 are statically linked with /MT, so no VC++ Redistributable is required |
| Windows APIs | BCrypt, DPAPI (CryptProtectData), WinHTTP, DbgHelp, Winsock2 |
Distribution archive: SFTPplug.zip
| File | Purpose |
|---|---|
SFTPplug.wfx64 |
x64 plugin binary (statically links libssh2 and Argon2, /MT) |
SFTPplug.wfx |
x86 plugin binary (statically links libssh2 and Argon2, /MT) |
pluginst.inf |
Total Commander auto-install descriptor (file= x86, file64= x64) |
sftp.php |
PHP Agent script for HTTP transfer and shell modes |
SFTPplug-help.html |
Full offline documentation, one self-contained page |
readme.txt |
Package notes |
language\pol.lng |
Polish |
language\rus.lng |
Russian |
language\deu.lng |
German |
language\fra.lng |
French |
language\esp.lng |
Spanish |
language\ita.lng |
Italian |
language\cs.lng |
Czech |
language\hu.lng |
Hungarian |
language\nl.lng |
Dutch |
language\pt-br.lng |
Brazilian Portuguese |
language\ro.lng |
Romanian |
language\sk.lng |
Slovak |
language\uk.lng |
Ukrainian |
language\ja.lng |
Japanese |
language\zh-cn.lng |
Simplified Chinese |
No external DLLs required. libssh2 and Argon2 are both rebuilt from source with /MT (static CRT) and statically linked into the binary — no VC++ Redistributable needed on the target system.
Open SFTPplug.zip in Total Commander and press Enter to trigger the plugin install prompt.
On startup the plugin reads HKCU\Software\Ghisler\Total Commander\IniFileName to locate wincmd.ini, then reads LanguageIni from the [Configuration] section (e.g. WCMD_POL.LNG → Polish, WCMD_CZ.LNG → Czech, WCMD_JP.LNG → Japanese). The matched language ID selects the correct .lng file. Language loading is triggered from both FsSetDefaultParams and FsInit to cover all TC load orders.
The binary ships with an English-only compiled resource (sftpplug.rc). All non-English translations are provided as external UTF-8 files in the language\ subdirectory and loaded at runtime via LngLoader. Dialog labels, checkboxes, buttons and window captions are all translated dynamically in WM_INITDIALOG using SetDlgItemTextW. Layout of variable-length rows (e.g. the Jump host line) is adjusted dynamically based on measured text width so all languages fit without overlap or excessive gaps.
| File | Language |
|---|---|
| (binary) | English (US) — built-in fallback |
language\pol.lng |
Polish |
language\rus.lng |
Russian |
language\deu.lng |
German |
language\fra.lng |
French |
language\esp.lng |
Spanish |
language\ita.lng |
Italian |
language\cs.lng |
Czech |
language\hu.lng |
Hungarian |
language\nl.lng |
Dutch |
language\pt-br.lng |
Brazilian Portuguese |
language\ro.lng |
Romanian |
language\sk.lng |
Slovak |
language\uk.lng |
Ukrainian |
language\ja.lng |
Japanese |
language\zh-cn.lng |
Simplified Chinese |
If TC uses a language the plugin cannot auto-detect (custom/community language file, or a language not in the supported 15), the UI falls back to English. This can be overridden via [Configuration] in sftpplug.ini:
[Configuration]
Language=English
Accepted values: English, Polish/pol/pl, German/deu/de, French/fra/fr, Spanish/esp/es, Italian/ita/it, Russian/rus/ru, Czech/cs, Hungarian/hu, Japanese/ja, Dutch/nl, Portuguese/pt-br, Romanian/ro, Slovak/sk, Ukrainian/uk, Chinese/zh-cn.
Custom .lng files are also supported: place language\fin.lng in the plugin directory and set Language=fin. Any string not found in the file falls back to English automatically.
The file sftpplug.tpl (shipped with the plugin) is copied to sftpplug.ini on first run as a template with documentation comments.
To add a new language: create language\XYZ.lng (UTF-8) following the existing format (ID=text, # comments, RC-style \n \t \\ escapes) and deploy it alongside the plugin. If you want full LANGID mapping (Windows locale for date/number formatting), also add the code to LangIdToTcCode in LngLoader.cpp.
LIBSSH2_SFTP_ATTR_SIZE)FsSetAttrW implementation (lstat → RMW → setstat)FtpDirectoryParser)DllExceptionBarrier — ABI exception firewall with DbgHelp stack traceConnectionGuard RAII — leak-free connection lifecycle in FsFindFirstWUpdateCertSectionState — unified cert section control for all transport modespluginst.inf%APPDATA%\GHISLER\shell_history.txt, history -c / clear history commands[Imports] magic folder — sessions from SecureCRT, PuTTY, WinSCP, FileZilla and KiTTY listed as live entries, one subfolder per source; Enter connects, F5 materialises into sftpplug.ini; per-source [Refresh] and custom portable locations; enumeration cached next to the INI so entries are present at startupwincmd.ini LanguageIni settingLanguage= key in [Configuration] of sftpplug.ini; supports all 15 built-in languages by name/ISO code, plus custom .lng stems for unsupported languages; sftpplug.tpl template shipped with the pluginCRYPTPROTECT_LOCAL_MACHINE for DPAPI trust keys; auto-delete stale keys + auto-retry on first connect failure1, 2) can now be deleted via F8/Delphp_tar checkbox; directory F5 copy streams a single POSIX ustar TAR POST to op=TAR_EXTRACT; PHP extracts on-the-fly; GNU LongLink for long paths; two-pass Content-Length; works in foreground (PUT_MULTI) and background thread (PUT_MULTI_THREAD) modes; plain .tar file uploads unaffectedphp_tar checkbox; multi-file F5 copy sends a single POST to op=TAR_PACK with all remote paths; server streams ustar TAR directly without buffering (php://output); plugin parses TAR on-the-fly and writes local files; works in foreground (GET_MULTI) and background thread (GET_MULTI_THREAD) modes; GNU LongLink supported; files >8 GiB skipped cleanlyContent-Length header); TAR pack no longer buffers in php://temp on server (eliminates HTTP 504 on OVH); per-file zero-pad allocation removed from upload loop; >8.5 GiB file guard in both C++ and PHP prevents TAR header corruptionUser-facing summary; see CHANGELOG.md for per-version detail.
EAGAIN busy-waits replaced with event-driven socket waitsProxyJump-style); missing/deleted targets show as [!] name (missing)[session] Upload file: …, useful when multiple sessions are open in different TC tabs/ in the DisplayName ([home/raspi]). F7 inside a folder creates a session there; F6 covers rename / move / cross-folder / bulk folder rename; F8 covers session and bulk folder delete; jump-host references stay valid across every rename. Padlock icon shown for folder-nested sessions. Backwards compatible with flat session profiles.[Active Sessions] magic folder — when at least one session is connected, a virtual folder appears in the plugin root. Entering it lists every active session in a flat view with a [Disconnect All] row at the top: F8 on a row disconnects that session; F8 on [Disconnect All] closes every connection at once; Enter on [Disconnect All] does the same and drops you back to the plugin root. The folder auto-hides when nothing is connected. No setup required.[Imports] folder — the oldImport... button is gone. Sessions from SecureCRT, PuTTY, WinSCP,Enter connectsF5 copies one into your ownSession: field is the session's name — it used to be aLanguage= in sftpplug.ini overrides the choice..ppk holding an ed25519 key used to"password","passphrase" and the plugin keeps them apart; theHighlights: OpenSSL 4.1.0 + libssh2 1.11.1, C++20 /W4 /WX with CFG/CET, DllExceptionBarrier (ABI protection), ConnectionGuard RAII, Per-Monitor V2 DPI + Mica dialogs, Skip / Skip all / Cancel batch download prompt, encrypted LAN Pair + HMAC-signed PHP Agent, 16-language localization (EN + 15 .lng), [Imports] magic folder (SecureCRT / PuTTY / WinSCP / FileZilla / KiTTY / ~/.ssh/config), PHP Agent TAR upload+download, automated unit/UI/integration test suites, no external DLLs or VC++ Redistributable required.
zvldz (zvldz/totalcmd_sftp), numbereleven-a (numbereleven-a/sftp), and bukephalos.
Add a comment