Function at 0x409d10
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x3f8
mov esi, edx
mov ebx, ecx
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [rsp + 0x88], 0
mov qword [rsp + 0x60], rax
lea rdx, [rsp + 0x88]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x40a9db
mov eax, dword [rsp + 0x88]
test bl, bl
mov edi, eax
mov dword [rsp + 0x6c], eax
je 0x40a9cc
or al, 0xe0
test dil, 0x80
mov ebx, eax
cmovne ebx, edi
mov dword [rsp + 0x6c], ebx
and ebx, 0xffffffb8
or ebx, 0x18
mov eax, ebx
mov rcx, qword [rsp + 0x60]
or ah, 2
test sil, sil
cmovne ebx, eax
mov rax, qword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov edx, ebx
mov qword [rsp + 0x78], rax
call rax
test eax, eax
je 0x40a9fb
lea rcx, str._nPress_any_keys____Ctrl_D_exits_n_n
lea r14, [rsp + 0x150]
call fcn.0042fa50
lea rax, [rsp + 0x8c]
mov dword [rsp + 0x8c], 0
mov qword [rsp + 0x70], rax
lea rax, [rsp + 0x170]
mov qword [rsp + 0x48], rax
lea rax, [r14 + 1]
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0xd0]
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0xd7]
mov qword [rsp + 0x58], rax
nop dword [rax]
mov r9, qword [rsp + 0x70]
mov r8d, 0x20
mov rdx, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_ReadConsoleInputW]
test eax, eax
je 0x409e3a
mov ecx, dword [rsp + 0x8c]
test ecx, ecx
jne 0x409e5f
mov edx, dword [rsp + 0x6c]
mov rcx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x78]
call rax
nop
add rsp, 0x3f8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea rbp, [rsp + 0xf0]
mov qword [rsp + 0xf8], 0
mov byte [rsp + 0x100], 0
xor esi, esi
lea rax, [rbp + 0x10]
mov qword [rsp + 0xf0], rax
lea rax, [rsp + 0xb0]
mov qword [rsp + 0x38], rax
lea rax, [rsp + 0x130]
mov qword [rsp + 0x30], rax
jmp 0x409eb5
add esi, 1
cmp dword [rsp + 0x8c], esi
jbe 0x409fd8
mov edi, esi
lea rbx, [rsp + 0x3f0]
lea rax, [rdi + rdi*4]
shl rax, 2
movzx edx, word [rsp + rax + 0x170]
lea rcx, [rbx + rax]
cmp dx, 1
je 0x409fe0
cmp dx, 2
je 0x40a470
cmp dx, 4
je 0x40a540
cmp dx, 8
je 0x40a780
cmp dx, 0x10
jne 0x409ea5
mov eax, dword [rcx - 0x27c]
lea rbx, str.lost
test eax, eax
lea rax, str.gained
cmovne rbx, rax
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
cmp rax, 6
jbe 0x40aa30
lea rdx, str.focus:
mov r8d, 7
mov rcx, rbp
call fcn.00499d20
mov rcx, rbx
call sub.msvcrt.dll_strlen
movabs rdx, 0x7fffffffffffffff
sub rdx, qword [rsp + 0xf8]
mov r8, rax
cmp rax, rdx
ja 0x40aa5d
mov rdx, rbx
mov rcx, rbp
call fcn.00499d20
mov rdx, qword [rsp + 0xf0]
lea rax, [rbp + 0x10]
mov rbx, qword [rsp + 0xf8]
cmp rdx, rax
mov eax, 0xf
cmovne rax, qword [rsp + 0x100]
lea rdi, [rbx + 1]
cmp rdi, rax
ja 0x40a750
mov byte [rdx + rbx], 0xa
mov rax, qword [rsp + 0xf0]
add esi, 1
mov qword [rsp + 0xf8], rdi
mov byte [rax + rbx + 1], 0
cmp dword [rsp + 0x8c], esi
ja 0x409eb5
xor esi, esi
jmp 0x40a391
movzx edx, word [rsp + rax + 0x17a]
lea r12, [rsp + 0x110]
mov rcx, r12
mov word [rsp + 0x130], dx
movzx edx, word [rsp + rax + 0x17e]
mov eax, dword [rsp + rax + 0x180]
mov dword [rsp + 0x134], edx
mov rdx, qword [rsp + 0x30]
mov word [rsp + 0x138], ax
call fcn.0040c580
lea rax, [rdi + rdi*4]
movzx edx, word [rsp + rax*4 + 0x17c]
test dx, 0xf000
mov r10d, edx
jne 0x40a99d
test dh, 0xf
jne 0x40a951
test dl, 0xf0
mov ecx, 4
mov r11d, 2
jne 0x40a95c
lea r8, [0x004c2380]
mov rax, r10
and eax, 0xf
movzx eax, byte [r8 + rax]
mov byte [rsp + 0x150], al
mov rax, qword [rsp + 0x40]
mov byte [rax], 0
sub rax, r14
lea r13, [0x004b1580]
mov qword [rsp + 0x160], rax
lea rax, [0x004b157d]
test r10w, r10w
lea r15, [0x004b1584]
mov qword [rsp + 0x158], 0
cmovne r13, rax
lea rax, [rdi + rdi*4]
shl rax, 2
mov edx, dword [rsp + rax + 0x174]
movzx ebx, word [rsp + rax + 0x178]
lea rax, [0x004b1581]
test edx, edx
cmovne r15, rax
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
cmp rax, 4
jbe 0x40aa69
lea rdx, str.key:
mov r8d, 5
mov rcx, rbp
call fcn.00499d20
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
cmp rax, 1
jbe 0x40aa90
mov r8d, 2
mov rdx, r15
mov rcx, rbp
call fcn.00499d20
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
cmp rax, 4
jbe 0x40aa9c
lea rdx, str._rpt
mov r8d, 5
mov rcx, rbp
call fcn.00499d20
lea rcx, [rsp + 0x90]
mov byte [rsp + 0x97], 0
lea rdx, [rcx + 7]
nop word cs:[rax + rax]
movzx eax, bx
sub rdx, 1
imul eax, eax, 0xcccd
shr eax, 0x13
mov r8d, eax
lea eax, [r8*4]
add eax, r8d
add eax, eax
sub ebx, eax
mov eax, ebx
mov ebx, r8d
add eax, 0x30
test r8w, r8w
mov byte [rdx], al
jne 0x40a180
mov rax, rdx
sub rax, rcx
sub rcx, rdx
mov qword [rsp + 0x98], rax
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
lea r8, [rcx + 7]
mov qword [rsp + 0xa0], r8
cmp r8, rax
ja 0x40aaa8
mov rcx, rbp
call fcn.00499d20
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
cmp rax, 4
jbe 0x40aab4
lea rdx, str._scn
mov r8d, 5
mov rcx, rbp
call fcn.00499d20
mov rcx, r13
call sub.msvcrt.dll_strlen
movabs rdx, 0x7fffffffffffffff
sub rdx, qword [rsp + 0xf8]
mov r8, rax
cmp rax, rdx
ja 0x40aac0
mov rdx, r13
mov rcx, rbp
call fcn.00499d20
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
mov r8, qword [rsp + 0x160]
mov rdx, r14
add rdx, qword [rsp + 0x158]
cmp r8, rax
ja 0x40aacc
mov rcx, rbp
call fcn.00499d20
mov rdx, qword [rsp + 0xf0]
lea rax, [rbp + 0x10]
mov rbx, qword [rsp + 0xf8]
cmp rdx, rax
mov eax, 0xf
cmovne rax, qword [rsp + 0x100]
lea r13, [rbx + 1]
cmp r13, rax
ja 0x40a850
mov byte [rdx + rbx], 0x20
mov rax, qword [rsp + 0xf0]
mov rcx, rbp
mov qword [rsp + 0xf8], r13
mov byte [rax + rbx + 1], 0
mov r8, qword [rsp + 0x118]
mov rdx, qword [rsp + 0x110]
call fcn.00499d20
mov rdx, qword [rsp + 0xf0]
lea rax, [rbp + 0x10]
mov rbx, qword [rsp + 0xf8]
cmp rdx, rax
mov eax, 0xf
cmovne rax, qword [rsp + 0x100]
lea r13, [rbx + 1]
cmp r13, rax
ja 0x40a880
mov byte [rdx + rbx], 0xa
mov rax, qword [rsp + 0xf0]
add r12, 0x10
mov qword [rsp + 0xf8], r13
mov byte [rax + rbx + 1], 0
mov rcx, qword [rsp + 0x110]
cmp rcx, r12
je 0x40a34e
call fcn.004aaf10
lea rax, [rdi + rdi*4]
shl rax, 2
test byte [rsp + rax + 0x180], 0xc
movzx eax, word [rsp + rax + 0x17a]
je 0x40a36e
cmp ax, 0x44
je 0x40a38c
test ax, ax
jne 0x409ea5
lea rax, [rdi + rdi*4]
cmp dword [rsp + rax*4 + 0x17c], 0x40000
jne 0x409ea5
mov esi, 1
lea rax, [r14 + 0x10]
lea rdx, [rbp + 0x10]
mov qword [rsp + 0x150], rax
mov rax, qword [rsp + 0xf0]
cmp rax, rdx
je 0x40a9a7
mov qword [rsp + 0x150], rax
mov rax, qword [rsp + 0x100]
mov qword [rsp + 0x160], rax
mov rax, qword [rsp + 0xf8]
mov byte [rsp + 0x100], 0
mov qword [rsp + 0xf8], 0
mov rbx, qword [sym.imp.msvcrt.dll___iob_func]
mov qword [rsp + 0x158], rax
lea rax, [rbp + 0x10]
mov qword [rsp + 0xf0], rax
call rbx
mov r8, qword [rsp + 0x158]
mov rcx, qword [rsp + 0x150]
lea r9, [rax + 0x30]
mov edx, 1
call sub.msvcrt.dll_fwrite
call rbx
lea rcx, [rax + 0x30]
call sub.msvcrt.dll_fflush
mov rcx, qword [rsp + 0x150]
lea rax, [r14 + 0x10]
cmp rcx, rax
je 0x40a442
call fcn.004aaf10
mov rcx, qword [rsp + 0xf0]
add rbp, 0x10
cmp rcx, rbp
je 0x40a458
call fcn.004aaf10
test sil, sil
je 0x409e10
jmp 0x409e3a
mov rdi, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x30]
lea rdx, [rdi + rax + 4]
call fcn.004098a0
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
cmp rax, 6
jbe 0x40aaf1
lea rdx, str.mouse:
mov r8d, 7
mov rcx, rbp
call fcn.00499d20
mov r8, qword [rsp + 0x138]
mov rdx, qword [rsp + 0x130]
mov rcx, rbp
call fcn.00499d20
mov rdx, qword [rsp + 0xf0]
lea rax, [rbp + 0x10]
mov rbx, qword [rsp + 0xf8]
cmp rdx, rax
mov eax, 0xf
cmovne rax, qword [rsp + 0x100]
lea rdi, [rbx + 1]
cmp rdi, rax
ja 0x40a8b0
mov byte [rdx + rbx], 0xa
mov rax, qword [rsp + 0xf0]
mov qword [rsp + 0xf8], rdi
mov byte [rax + rbx + 1], 0
mov rax, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x130]
add rax, 0x10
cmp rcx, rax
je 0x409ea5
call fcn.004aaf10
jmp 0x409ea5
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
movzx edi, word [rcx - 0x27a]
movzx ebx, word [rcx - 0x27c]
cmp rax, 0x17
jbe 0x40ab1f
lea rdx, str.buffer_resized:_dwSize_
mov r8d, 0x18
mov rcx, rbp
call fcn.00499d20
mov eax, ebx
mov byte [rsp + 0xb7], 0
sar ax, 0xf
mov ecx, eax
xor ecx, ebx
sub ecx, eax
mov rax, qword [rsp + 0x38]
lea r8, [rax + 7]
jmp 0x40a5a3
mov r8, rdx
movzx eax, cx
imul eax, eax, 0xcccd
shr eax, 0x13
mov edx, eax
lea eax, [rdx*4]
add eax, edx
add eax, eax
sub ecx, eax
mov eax, ecx
mov ecx, edx
lea rdx, [r8 - 1]
add eax, 0x30
test cx, cx
mov byte [r8 - 1], al
jne 0x40a5a0
test bx, bx
jns 0x40a5df
mov byte [rdx - 1], 0x2d
lea rdx, [r8 - 2]
mov rbx, qword [rsp + 0x38]
mov rax, rdx
sub rax, rbx
mov qword [rsp + 0xb8], rax
mov rax, rbx
sub rax, rdx
lea r8, [rax + 7]
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
mov qword [rsp + 0xc0], r8
cmp r8, rax
ja 0x40ab2b
mov rcx, rbp
call fcn.00499d20
mov rdx, qword [rsp + 0xf0]
lea rax, [rbp + 0x10]
mov rbx, qword [rsp + 0xf8]
cmp rdx, rax
mov eax, 0xf
cmovne rax, qword [rsp + 0x100]
lea r12, [rbx + 1]
cmp r12, rax
ja 0x40a8e0
mov byte [rdx + rbx], 0x2c
mov rax, qword [rsp + 0xf0]
mov qword [rsp + 0xf8], r12
mov r8, qword [rsp + 0x58]
mov byte [rax + rbx + 1], 0
mov eax, edi
mov byte [rsp + 0xd7], 0
sar ax, 0xf
mov ecx, eax
xor ecx, edi
sub ecx, eax
jmp 0x40a693
mov r8, rdx
movzx eax, cx
imul eax, eax, 0xcccd
shr eax, 0x13
mov edx, eax
lea eax, [rdx*4]
add eax, edx
add eax, eax
sub ecx, eax
mov eax, ecx
mov ecx, edx
lea rdx, [r8 - 1]
add eax, 0x30
test cx, cx
mov byte [r8 - 1], al
jne 0x40a690
test di, di
jns 0x40a6cf
mov byte [rdx - 1], 0x2d
lea rdx, [r8 - 2]
mov rdi, qword [rsp + 0x50]
mov rax, rdx
sub rax, rdi
mov qword [rsp + 0xd8], rax
mov rax, rdi
sub rax, rdx
lea r8, [rax + 7]
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
mov qword [rsp + 0xe0], r8
cmp r8, rax
ja 0x40ab37
mov rcx, rbp
call fcn.00499d20
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
cmp rax, 1
jbe 0x40ab43
lea rdx, [0x004b1675]
mov r8d, 2
mov rcx, rbp
call fcn.00499d20
jmp 0x409ea5
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rbp
call fcn.00499ee0
mov rdx, qword [rsp + 0xf0]
jmp 0x409faf
mov edx, dword [rcx - 0x27c]
xor r8d, r8d
mov ecx, 0x1c
nop
mov eax, edx
shr eax, cl
test al, 0xf
jne 0x40a910
add r8d, 1
sub ecx, 4
cmp r8d, 7
jne 0x40a790
lea r9, [0x004c2360]
shr edx, cl
and edx, 0xf
movzx eax, byte [r9 + rdx]
mov byte [rsp + 0x150], al
mov rax, qword [rsp + 0x40]
mov byte [rax], 0
sub rax, r14
mov qword [rsp + 0x160], 0
mov qword [rsp + 0x168], rax
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
cmp rax, 0x17
jbe 0x40ab4f
lea rdx, str.menu_event:_commandId0x
mov r8d, 0x18
mov rcx, rbp
call fcn.00499d20
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0xf8]
mov r8, qword [rsp + 0x168]
mov rdx, r14
add rdx, qword [rsp + 0x160]
cmp r8, rax
jbe 0x409f75
lea rcx, [0x004b1540]
call fcn.004a50e0
nop dword [rax + rax]
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rbp
call fcn.00499ee0
mov rdx, qword [rsp + 0xf0]
jmp 0x40a2bc
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rbp
call fcn.00499ee0
mov rdx, qword [rsp + 0xf0]
jmp 0x40a31f
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rbp
call fcn.00499ee0
mov rdx, qword [rsp + 0xf0]
jmp 0x40a4ff
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rbp
call fcn.00499ee0
mov rdx, qword [rsp + 0xf0]
jmp 0x40a659
lea r10d, [rcx + r8*4 - 0x20]
lea r9, [0x004c2360]
mov rax, r14
nop
mov r11d, edx
add rax, 1
shr r11d, cl
sub ecx, 4
and r11d, 0xf
movzx r11d, byte [r9 + r11]
mov byte [rax - 1], r11b
cmp r10d, ecx
jne 0x40a920
mov eax, 7
sub eax, r8d
lea rax, [r14 + rax + 1]
jmp 0x40a7c6
mov ecx, 8
mov r11d, 1
lea r9d, [rcx + r11*4 - 0x10]
lea r8, [0x004c2380]
mov rax, r14
nop dword [rax + rax]
mov ebx, edx
add rax, 1
sar ebx, cl
sub ecx, 4
and ebx, 0xf
movzx ebx, byte [r8 + rbx]
mov byte [rax - 1], bl
cmp ecx, r9d
jne 0x40a970
mov eax, 3
sub eax, r11d
lea rax, [r14 + rax + 1]
jmp 0x40a078
mov ecx, 0xc
xor r11d, r11d
jmp 0x40a95c
mov rax, qword [rsp + 0x100]
mov rdx, qword [rsp + 0x108]
mov qword [rsp + 0x160], rax
mov qword [rsp + 0x168], rdx
jmp 0x40a3ca
mov ebx, dword [rsp + 0x6c]
and ebx, 0xffffffe8
or ebx, 8
jmp 0x409d85
call qword [sym.imp.msvcrt.dll___iob_func]
lea rdx, str.Error:_could_not_read_console_mode____is_STDIN_a_console_handle__n
lea rcx, [rax + 0x60]
call fcn.0042fa80
mov ecx, 1
call sub.msvcrt.dll_exit
mov esi, dword [rsp + 0x88]
call qword [sym.imp.msvcrt.dll___iob_func]
lea rcx, [rax + 0x60]
mov eax, dword [rsp + 0x6c]
lea rdx, str.Error:_could_not_set_console_mode__0x_x____0x_x____0x_x__n
mov r9d, ebx
mov r8d, esi
mov dword [rsp + 0x20], eax
call fcn.0042fa80
mov ecx, 1
call sub.msvcrt.dll_exit
lea rcx, [0x004b1540]
call fcn.004a50e0
mov rbx, rax
mov rcx, qword [rsp + 0xf0]
add rbp, 0x10
cmp rcx, rbp
je 0x40aa55
call fcn.004aaf10
mov rcx, rbx
call fcn.00424a70
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
mov rcx, qword [rsp + 0x110]
add r12, 0x10
mov rbx, rax
cmp rcx, r12
je 0x40aa3f
call fcn.004aaf10
jmp 0x40aa3f
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
mov rcx, qword [rsp + 0x150]
add r14, 0x10
mov rbx, rax
cmp rcx, r14
jne 0x40aa89
jmp 0x40aa3f
lea rcx, [0x004b1540]
call fcn.004a50e0
mov rbx, rax
mov rax, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x130]
add rax, 0x10
cmp rcx, rax
jne 0x40aa89
jmp 0x40aa3f
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
lea rcx, [0x004b1540]
call fcn.004a50e0
nop
nop
nop
nop
nop