Function at 0x402230
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x340
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edi, ecx
cmp eax, 3
je 0x402534
cmp eax, 2
je 0x402279
cmp eax, 1
je 0x402279
pop edi
pop esi
mov eax, 0x10000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406367
mov esp, ebp
pop ebp
ret 0x10
cmp dword [edi + 4], 0xffffffff
je 0x402289
push dword [edi]
call fcn.00405010
add esp, 4
mov eax, dword [edi]
mov esi, dword [ebp + 8]
mov dword [edi + 4], 0xffffffff
cmp esi, dword [eax + 4]
jge 0x402261
cmp esi, dword [eax + 0x10]
jge 0x4022a8
push eax
call fcn.004050d0
add esp, 4
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jge 0x4022c1
nop
push dword [edi]
call fcn.00405120
mov eax, dword [edi]
add esp, 4
cmp dword [eax + 0x10], esi
jl 0x4022b0
lea eax, [ebp - 0x338]
mov ecx, edi
push eax
push esi
call fcn.00401a50
test byte [ebp - 0x230], 0x10
mov eax, dword [ebp + 0x14]
je 0x40233a
cmp eax, 1
je 0x402325
mov al, byte [ebx]
cmp al, 0x2f
je 0x40231a
cmp al, 0x5c
je 0x40231a
test al, al
je 0x4022f5
cmp byte [ebx + 1], 0x3a
je 0x40231a
lea eax, [edi + 0x140]
push ebx
push eax
call fcn.00401940
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406367
mov esp, ebp
pop ebp
ret 0x10
push ebx
push 0
call fcn.00401940
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406367
mov esp, ebp
pop ebp
ret 0x10
cmp eax, 1
je 0x40243b
mov al, byte [ebx]
mov edx, ebx
mov ecx, ebx
test al, al
je 0x402363
lea ecx, [ecx]
cmp al, 0x2f
je 0x402358
cmp al, 0x5c
jne 0x40235b
lea edx, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x402350
lea esi, [ebp - 0x108]
mov ecx, ebx
sub esi, ebx
lea ecx, [ecx]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [esi + ecx - 1], al
test al, al
jne 0x402370
cmp edx, ebx
jne 0x402389
mov byte [ebp - 0x108], al
jmp 0x4023bb
mov eax, edx
sub eax, ebx
cmp eax, 0x104
jae 0x402610
mov byte [ebp + eax - 0x108], 0
mov al, byte [ebp - 0x108]
cmp al, 0x2f
je 0x4023ee
cmp al, 0x5c
je 0x4023ee
test al, al
je 0x4023bb
cmp byte [ebp - 0x107], 0x3a
je 0x4023ee
push edx
lea eax, [ebp - 0x108]
push eax
lea esi, [edi + 0x140]
push esi
lea eax, [ebp - 0x20c]
push str._s_s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x108]
push eax
push esi
call fcn.00401940
add esp, 0x1c
jmp 0x402419
push edx
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x20c]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x108]
push eax
push 0
call fcn.00401940
add esp, 0x18
push 0
push dword [ebp - 0x230]
lea eax, [ebp - 0x20c]
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x402458
pop edi
pop esi
mov eax, 0x200
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406367
mov esp, ebp
pop ebp
ret 0x10
push dword [edi + 0x138]
push dword [edi]
call fcn.00405190
add esp, 8
cmp dword [edi + 0x13c], 0
jne 0x402484
push 0x4000
call fcn.00406466
add esp, 4
mov dword [edi + 0x13c], eax
lea eax, [ebp - 0x339]
push eax
push 0x4000
push dword [edi + 0x13c]
push dword [edi]
call fcn.004054a0
mov esi, eax
add esp, 0x10
cmp esi, 0xffffff96
je 0x402503
test esi, esi
js 0x4024d5
jle 0x4024c8
push 0
lea eax, [ebp - 0x340]
push eax
push esi
push dword [edi + 0x13c]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4024dc
cmp byte [ebp - 0x339], 0
jne 0x4024e3
test esi, esi
jne 0x402484
mov esi, 0x5000000
jmp 0x402508
mov esi, 0x400
jmp 0x402508
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x224]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
xor esi, esi
jmp 0x402508
mov esi, 0x1000
cmp dword [ebp + 0x14], 1
je 0x402515
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [edi]
call fcn.00405010
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406367
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [edi + 4]
mov esi, dword [ebp + 8]
cmp esi, eax
je 0x402598
cmp eax, 0xffffffff
je 0x40254d
push dword [edi]
call fcn.00405010
add esp, 4
mov eax, dword [edi]
mov dword [edi + 4], 0xffffffff
cmp esi, dword [eax + 4]
jge 0x402261
cmp esi, dword [eax + 0x10]
jge 0x40256d
push eax
call fcn.004050d0
add esp, 4
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jge 0x402585
push dword [edi]
call fcn.00405120
mov eax, dword [edi]
add esp, 4
cmp dword [eax + 0x10], esi
jl 0x402574
push dword [edi + 0x138]
push dword [edi]
call fcn.00405190
add esp, 8
mov dword [edi + 4], esi
lea eax, [ebp - 0x339]
push eax
push dword [ebp + 0x10]
push ebx
push dword [edi]
call fcn.004054a0
mov esi, eax
add esp, 0x10
test esi, esi
jg 0x4025c4
push dword [edi]
call fcn.00405010
add esp, 4
mov dword [edi + 4], 0xffffffff
cmp byte [ebp - 0x339], 0
jne 0x402325
test esi, esi
jle 0x4025ed
pop edi
pop esi
mov eax, 0x600
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406367
mov esp, ebp
pop ebp
ret 0x10
cmp esi, 0xffffff96
mov ecx, 0x1000
mov eax, 0x5000000
cmove eax, ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00406367
mov esp, ebp
pop ebp
ret 0x10
call fcn.00405fef
int3