Function at 0x40420b
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4354
call fcn.0043f330
mov eax, dword [0x4590c0]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 0x14], 3
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edi, ecx
je 0x4044a6
cmp dword [ebp + 0x14], 2
je 0x40424a
cmp dword [ebp + 0x14], 1
je 0x40424a
mov eax, 0x10000
jmp 0x40451d
cmp dword [edi + 4], 0xffffffff
je 0x404257
mov ecx, dword [edi]
call fcn.00403be3
mov ecx, dword [edi]
mov esi, dword [ebp + 8]
or dword [edi + 4], 0xffffffff
cmp esi, dword [ecx + 4]
jge 0x404240
cmp esi, dword [ecx + 0x10]
jge 0x404278
call fcn.00403644
jmp 0x404278
mov ecx, dword [edi]
call fcn.0040367b
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jl 0x404271
lea eax, [ebp - 0x4348]
push eax
push esi
mov ecx, edi
call fcn.00403cbe
test byte [ebp - 0x4240], 0x10
je 0x4042ca
cmp dword [ebp + 0x14], 1
jne 0x4042a4
xor eax, eax
jmp 0x40451d
push ecx
lea edx, [ebp - 0x210]
lea ecx, [ebp - 0x4344]
call fcn.00402eea
pop ecx
lea ecx, [edi + 0x138]
lea edx, [ebp - 0x210]
call fcn.00404145
jmp 0x40429d
xor eax, eax
cmp dword [ebp + 0x14], 1
mov dword [ebp - 0x4350], eax
je 0x4043f8
movzx ecx, word [ebx]
mov esi, ebx
mov edx, ebx
test cx, cx
je 0x4043df
mov dword [ebp - 0x4354], 0x2f
mov dword [ebp - 0x4214], 0x5c
cmp cx, word [ebp - 0x4354]
je 0x404312
cmp cx, word [ebp - 0x4214]
jne 0x404315
lea esi, [edx + 2]
add edx, 2
movzx ecx, word [edx]
test cx, cx
jne 0x404300
cmp esi, ebx
je 0x4043df
lea eax, [ebp - 0x210]
push ebx
push eax
call fcn.00433672
sub esi, ebx
sar esi, 1
pop ecx
lea esi, [esi*2 - 2]
pop ecx
cmp esi, 0x208
jae 0x40452e
xor eax, eax
mov word [ebp + esi - 0x210], ax
mov eax, dword [ebp - 0x4354]
cmp word [ebp - 0x210], ax
je 0x40438a
mov eax, dword [ebp - 0x4214]
cmp word [ebp - 0x210], ax
je 0x40438a
cmp word [ebp - 0x20e], 0x3a
je 0x40438a
xor ecx, ecx
mov byte [ebp - 0x4349], cl
jmp 0x404391
mov byte [ebp - 0x4349], 1
lea eax, [ebp - 0x210]
push 0x449774
push eax
call fcn.004339f2
mov esi, eax
lea eax, [ebp - 0x210]
push 0x44977c
push eax
call fcn.004339f2
add esp, 0x10
test eax, eax
setne cl
test esi, esi
setne al
or cl, al
or cl, byte [ebp - 0x4349]
jne 0x4043dd
lea ecx, [edi + 0x138]
lea edx, [ebp - 0x210]
call fcn.00404145
xor eax, eax
push eax
push dword [ebp - 0x4240]
push 2
push eax
push eax
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x404407
mov eax, 0x200
jmp 0x40451d
mov ecx, dword [edi]
call fcn.00403996
mov esi, 0x4000
jmp 0x404433
je 0x40444d
push 0
lea ecx, [ebp - 0x4214]
push ecx
push eax
lea eax, [ebp - 0x4210]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404446
mov ecx, dword [edi]
push esi
lea edx, [ebp - 0x4210]
call fcn.00403a89
pop ecx
test eax, eax
jns 0x404415
mov byte [ebp - 0x4350], 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x40447e
cmp byte [ebp - 0x4350], 0
jne 0x40447e
lea eax, [ebp - 0x422c]
push eax
lea eax, [ebp - 0x423c]
push eax
lea eax, [ebp - 0x4234]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x40448b
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
call fcn.00403be3
mov ecx, dword [ebp - 0x4350]
xor eax, eax
mov edx, 0x400
test cl, cl
cmovne eax, edx
jmp 0x40451d
mov esi, dword [ebp + 8]
cmp esi, dword [edi + 4]
je 0x4044ec
cmp dword [edi + 4], 0xffffffff
je 0x4044bb
mov ecx, dword [edi]
call fcn.00403be3
mov ecx, dword [edi]
or dword [edi + 4], 0xffffffff
cmp esi, dword [ecx + 4]
jge 0x404240
cmp esi, dword [ecx + 0x10]
jge 0x4044db
call fcn.00403644
jmp 0x4044db
call fcn.0040367b
mov eax, dword [edi]
mov ecx, eax
cmp dword [eax + 0x10], esi
jl 0x4044d6
call fcn.00403996
mov dword [edi + 4], esi
push dword [ebp + 0x10]
mov ecx, dword [edi]
mov edx, ebx
call fcn.00403a89
mov esi, eax
pop ecx
test esi, esi
jle 0x404506
mov eax, 0x600
jmp 0x40451d
mov ecx, dword [edi]
call fcn.00403be3
or dword [edi + 4], 0xffffffff
neg esi
sbb esi, esi
and esi, 0x5000000
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00432b05
leave
ret 0x10
call fcn.004338ce
int3