Function at 0x59a550
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x340
push ebx
mov ebx, dword [esp + 0x354]
push ebp
push esi
cmp ebx, 3
push edi
mov esi, ecx
je 0x59a58c
cmp ebx, 2
je 0x59a689
cmp ebx, 1
je 0x59a689
pop edi
pop esi
pop ebp
mov eax, 0x10000
pop ebx
add esp, 0x340
ret 0x10
mov eax, dword [esi + 4]
mov edi, dword [esp + 0x354]
cmp edi, eax
je 0x59a604
cmp eax, 0xffffffff
je 0x59a5aa
mov eax, dword [esi]
push eax
call fcn.00599c50
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jl 0x59a5ca
pop edi
pop esi
pop ebp
mov eax, 0x10000
pop ebx
add esp, 0x340
ret 0x10
cmp edi, dword [eax + 0x10]
jge 0x59a5d8
push eax
call fcn.00599420
add esp, 4
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x59a5ef
push eax
call fcn.00599470
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x59a5df
mov ecx, dword [esi + 0x138]
mov edx, dword [esi]
push ecx
push edx
call fcn.005997e0
add esp, 8
mov dword [esi + 4], edi
mov ecx, dword [esp + 0x35c]
mov edx, dword [esp + 0x358]
lea eax, [esp + 0x13]
push eax
mov eax, dword [esi]
push ecx
push edx
push eax
call fcn.00599990
mov edi, eax
add esp, 0x10
test edi, edi
jg 0x59a63c
mov ecx, dword [esi]
push ecx
call fcn.00599c50
add esp, 4
mov dword [esi + 4], 0xffffffff
mov al, byte [esp + 0x13]
test al, al
je 0x59a653
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x340
ret 0x10
test edi, edi
jle 0x59a669
pop edi
pop esi
pop ebp
mov eax, 0x600
pop ebx
add esp, 0x340
ret 0x10
mov eax, edi
pop edi
sub eax, 0xffffff96
pop esi
neg eax
sbb eax, eax
pop ebp
and eax, 0x4fff000
pop ebx
add eax, 0x1000
add esp, 0x340
ret 0x10
mov eax, dword [esi + 4]
or edi, 0xffffffff
cmp eax, edi
je 0x59a69e
mov edx, dword [esi]
push edx
call fcn.00599c50
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [esp + 0x354]
cmp edi, dword [eax + 4]
jl 0x59a6c1
pop edi
pop esi
pop ebp
mov eax, 0x10000
pop ebx
add esp, 0x340
ret 0x10
cmp edi, dword [eax + 0x10]
jge 0x59a6cf
push eax
call fcn.00599420
add esp, 4
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x59a6e6
push eax
call fcn.00599470
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x59a6d6
lea eax, [esp + 0x120]
mov ecx, esi
push eax
push edi
call fcn.00599db0
mov ecx, dword [esp + 0x228]
shr ecx, 4
test cl, 1
je 0x59a76d
cmp ebx, 1
jne 0x59a719
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x340
ret 0x10
mov ecx, dword [esp + 0x358]
mov al, byte [ecx]
cmp al, 0x2f
je 0x59a734
cmp al, 0x5c
je 0x59a734
test al, al
je 0x59a74e
cmp byte [ecx + 1], 0x3a
jne 0x59a74e
push ecx
push 0
call fcn.0059a3f0
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x340
ret 0x10
add esi, 0x140
push ecx
push esi
call fcn.0059a3f0
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x340
ret 0x10
cmp ebx, 1
mov byte [esp + 0x24c], 0
jne 0x59a786
mov ebp, dword [esp + 0x358]
jmp 0x59a818
mov edi, dword [esp + 0x358]
mov ebx, edi
mov ecx, edi
mov al, byte [edi]
test al, al
je 0x59a7aa
cmp al, 0x2f
je 0x59a79f
cmp al, 0x5c
jne 0x59a7a2
lea ebx, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x59a797
push 0x104
lea edx, [esp + 0x20]
push edi
push edx
call fcn.005a5ba1
add esp, 0xc
cmp ebx, edi
jne 0x59a82f
mov byte [esp + 0x1c], 0
lea ecx, [esp + 0x1c]
lea edi, [esi + 0x140]
push ebx
push ecx
push edi
lea edx, [esp + 0x258]
push 0x1168920
push edx
call fcn.005a4061
lea eax, [esp + 0x30]
push eax
push edi
call fcn.0059a3f0
add esp, 0x1c
mov ecx, dword [esp + 0x228]
push 0
push ecx
push 2
push 0
push 0
lea edx, [esp + 0x260]
push 0x40000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x59a883
pop edi
pop esi
pop ebp
mov eax, 0x200
pop ebx
add esp, 0x340
ret 0x10
mov eax, ebx
sub eax, edi
mov byte [esp + eax + 0x1c], 0
mov al, byte [esp + 0x1c]
cmp al, 0x2f
je 0x59a857
cmp al, 0x5c
je 0x59a857
test al, al
je 0x59a7c6
cmp byte [esp + 0x1d], 0x3a
jne 0x59a7c6
lea ecx, [esp + 0x1c]
push ebx
push ecx
lea edx, [esp + 0x254]
push 0x1168918
push edx
call fcn.005a4061
lea eax, [esp + 0x2c]
push eax
push 0
call fcn.0059a3f0
add esp, 0x18
jmp 0x59a7f3
mov eax, dword [esi + 0x138]
mov ecx, dword [esi]
push eax
push ecx
call fcn.005997e0
mov eax, dword [esi + 0x13c]
add esp, 8
test eax, eax
jne 0x59a8b2
push 0x4000
call fcn.005a4ad8
add esp, 4
mov dword [esi + 0x13c], eax
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], 0
mov eax, dword [esi + 0x13c]
mov ecx, dword [esi]
lea edx, [esp + 0x13]
push edx
push 0x4000
push eax
push ecx
call fcn.00599990
mov edi, eax
add esp, 0x10
cmp edi, 0xffffff96
je 0x59a90d
test edi, edi
jl 0x59a921
jle 0x59a8ff
mov eax, dword [esi + 0x13c]
lea edx, [esp + 0x18]
push 0
push edx
push edi
push eax
push ebp
call ebx
test eax, eax
je 0x59a917
mov al, byte [esp + 0x13]
test al, al
jne 0x59a929
test edi, edi
je 0x59a921
jmp 0x59a8c0
mov dword [esp + 0x14], 0x1000
jmp 0x59a929
mov dword [esp + 0x14], 0x400
jmp 0x59a929
mov dword [esp + 0x14], 0x5000000
mov ecx, dword [esi]
push ecx
call fcn.00599c50
mov esi, dword [esp + 0x18]
add esp, 4
test esi, esi
jne 0x59a95b
lea edx, [esp + 0x23c]
lea eax, [esp + 0x22c]
push edx
lea ecx, [esp + 0x238]
push eax
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [esp + 0x360], 1
je 0x59a96c
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x340
ret 0x10