Skip to content

Instantly share code, notes, and snippets.

@kspalaiologos
Created April 17, 2021 11:46
Show Gist options
  • Save kspalaiologos/29c06f2ca21e1554921fa593f97f7e3b to your computer and use it in GitHub Desktop.
Save kspalaiologos/29c06f2ca21e1554921fa593f97f7e3b to your computer and use it in GitHub Desktop.
winimage10 keygen in asm2bf
stk 2
org 0
&name
#times("db 0", 32)
&standard
#times("db 0", 32)
&professional
#times("db 0", 32)
#gen_text("Name: ")
@input_loop
in r1
ceq r1, 0
jmp %input_quit
cge r1, .a
csub r1, 32
sto r2, r1
inc r2
jmp %input_loop
@input_quit
dec r2
mov r1, r2
#call("keygen")
; r4 = code
mov r1, r4
mov r2, *standard
#call("itoa")
push r2
mov r1, r4
add r1, $(0x2061997)
mov r2, *professional
#call("itoa")
pop r1
mov r3, r1
#call("shift8b")
mov r1, r2
#call("shift8b")
#gen_text("Standard: ")
mov r1, r3
#call("puts")
#gen_text("Professional: ")
mov r1, r2
push 0
jmp %puts
@shift8b
rcl f3, r1
ceq f3, 0
cret
ceq f3, .B
cbegin
sto r1, .8
add r1, 1
cend
cjnz %shift8b
ceq f3, .8
csto r1, .B
inc r1
jmp %shift8b
@puts
rcl r2, r1
jz r2, %puts_quit
out r2
inc r1
jmp %puts
@puts_quit
out 10
ret
@itoa
add r2, 31
sto r2, 0
dec r2
@itoa_w
ceq r1, 0
cadd r2, 1
cret
mov r3, r1
mod r3, 16
cle r3, 9
cadd r3, .0
cflip
cadd r3, 55
sto r2, r3
dec r2
div r1, 16
jmp %itoa_w
@keygen
mov r2, r1
mov r4, $(0x47694C)
clr r5
@keygen_loop
ceq r5, r1
cjnz %keygen_finish
mov r6, r5
mod r6, 14
ceq r6, 14
cmov r2, 39
rcl r6, r3
inc r3
mul r6, r2
add r4, r6
mov r6, r5
add r6, 3
mod r6, 14
ceq r6, 0
cmul r2, 7
cflip
cmul r2, 3
inc r5
jmp %keygen_loop
@keygen_finish
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment