Function at 0x409370
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x98
mov eax, dword [0x4cbbe8]
xor eax, esp
mov dword [esp + 0x94], eax
mov eax, dword [0x4cf540]
cmp dword [eax + 0x150], 0
je 0x4097d0
cmp dword [0x4cf554], 0
push esi
je 0x4093bb
mov esi, dword [0x4de50c]
mov ecx, dword [0x4de514]
mov eax, dword [0x4de518]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ecx
jmp 0x4093e2
cmp dword [0x4cf558], 0
je 0x4097cf
mov eax, dword [0x4de528]
mov edx, dword [0x4de520]
mov dword [esp + 0xc], eax
mov eax, dword [0x4de52c]
mov dword [esp + 0x10], edx
mov esi, edx
test esi, esi
mov dword [esp + 8], eax
je 0x4097cf
test eax, eax
je 0x4097cf
push edi
push 0x4cf4f8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp word [0x4d9be4], 0
je 0x4095f6
push ebx
push ebp
mov ebx, 0x2000
push ebx
xor edi, edi
call fcn.0046f6e3
lea ecx, [esp + 0x17]
push ecx
mov ebp, eax
push esi
lea edx, [esp + 0x20]
lea eax, [esp + 0x24]
call fcn.00408f50
add esp, 0xc
test eax, eax
je 0x4095d6
nop
test byte [0x4de53c], 1
jne 0x4095b8
cmp dword [0x4de540], 0
jne 0x4095b8
cmp word [0x4d8992], 0
mov byte [esp + 0x24], 0
je 0x409538
cmp dword [0x4c12b8], 0
je 0x409538
movzx eax, word [0x4d955e]
xor esi, esi
cmp eax, 3
ja case.default.0x409488
jmp dword [eax*4 + 0x4097e8]
push 0
push 0x4da024
call fcn.0042cd70
add esp, 8
jmp 0x4094cf
push 1
push 0x4da024
call fcn.0042cd70
add esp, 8
jmp 0x4094cf
mov edx, dword [0x4cf540]
mov eax, dword [edx + 0x298]
push eax
jmp 0x4094c7
mov ecx, dword [0x4e25b8]
push ecx
call fcn.0042d090
add esp, 4
mov esi, eax
cmp dword [0x4c12b8], 2
jne 0x4094f3
push 0xffffffffffffffff
push 0x4a5840
lea edx, [esp + 0x2c]
push 0x80
push edx
call fcn.004723db
add esp, 0x10
push 0xffffffffffffffff
push 0x4a586c
lea eax, [esp + 0x2c]
push 0x80
push eax
call fcn.004723db
push 0xffffffffffffffff
push esi
lea ecx, [esp + 0x3c]
push 0x80
push ecx
call fcn.004723db
push 0xffffffffffffffff
push 0x4a5868
lea edx, [esp + 0x4c]
push 0x80
push edx
call fcn.004723db
mov esi, dword [esp + 0x4c]
add esp, 0x30
xor eax, eax
cmp byte [esp + 0x13], 0xa
lea ecx, [ebx*4]
sete al
mov dword [0x4c12b8], eax
mov eax, 0xcccccccd
mul ecx
shr edx, 2
cmp edi, edx
jb 0x40956a
add ebx, ebx
push ebx
push ebp
call fcn.00470bee
add esp, 8
mov ebp, eax
lea eax, [esp + 0x24]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x409571
sub eax, edx
push eax
lea edx, [esp + 0x28]
push edx
lea eax, [edi + ebp]
push eax
call fcn.00472850
lea eax, [esp + 0x30]
add esp, 0xc
lea ecx, [eax + 1]
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x409595
sub eax, ecx
mov cl, byte [esp + 0x13]
add edi, eax
mov byte [edi + ebp], cl
mov eax, dword [0x4cf540]
add edi, 1
add dword [eax + 0x15c], 1
lea edx, [esp + 0x13]
push edx
push esi
lea edx, [esp + 0x1c]
lea eax, [esp + 0x20]
call fcn.00408f50
add esp, 8
test eax, eax
jne 0x409440
mov eax, dword [0x4cf540]
mov ecx, dword [eax + 0x2ac]
push edi
push ebp
push 0x8001
push ecx
call dword [sym.imp.USER32.dll_PostThreadMessageA]
pop ebp
pop ebx
jmp 0x40976b
lea edx, [esp + 0xb]
push edx
push esi
lea edx, [esp + 0x14]
lea eax, [esp + 0x18]
call fcn.00408f50
add esp, 8
test eax, eax
je 0x40976b
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea ebx, [ebx]
test byte [0x4de53c], 1
jne 0x40974d
cmp dword [0x4de540], 0
jne 0x40974d
cmp word [0x4d8992], 0
je 0x409714
cmp dword [0x4c12b8], 0
je 0x409714
movzx eax, word [0x4d955e]
xor esi, esi
cmp eax, 3
ja case.default.0x409663
jmp dword [eax*4 + 0x4097f8]
push 0
push 0x4da024
call fcn.0042cd70
add esp, 8
jmp 0x4096a9
push 1
push 0x4da024
call fcn.0042cd70
add esp, 8
jmp 0x4096a9
mov eax, dword [0x4cf540]
mov ecx, dword [eax + 0x298]
push ecx
jmp 0x4096a1
mov edx, dword [0x4e25b8]
push edx
call fcn.0042d090
add esp, 4
mov esi, eax
mov ecx, dword [0x4cf540]
mov edx, dword [ecx + 0x154]
push 0
lea eax, [esp + 0x1c]
push eax
push 1
push 0x4a586c
push edx
call edi
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4096d0
push 0
sub eax, edx
mov edx, dword [0x4cf540]
lea ecx, [esp + 0x1c]
push ecx
push eax
mov eax, dword [edx + 0x154]
push esi
push eax
call edi
mov edx, dword [0x4cf540]
mov eax, dword [edx + 0x154]
push 0
lea ecx, [esp + 0x1c]
push ecx
push 2
push 0x4a5868
push eax
call edi
mov esi, dword [esp + 0x14]
xor ecx, ecx
cmp byte [esp + 0xb], 0xa
push 0
sete cl
lea edx, [esp + 0x1c]
push edx
push 1
lea eax, [esp + 0x17]
push eax
mov dword [0x4c12b8], ecx
mov ecx, dword [0x4cf540]
mov edx, dword [ecx + 0x154]
push edx
call edi
mov eax, dword [0x4cf540]
add dword [eax + 0x15c], 1
lea eax, [esp + 0xb]
push eax
push esi
lea edx, [esp + 0x14]
lea eax, [esp + 0x18]
call fcn.00408f50
add esp, 8
test eax, eax
jne 0x409620
push 0x4cf4f8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x4cf554], 0
pop edi
je 0x409796
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 8]
mov dword [0x4de514], ecx
mov dword [0x4de518], edx
jmp 0x4097a9
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 8]
mov dword [0x4de528], eax
mov dword [0x4de52c], ecx
test byte [0x4de53c], 1
jne 0x4097cf
cmp dword [0x4de540], 0
jne 0x4097cf
mov ecx, dword [0x4cf578]
test ecx, ecx
je 0x4097ca
call fcn.0040b810
call fcn.004090e0
pop esi
mov ecx, dword [esp + 0x94]
xor ecx, esp
call fcn.0046fa34
add esp, 0x98
ret