The 16-byte AES key was copy-pasted in the shellcode loader, the DLL
loader and XOREncoder16, so rotating it meant editing each copy.
Move it into a single inline get_aes_key() in common/aes_key.h and use
it from all three call sites; no literal key bytes remain elsewhere in
the tree. The header carries #pragma once because test.cpp includes it
directly and again through Common.h -> IOCPClient.h -> encrypt.h, which
without the guard gives C2084 and, on the v142 toolset, a follow-on
C2065 for every later use in the TU.
Verified: test.cpp and main.c compile under the project's v142 toolset;
the emitted key bytes are unchanged. Linux/macOS/Android keep pulling the
key through common/encrypt.h.
Co-Authored-By: deepseek-flash
Both loaders only reached the registry-payload fallback after a
successful TCP connect: the connect-failure branch just continued, and
requestCount only advanced once a connection was established. A host
that could not reach the master therefore retried forever and never ran
the copy cached in the registry.
Count consecutive connect failures; when MAX_CONNECT_FAILS (3) is
reached and a payload was recorded (version non-empty), break out of the
retry loop so the existing fallback code runs. Without a cached copy the
loop still retries forever, as before, and a successful connect resets
the counter. While fewer than three failures have accumulated the retry
interval is 5 seconds instead of the random 0-119s (0-29s in test.cpp)
backoff, so the fallback is not delayed by minutes; after the threshold
the original backoff resumes.
main.c and test.cpp (MemoryDllRunner) get the same change. The fallback
itself is untouched, including its "bad copy => return NULL" behavior.
Verified on main.c with a harness against a refusing port: three failed
connects, then the cached payload was returned after ~16s. test.cpp was
compile-checked with MSBuild (TestRun, Release x64); it was not run.
Co-Authored-By: deepseek-flash
The Advanced menu now ends with Run Test Program. It copies the kernel
payload that was already read into memory, points its CONNECT_ADDRESS at
127.0.0.1:<listen port>, and loads it with MemoryLoadLibrary inside the
master process, so this machine comes online as a controlled host -- no
second machine is needed to try remote desktop or file transfer. A
worker thread waits for the client to exit, then frees the module and
re-enables the item. Only one instance runs at a time: the item is
grayed while it does, and stopping it means uninstalling the test host
from the online list.
The loaded copy carries LOCAL_TEST_CLIENT_MAGIC in szFuture. The client
uses that mark to refuse the commands that would otherwise hit the host
process or the whole machine: uninstall (no self_del), update, run as
admin, ban, share/assign, and shutdown/reboot/logoff. It also skips
auth-kernel detection, which GetModuleFileName(NULL) would misjudge
inside the master.
Renames szFututre to szFuture and documents that the first 16 bytes of
the reserved tail are now claimed, with a static_assert so it cannot
silently shrink below the magic.
Translations for en_US, zh_TW and de_DE, plus the HIDE_MENU_RUN_TEST
feature flag and its row in the limits dialog.
Verified on a Debug master: the item is last and has its icon, one click
brings the host online, a second click is refused, uninstall stops it in
about a second and the master survives, re-run works, and exiting the
master with a live test client takes 2.6s (3.0s baseline).
Co-Authored-By: deepseek-flash
Replacing the old connection on a duplicate login made the client
reconnect in a tight loop. Instead, park the new connection in a standby
list keyed by clientID and promote it into the main host list only after
the old connection is removed by heartbeat timeout or disconnect.
Fix heartbeat attribution so a parked standby refreshes its own
last-heartbeat time rather than the main connection's, otherwise the main
never times out and the standby can never take over. Gate the offline
notification on an actual removal with no promoted standby to avoid a
spurious "host offline" when takeover happens. Skip promoting a standby
already marked removed, and reuse the normal login sign/settings path when
a standby is promoted.
Co-Authored-By: deepseek-v4-pro