Please wait
Loading the requested page
Loading
Reading the latest public record.
Please wait
Loading the requested page
Reading the latest public record.
We received a zip archive named duck_rpg.zip containing two batch scripts: game.bat and result.bat. Running game.bat starts a small text-based RPG battle, while the mysterious result.bat is called at the end to display something based on the hash of the main script.
Looking at game.bat, the game logic defines three battles (Angry Duck, Duck Mage, Mother Goose) and sets fragments frag1, frag2, and frag3 to words that combine into a keyword. The final section calls:
call result.bat !full! !hash!
The result.bat file is heavily obfuscated with weird %Bc:~x,1% indexing expressions, which reconstruct hidden text using the variable Bc defined as:
@1lYWZUrksK9Mwxd2PLGypH68fOStF4Abaq3zXDeuJNRc Bo7h0gvni5IjmCTQVE
To see what result.bat actually prints, I extracted all those %Bc:~x,1% indices and rebuilt them using a small Python script. The decoded sections showed multiple conditional blocks checking the first argument:
if "%~1"=="unlocktheduck" → echoes one messageif "%~1"=="unlockthegoose" → echoes anotherThe unlockthegoose branch simply printed a joke: "Well that was fun but there no flag here".
But the unlocktheduck branch revealed something far more interesting:
echo v1tp4tchth3b4tcht0g3tth3s3cr3t3nd1ng
So the secret ending wasn’t part of normal gameplay, it was hidden in a branch never reached naturally.
We could trigger the hidden branch manually by modifying the start of game.bat to call it directly:
call result.bat unlocktheduck
Once executed, the batch printed:
v1tp4tchth3b4tcht0g3tth3s3cr3t3nd1ng
This looked like a leetspeak phrase for the flag. After normalizing it with underscores, the final flag became:
v1t{p4tch_th3_b4tch_t0_g3t_th3_s3cr3t_3nd1ng}
v1t{p4tch_th3_b4tch_t0_g3t_th3_s3cr3t_3nd1ng}