Skip to main content
Challenges Encrypted bytecode VM (final)
Reverse engineering Expert Encrypted VM Solves: 12

Encrypted bytecode VM (final)

Author: CyberSamSU
Points
150

The final challenge combines two techniques: a known-plaintext XOR attack and tracing a VM with a loop (the same VM as in challenge 11, with the same opcode set):

MnemonicCodeDescription
PUSH1Operanddagi sonni stekka qo'yadi.
STEP13MA'LUMOTLAR jadvalidan navbatdagi baytni oladi, uni KALIT jadvalidagi navbatdagi bayt bilan XOR qiladi, natijani stekka qo'yadi va ichki ko'rsatkichni 1 ga oshiradi.
OUT5Stek tepasini belgi (chr) sifatida chiqaradi va olib tashlaydi.
DEC11Stek tepasidan 1 ayiradi (mod 256).
DUP6Stek tepasidagi qiymatni ikkilantiradi (nusxa qo'shadi).
JZ9Stekdan qiymat oladi; agar u 0 bo'lsa, operand manziliga o'tadi, aks holda davom etadi.
JMP8Operand ko'rsatgan manzilga (indeksga) o'tadi.
HALT0Dasturni to'xtatadi.

ALL programs in this VM version are built according to a single strict template (only one operand — the repetition count N — is different each time, ALL other bytes are constant):

[PUSH, N, STEP, OUT, DEC, DUP, JZ, 10, JMP, 2, HALT]

However, this program is given in a byte representation encrypted with a 4-byte repeating XOR key (below, as a list of decimal numbers):

203 220 134 88 193 193 130 87 194 197 139

Since EVERY byte in the template other than N is known, it is possible to fully recover the key: for each i (where i != 1) kalit[i mod 4] = shifr[i] XOR shablon[i].

Once the key is recovered, fully decode the program (which also reveals N) and run it. The VM's STEP instruction uses the following DATA and KEY tables (key length 3, periodic):

MA'LUMOTLAR: [94, 23, 138, 78, 25, 130, 103, 4, 224, 74, 9, 182, 100, 38, 182, 110, 34, 165, 113, 53, 161, 125, 53, 184, 121, 50, 174]

KEY (for STEP): [28, 86, 211]

Theory: learn the topic
Hints 4
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −15 pts Log in
Hint 2 −30 pts Log in
Hint 3 −45 pts Log in
Hint 4 Free Log in
To submit a flag, log in.

First solvers

1. Stiv_084100 10.09.2026
2. W.o.X 11.09.2026
3. Абдул 15.09.2026
4. Qodirxon Yoqubjonov 18.09.2026
5. Лазиз 01.10.2026
6. Faxriddin Oripov 02.10.2026
7. testrejim 09.10.2026
8. Raumdeuter 09.10.2026
9. 11111tttt 09.10.2026
10. Mirjaxon Qaxxarov 26.10.2026