Function at 0x4059c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x344
mov eax, dword [0x5afd40]
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 esi, ecx
cmp eax, 3
je 0x405a0d
cmp eax, 2
je 0x405af3
cmp eax, 1
je 0x405af3
pop edi
pop esi
mov eax, 0x10000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00506513
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [esi + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x405a77
cmp eax, 0xffffffff
je 0x405a27
mov eax, dword [esi]
push eax
call fcn.004035d0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x4059f5
cmp edi, dword [eax + 0x10]
jge 0x405a43
push eax
call fcn.00403340
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x405a62
lea ebx, [ebx]
mov edx, dword [esi]
push edx
call fcn.00403390
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x405a50
mov ecx, dword [esi + 0x138]
mov edx, dword [esi]
push ecx
push edx
call fcn.00405500
add esp, 8
mov dword [esi + 4], edi
mov ecx, dword [ebp + 0x10]
mov edx, dword [esi]
lea eax, [ebp - 0x339]
push eax
push ecx
push ebx
push edx
call fcn.00405680
mov edi, eax
add esp, 0x10
test edi, edi
jg 0x405aa6
mov eax, dword [esi]
push eax
call fcn.004035d0
add esp, 4
mov dword [esi + 4], 0xffffffff
cmp byte [ebp - 0x339], 0
jne 0x405ba4
test edi, edi
jle 0x405acf
pop edi
pop esi
mov eax, 0x600
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00506513
mov esp, ebp
pop ebp
ret 0x10
lea eax, [edi + 0x6a]
neg eax
sbb eax, eax
pop edi
and eax, 0x4fff000
pop esi
add eax, 0x1000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00506513
mov esp, ebp
pop ebp
ret 0x10
or edi, 0xffffffff
cmp dword [esi + 4], edi
je 0x405b06
mov ecx, dword [esi]
push ecx
call fcn.004035d0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [ebp + 8]
cmp edi, dword [eax + 4]
jge 0x4059f5
cmp edi, dword [eax + 0x10]
jge 0x405b25
push eax
call fcn.00403340
add esp, 4
mov edx, dword [esi]
cmp dword [edx + 0x10], edi
jge 0x405b42
lea esp, [esp]
mov eax, dword [esi]
push eax
call fcn.00403390
mov ecx, dword [esi]
add esp, 4
cmp dword [ecx + 0x10], edi
jl 0x405b30
lea edx, [ebp - 0x338]
push edx
push edi
mov ecx, esi
call fcn.004037f0
test byte [ebp - 0x230], 0x10
je 0x405bb9
cmp dword [ebp + 0x14], 1
je 0x405ba4
mov al, byte [ebx]
cmp al, 0x2f
je 0x405b74
cmp al, 0x5c
je 0x405b74
test al, al
je 0x405b94
cmp byte [ebx + 1], 0x3a
jne 0x405b94
push ebx
push 0
call fcn.00403db0
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00506513
mov esp, ebp
pop ebp
ret 0x10
push ebx
add esi, 0x140
push esi
call fcn.00403db0
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00506513
mov esp, ebp
pop ebp
ret 0x10
cmp dword [ebp + 0x14], 1
je 0x405c58
mov al, byte [ebx]
mov edi, ebx
mov ecx, ebx
test al, al
je 0x405be3
lea ecx, [ecx]
cmp al, 0x2f
je 0x405bd8
cmp al, 0x5c
jne 0x405bdb
lea edi, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x405bd0
lea edx, [ebp - 0x108]
mov eax, ebx
sub edx, ebx
lea ecx, [ecx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x405bf0
cmp edi, ebx
jne 0x405c75
mov byte [ebp - 0x108], cl
push edi
lea ecx, [ebp - 0x108]
push ecx
lea ebx, [esi + 0x140]
push ebx
lea edx, [ebp - 0x20c]
push 0x567a48
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x108]
push eax
push ebx
call fcn.00403db0
add esp, 0x1c
mov ecx, dword [ebp - 0x230]
push 0
push ecx
push 2
push 0
push 0
push 0x40000000
lea edx, [ebp - 0x20c]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x405cd4
pop edi
pop esi
mov eax, 0x200
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00506513
mov esp, ebp
pop ebp
ret 0x10
mov eax, edi
sub eax, ebx
mov byte [ebp + eax - 0x108], 0
mov al, byte [ebp - 0x108]
cmp al, 0x2f
je 0x405ca4
cmp al, 0x5c
je 0x405ca4
test al, al
je 0x405c04
cmp byte [ebp - 0x107], 0x3a
jne 0x405c04
push edi
lea ecx, [ebp - 0x108]
push ecx
lea edx, [ebp - 0x20c]
push 0x567a40
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x108]
push eax
push 0
call fcn.00403db0
add esp, 0x18
jmp 0x405c35
mov eax, dword [esi + 0x138]
mov ecx, dword [esi]
push eax
push ecx
call fcn.00405500
add esp, 8
cmp dword [esi + 0x13c], 0
jne 0x405d02
push 0x4000
call fcn.004079b0
add esp, 4
mov dword [esi + 0x13c], eax
mov dword [ebp - 0x340], 0
lea esp, [esp]
mov eax, dword [esi + 0x13c]
mov ecx, dword [esi]
lea edx, [ebp - 0x339]
push edx
push 0x4000
push eax
push ecx
call fcn.00405680
mov edi, eax
add esp, 0x10
cmp edi, 0xffffff96
je 0x405d70
test edi, edi
js 0x405d64
jle 0x405d57
mov eax, dword [esi + 0x13c]
push 0
lea edx, [ebp - 0x344]
push edx
push edi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x405d7c
cmp byte [ebp - 0x339], 0
jne 0x405d88
test edi, edi
jne 0x405d10
mov dword [ebp - 0x340], 0x5000000
jmp 0x405da4
mov dword [ebp - 0x340], 0x1000
jmp 0x405da4
mov dword [ebp - 0x340], 0x400
jmp 0x405da4
lea ecx, [ebp - 0x21c]
push ecx
lea edx, [ebp - 0x22c]
push edx
lea eax, [ebp - 0x224]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x405db1
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi]
push ecx
call fcn.004035d0
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x340]
add esp, 4
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00506513
mov esp, ebp
pop ebp
ret 0x10