Function at 0x413f20
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x658
mov eax, dword [0x47a060]
xor eax, esp
mov dword [esp + 0x654], eax
push ebx
push ebp
mov ebp, dword [esp + 0x664]
push esi
push edi
mov edi, dword [esp + 0x674]
cmp edi, 3
mov esi, edx
mov ebx, ecx
mov dword [esp + 0x18], esi
je 0x413f6f
cmp edi, 2
je 0x414029
cmp edi, 1
je 0x414029
mov eax, 0x10000
jmp 0x414334
mov eax, dword [ebx + 4]
cmp ebp, eax
je 0x413fcd
cmp eax, 0xffffffff
je 0x413f82
mov edi, dword [ebx]
call fcn.004135e0
mov eax, dword [ebx]
mov dword [ebx + 4], 0xffffffff
cmp ebp, dword [eax + 4]
jge 0x413f65
cmp ebp, dword [eax + 0x10]
jge 0x413fa0
mov esi, eax
call fcn.00412d90
mov esi, dword [esp + 0x18]
mov eax, dword [ebx]
cmp dword [eax + 0x10], ebp
jge 0x413fb9
mov esi, dword [ebx]
call fcn.00412dd0
mov ecx, dword [ebx]
cmp dword [ecx + 0x10], ebp
jl 0x413fa7
mov esi, dword [esp + 0x18]
mov edx, dword [ebx + 0x23c]
mov eax, dword [ebx]
push edx
call fcn.004131f0
add esp, 4
mov dword [ebx + 4], ebp
mov ecx, dword [esp + 0x670]
lea eax, [esp + 0x17]
push eax
mov eax, dword [ebx]
push esi
call fcn.00413370
mov esi, eax
add esp, 8
test esi, esi
jg 0x413ff8
mov edi, dword [ebx]
call fcn.004135e0
mov dword [ebx + 4], 0xffffffff
cmp byte [esp + 0x17], 0
jne 0x414125
test esi, esi
jle 0x414011
mov eax, 0x600
jmp 0x414334
mov eax, esi
sub eax, 0xffffff96
neg eax
sbb eax, eax
and eax, 0x4fff000
add eax, 0x1000
jmp 0x414334
cmp dword [ebx + 4], 0xffffffff
je 0x41403d
mov edi, dword [ebx]
call fcn.004135e0
mov edi, dword [esp + 0x674]
mov eax, dword [ebx]
mov dword [ebx + 4], 0xffffffff
cmp ebp, dword [eax + 4]
jge 0x413f65
cmp ebp, dword [eax + 0x10]
jge 0x414066
mov esi, eax
call fcn.00412d90
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x674]
mov ecx, dword [ebx]
cmp dword [ecx + 0x10], ebp
jge 0x4140cc
lea ecx, [ecx]
mov esi, dword [ebx]
test esi, esi
je 0x4140ba
cmp dword [esi + 0x18], 0
je 0x4140ba
mov eax, dword [esi + 0x10]
add eax, 1
cmp eax, dword [esi + 4]
je 0x4140ba
mov edx, dword [esi + 0x50]
add edx, dword [esi + 0x4c]
mov ecx, dword [esi + 0x48]
push 0
mov dword [esi + 0x10], eax
lea edx, [edx + ecx + 0x2e]
add dword [esi + 0x14], edx
push 0
lea eax, [esi + 0x78]
push eax
lea ecx, [esi + 0x28]
push ecx
mov eax, esi
call fcn.00412940
add esp, 0x10
neg eax
sbb eax, eax
add eax, 1
mov dword [esi + 0x18], eax
mov edx, dword [ebx]
cmp dword [edx + 0x10], ebp
jl 0x414070
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x674]
lea eax, [esp + 0x20]
push eax
push ebp
mov ecx, ebx
call fcn.004137f0
test byte [esp + 0x22c], 0x10
je 0x41412c
cmp edi, 1
je 0x414125
movzx eax, word [esi]
cmp ax, 0x2f
je 0x414103
cmp ax, 0x5c
je 0x414103
test ax, ax
je 0x414115
cmp word [esi + 2], 0x3a
jne 0x414115
push esi
push 0
call fcn.00413e10
add esp, 8
xor eax, eax
jmp 0x414334
push esi
add ebx, 0x244
push ebx
call fcn.00413e10
add esp, 8
xor eax, eax
jmp 0x414334
cmp edi, 1
mov edi, esi
je 0x4141dc
movzx eax, word [esi]
xor ebp, ebp
cmp ax, bp
mov ecx, esi
je 0x414161
movzx eax, ax
cmp ax, 0x2f
je 0x414152
cmp ax, 0x5c
jne 0x414155
lea edi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
cmp ax, bp
jne 0x414146
push esi
lea ecx, [esp + 0x254]
push 0x104
push ecx
call fcn.00451be6
add esp, 0xc
cmp edi, esi
jne 0x4141eb
mov word [esp + 0x250], bp
push edi
lea eax, [esp + 0x254]
push eax
lea esi, [ebx + 0x244]
push esi
lea ecx, [esp + 0x464]
push str._s_s_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
lea edx, [esp + 0x250]
push edx
push esi
call fcn.00413e10
add esp, 8
mov eax, dword [esp + 0x22c]
push ebp
push eax
push 2
push ebp
push ebp
push 0x40000000
lea ecx, [esp + 0x470]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x414257
mov eax, 0x200
jmp 0x414334
mov edx, edi
sub edx, esi
sar edx, 1
mov word [esp + edx*2 + 0x250], bp
mov ax, word [esp + 0x250]
cmp ax, 0x2f
je 0x414225
cmp ax, 0x5c
je 0x414225
cmp ax, bp
je 0x414183
cmp word [esp + 0x252], 0x3a
jne 0x414183
push edi
lea eax, [esp + 0x254]
push eax
lea ecx, [esp + 0x460]
push str._s_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
lea edx, [esp + 0x260]
push edx
push ebp
call fcn.00413e10
add esp, 0x18
jmp 0x4141ba
mov edx, dword [ebx + 0x23c]
mov eax, dword [ebx]
push edx
call fcn.004131f0
add esp, 4
cmp dword [ebx + 0x240], 0
jne 0x414284
push 0x4000
call fcn.0044ea80
add esp, 4
mov dword [ebx + 0x240], eax
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x18], 0
mov ecx, dword [ebx + 0x240]
lea eax, [esp + 0x17]
push eax
mov eax, dword [ebx]
push ecx
mov ecx, 0x4000
call fcn.00413370
mov esi, eax
add esp, 8
cmp esi, 0xffffff96
je 0x4142e5
test esi, esi
jl 0x4142db
jle 0x4142d0
mov eax, dword [ebx + 0x240]
push 0
lea edx, [esp + 0x20]
push edx
push esi
push eax
push edi
call ebp
test eax, eax
je 0x4142ef
cmp byte [esp + 0x17], 0
jne 0x4142f9
test esi, esi
jne 0x414292
mov dword [esp + 0x18], 0x5000000
jmp 0x414318
mov dword [esp + 0x18], 0x1000
jmp 0x414318
mov dword [esp + 0x18], 0x400
jmp 0x414318
lea ecx, [esp + 0x240]
push ecx
lea edx, [esp + 0x234]
push edx
lea eax, [esp + 0x240]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [esp + 0x674], 1
je 0x414329
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebx]
call fcn.004135e0
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x664]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0044eeec
add esp, 0x658
ret 0xc