Function at 0x402390
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4340
call fcn.004580e0
mov eax, dword [0x492984]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, ecx
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x4340], esi
push edi
cmp eax, 3
je 0x4026e3
cmp eax, 2
je 0x4023e3
cmp eax, 1
je 0x4023e3
pop edi
pop esi
mov eax, 0x10000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004580b8
mov esp, ebp
pop ebp
ret 0x10
cmp dword [ebx + 4], 0xffffffff
je 0x4023f3
push dword [ebx]
call fcn.00404f90
add esp, 4
mov eax, dword [ebx]
mov edi, dword [ebp + 8]
mov dword [ebx + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x4023cb
cmp edi, dword [eax + 0x10]
jge 0x402412
push eax
call fcn.00405020
add esp, 4
mov eax, dword [ebx]
cmp dword [eax + 0x10], edi
jge 0x40247b
lea esp, [esp]
mov esi, dword [ebx]
test esi, esi
je 0x40246e
cmp dword [esi + 0x18], 0
je 0x40246e
mov edx, dword [esi + 0x10]
inc edx
cmp edx, dword [esi + 4]
je 0x40246e
mov ecx, dword [esi + 0x50]
mov eax, dword [esi + 0x48]
add ecx, dword [esi + 0x4c]
add eax, 0x2e
push 0
push 0
push 0
push 0
add eax, ecx
mov dword [esi + 0x10], edx
add dword [esi + 0x14], eax
lea eax, [esi + 0x78]
push 0
push 0
push eax
lea eax, [esi + 0x28]
push eax
push esi
call fcn.004058c0
add esp, 0x24
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov eax, dword [ebx]
cmp dword [eax + 0x10], edi
jl 0x402420
mov esi, dword [ebp - 0x4340]
lea eax, [ebp - 0x4338]
mov ecx, ebx
push eax
push edi
call fcn.00401e40
test byte [ebp - 0x4230], 0x10
je 0x4024dc
cmp dword [ebp + 0x14], 1
je 0x4024c7
push 0x103
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x4334]
push eax
call fcn.004021f0
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebx + 0x138]
push eax
call fcn.00401c40
add esp, 0x14
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004580b8
mov esp, ebp
pop ebp
ret 0x10
cmp dword [ebp + 0x14], 1
je 0x4025f2
movzx eax, word [esi]
mov edx, esi
mov ecx, esi
test ax, ax
je 0x4025d6
cmp ax, 0x2f
je 0x402502
cmp ax, 0x5c
jne 0x402505
lea edx, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x4024f6
cmp edx, esi
je 0x4025d6
lea edi, [ebp - 0x20c]
mov ecx, esi
sub edi, esi
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edi + ecx - 2], ax
test ax, ax
jne 0x402523
sub edx, esi
sar edx, 1
lea edx, [edx*2 - 2]
cmp edx, 0x208
jae 0x40279d
xor eax, eax
mov word [ebp + edx - 0x20c], ax
mov ax, word [ebp - 0x20c]
cmp ax, 0x2f
je 0x402578
cmp ax, 0x5c
je 0x402578
cmp word [ebp - 0x20a], 0x3a
mov byte [ebp - 0x4339], 0
jne 0x40257f
mov byte [ebp - 0x4339], 1
mov esi, dword [sym.imp.MSVCR120.dll_wcsstr]
lea eax, [ebp - 0x20c]
push 0x46465c
push eax
call esi
mov edi, eax
lea eax, [ebp - 0x20c]
push 0x464664
push eax
call esi
add esp, 0x10
test eax, eax
setne cl
test edi, edi
setne al
or cl, al
or cl, byte [ebp - 0x4339]
jne 0x4025d0
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebx + 0x138]
push eax
call fcn.00401c40
add esp, 8
mov esi, dword [ebp - 0x4340]
push 0
push dword [ebp - 0x4230]
push 2
push 0
push 0
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40260f
pop edi
pop esi
mov eax, 0x200
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004580b8
mov esp, ebp
pop ebp
ret 0x10
push dword [ebx]
call fcn.00405260
push 0x4000
lea eax, [ebp - 0x420c]
mov byte [ebp - 0x4339], 0
push eax
push dword [ebx]
call fcn.00405550
add esp, 0x10
test eax, eax
js 0x402671
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x402678
push 0
lea ecx, [ebp - 0x4340]
push ecx
push eax
lea eax, [ebp - 0x420c]
push eax
push esi
call edi
test eax, eax
je 0x402671
push 0x4000
lea eax, [ebp - 0x420c]
push eax
push dword [ebx]
call fcn.00405550
add esp, 0xc
test eax, eax
jns 0x40263d
mov byte [ebp - 0x4339], 1
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x4026a9
cmp byte [ebp - 0x4339], 0
jne 0x4026a9
lea eax, [ebp - 0x421c]
push eax
lea eax, [ebp - 0x422c]
push eax
lea eax, [ebp - 0x4224]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x4026b6
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebx]
call fcn.00404f90
add esp, 4
xor eax, eax
cmp byte [ebp - 0x4339], al
mov ecx, 0x400
cmovne eax, ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004580b8
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebx + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x402741
cmp eax, 0xffffffff
je 0x4026fc
push dword [ebx]
call fcn.00404f90
add esp, 4
mov eax, dword [ebx]
mov dword [ebx + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x4023cb
cmp edi, dword [eax + 0x10]
jge 0x40271c
push eax
call fcn.00405020
add esp, 4
mov eax, dword [ebx]
cmp dword [eax + 0x10], edi
jge 0x402734
push dword [ebx]
call fcn.00405070
mov eax, dword [ebx]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x402723
push dword [ebx]
call fcn.00405260
add esp, 4
mov dword [ebx + 4], edi
push dword [ebp + 0x10]
push esi
push dword [ebx]
call fcn.00405550
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x40276d
pop edi
pop esi
mov eax, 0x600
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004580b8
mov esp, ebp
pop ebp
ret 0x10
push dword [ebx]
call fcn.00404f90
mov ecx, dword [ebp - 4]
add esp, 4
neg esi
mov dword [ebx + 4], 0xffffffff
sbb esi, esi
xor ecx, ebp
and esi, 0x5000000
pop edi
mov eax, esi
pop esi
pop ebx
call fcn.004580b8
mov esp, ebp
pop ebp
ret 0x10
call fcn.00457fd5
int3