Function at 0x408c50
Capabilities:
Write file on windows

Disassembly:
mov eax, dword [0x418168]
sub esp, 0x10
cmp eax, 8
push ebx
push ebp
push edi
ja case.0x408c74.3
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
xor ebx, ebx
xor edx, edx
mov dl, byte [eax + 0x408f2c]
jmp dword [edx*4 + 0x408f1c]
mov edx, dword [0x4166c0]
cmp edx, ebx
je case.0x408c74.2
mov edi, str.try_n
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp edx, ebx
je case.0x408c74.2
lea eax, [esp + 0xc]
push ebx
push eax
push ecx
mov ecx, dword [edx + 0xc]
push str.try_n
push ecx
call ebp
test eax, eax
jne case.0x408c74.2
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp case.0x408c74.2
push 2
push ebx
push ebx
call fcn.00408390
mov ecx, dword [0x418114]
push esi
mov dword [0x41814c], ebx
call fcn.00402c70
test eax, eax
je 0x408da9
cmp byte [0x4131c2], bl
je 0x408da9
lea edx, [esp + 0x14]
push edx
call dword [sym.imp.MSVCRT.dll__ftime]
mov eax, dword [esp + 0x18]
mov edx, dword [0x413aa0]
sub eax, edx
mov ecx, dword [esp + 0x1c]
mov esi, dword [0x413aa4]
and ecx, 0xffff
lea eax, [eax + eax*4]
add esp, 4
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
sub eax, esi
add eax, ecx
mov ecx, dword [0x418128]
and ecx, 0x80000001
jns 0x408d32
dec ecx
or ecx, 0xfffffffe
inc ecx
jne 0x408d56
mov ecx, dword [0x414c88]
mov edx, dword [0x414c80]
sub ecx, eax
push edx
mov dword [0x414c88], ecx
mov ecx, dword [0x418114]
call fcn.00402d80
jmp 0x408d75
mov edx, dword [0x414c84]
mov ecx, dword [0x418114]
sub edx, eax
mov eax, dword [0x414c7c]
push eax
mov dword [0x414c84], edx
call fcn.00402ec0
cmp dword [0x414c88], ebx
jg 0x408d8f
cmp dword [0x418154], ebx
jne 0x408d8f
mov dword [0x418154], 1
cmp dword [0x414c84], ebx
jg 0x408da9
cmp dword [0x418158], ebx
jne 0x408da9
mov dword [0x418158], 1
mov eax, dword [0x418168]
mov dword [0x4164b0], ebx
cmp eax, 1
mov dword [0x417708], ebx
je 0x408dd7
cmp eax, 2
je 0x408dd7
cmp eax, 5
je 0x408dd7
cmp eax, 7
je 0x408dd7
cmp eax, 8
jne 0x408e6f
mov esi, dword [0x418128]
mov eax, dword [0x418124]
cmp esi, eax
jle 0x408e2f
mov edx, dword [0x4166c0]
cmp edx, ebx
je 0x408e25
mov edi, str.undo_n
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp edx, ebx
je 0x408e25
lea eax, [esp + 0x10]
push ebx
push eax
push ecx
mov ecx, dword [edx + 0xc]
push str.undo_n
push ecx
call ebp
test eax, eax
jne 0x408e1f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x4166c0]
mov eax, dword [0x418124]
dec esi
cmp esi, eax
jg 0x408dec
mov edx, dword [eax*4 + 0x413cd0]
mov eax, dword [eax*4 + 0x4144a0]
mov ecx, dword [0x418114]
mov dword [0x414c80], edx
mov dword [0x414c7c], eax
call fcn.00402d60
cmp dword [0x418154], ebx
jne 0x408e63
cmp dword [0x418158], ebx
je 0x408e6f
mov dword [0x418158], ebx
mov dword [0x418154], ebx
mov eax, 6
pop esi
mov dword [0x418168], eax
mov dword [0x41816c], eax
cmp byte [0x4131d7], bl
je 0x408ee7
cmp byte [0x4131b9], bl
jne case.0x408c74.3
mov edx, dword [0x4166c0]
cmp edx, ebx
je 0x408ecc
mov edi, str.stoh_n
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp edx, ebx
je 0x408ecc
lea eax, [esp + 0xc]
push ebx
push eax
push ecx
mov ecx, dword [edx + 0xc]
push str.stoh_n
push ecx
call ebp
test eax, eax
jne 0x408ecc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x418168]
mov eax, 3
mov dword [0x41545c], edx
mov dword [0x418168], eax
mov dword [0x41816c], eax
mov eax, dword [0x418114]
mov dword [eax + 0x304], 1
mov ecx, dword [0x418114]
mov dword [ecx + 0x308], ebx
mov edx, dword [0x418114]
mov eax, dword [edx + 0x310]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
pop edi
pop ebp
pop ebx
add esp, 0x10
ret