Function at 0x10058ff0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x350
mov eax, dword [0x10189710]
xor eax, esp
mov dword [esp + 0x34c], eax
push ebx
push ebp
mov ebp, dword [esp + 0x35c]
push esi
push edi
mov edi, dword [esp + 0x36c]
mov esi, edx
mov ebx, ecx
mov dword [esp + 0x14], esi
cmp edi, 3
je 0x1005903f
cmp edi, 2
je 0x10059126
cmp edi, 1
je 0x10059126
mov eax, 0x10000
jmp 0x1005943a
mov eax, dword [ebp + 4]
cmp ebx, eax
je 0x100590b5
cmp eax, 0xffffffff
je 0x10059053
mov edi, dword [ebp]
call fcn.10058760
mov eax, dword [ebp]
mov dword [ebp + 4], 0xffffffff
cmp ebx, dword [eax + 4]
jge 0x10059035
cmp ebx, dword [eax + 0x10]
jge 0x10059080
mov esi, eax
call fcn.100580d0
test eax, eax
je 0x1005907c
mov eax, 0x700
jmp 0x1005943a
mov esi, dword [esp + 0x14]
mov eax, dword [ebp]
cmp dword [eax + 0x10], ebx
jge 0x100590a0
mov esi, dword [ebp]
call fcn.10058110
test eax, eax
jne 0x10059072
mov ecx, dword [ebp]
cmp dword [ecx + 0x10], ebx
jl 0x10059088
mov esi, dword [esp + 0x14]
mov edx, dword [ebp + 0x138]
mov eax, dword [ebp]
push edx
call fcn.10058360
add esp, 4
mov dword [ebp + 4], ebx
lea eax, [esp + 0x12]
push eax
mov eax, dword [ebp]
lea ecx, [esp + 0x17]
push ecx
mov ecx, dword [esp + 0x370]
push esi
mov byte [esp + 0x1e], 0
call fcn.100584e0
mov esi, eax
add esp, 0xc
test esi, esi
jl 0x100590e6
jne 0x100590f5
cmp byte [esp + 0x12], 0
jne 0x100590f5
mov edi, dword [ebp]
call fcn.10058760
mov dword [ebp + 4], 0xffffffff
cmp byte [esp + 0x13], 0
jne 0x10059248
test esi, esi
jle 0x1005910e
mov eax, 0x600
jmp 0x1005943a
mov eax, esi
sub eax, 0xffffff96
neg eax
sbb eax, eax
and eax, 0x4fff000
add eax, 0x1000
jmp 0x1005943a
cmp dword [ebp + 4], 0xffffffff
je 0x1005913b
mov edi, dword [ebp]
call fcn.10058760
mov edi, dword [esp + 0x36c]
mov eax, dword [ebp]
mov dword [ebp + 4], 0xffffffff
cmp ebx, dword [eax + 4]
jge 0x10059035
cmp ebx, dword [eax + 0x10]
jge 0x1005916d
mov esi, eax
call fcn.100580d0
test eax, eax
jne 0x10059072
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x36c]
mov edx, dword [ebp]
cmp dword [edx + 0x10], ebx
jge 0x100591e5
mov esi, dword [ebp]
test esi, esi
je 0x10059072
cmp dword [esi + 0x18], 0
je 0x10059072
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x10059072
mov ecx, dword [esi + 0x50]
add ecx, dword [esi + 0x4c]
mov edx, dword [esi + 0x48]
push 0
lea ecx, [ecx + edx + 0x2e]
add dword [esi + 0x14], ecx
mov dword [esi + 0x10], eax
push 0
lea edx, [esi + 0x78]
push edx
lea eax, [esi + 0x28]
push eax
mov eax, esi
call fcn.10057e30
xor ecx, ecx
add esp, 0x10
test eax, eax
sete cl
mov dword [esi + 0x18], ecx
test eax, eax
jne 0x10059072
mov edx, dword [ebp]
cmp dword [edx + 0x10], ebx
jl 0x10059175
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x36c]
lea eax, [esp + 0x14]
push eax
push ebx
lea edx, [esp + 0x20]
mov ecx, ebp
mov dword [esp + 0x1c], 0
call fcn.100588a0
mov ecx, dword [esp + 0x120]
shr ecx, 4
test cl, 1
je 0x1005924f
cmp edi, 1
je 0x10059248
mov al, byte [esi]
cmp al, 0x2f
je 0x10059226
cmp al, 0x5c
je 0x10059226
test al, al
je 0x10059238
cmp byte [esi + 1], 0x3a
jne 0x10059238
push esi
push 0
call fcn.10058e80
add esp, 8
xor eax, eax
jmp 0x1005943a
push esi
add ebp, 0x140
push ebp
call fcn.10058e80
add esp, 8
xor eax, eax
jmp 0x1005943a
mov byte [esp + 0x250], 0
cmp edi, 1
jne 0x10059263
mov ebx, esi
jmp 0x10059300
mov al, byte [esi]
mov edi, esi
mov ecx, esi
test al, al
je 0x10059283
lea ecx, [ecx]
cmp al, 0x2f
je 0x10059278
cmp al, 0x5c
jne 0x1005927b
lea edi, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x10059270
push 0x104
lea edx, [esp + 0x14c]
push esi
push edx
call fcn.10129e6f
add esp, 0xc
cmp edi, esi
jne 0x1005930f
mov byte [esp + 0x148], 0
push edi
lea ecx, [esp + 0x14c]
push ecx
lea esi, [ebp + 0x140]
push esi
lea edx, [esp + 0x25c]
push 0x1015b05c
push edx
call fcn.10127dc0
add esp, 0x14
lea eax, [esp + 0x148]
push eax
push esi
call fcn.10058e80
add esp, 8
mov ecx, dword [esp + 0x120]
push 0
push ecx
push 2
push 0
push 0
push 0x40000000
lea edx, [esp + 0x268]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x10059372
mov eax, 0x200
jmp 0x1005943a
mov eax, edi
sub eax, esi
mov byte [esp + eax + 0x148], 0
mov al, byte [esp + 0x148]
cmp al, 0x2f
je 0x10059340
cmp al, 0x5c
je 0x10059340
test al, al
je 0x100592a5
cmp byte [esp + 0x149], 0x3a
jne 0x100592a5
push edi
lea ecx, [esp + 0x14c]
push ecx
lea edx, [esp + 0x258]
push 0x10158210
push edx
call fcn.10127dc0
lea eax, [esp + 0x158]
push eax
push 0
call fcn.10058e80
add esp, 0x18
jmp 0x100592db
mov eax, dword [ebp + 0x138]
push eax
mov eax, dword [ebp]
call fcn.10058360
add esp, 4
cmp dword [ebp + 0x13c], 0
jne 0x100593a0
push 0x4000
call fcn.101264a0
add esp, 4
mov dword [ebp + 0x13c], eax
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp + 0x13c]
lea ecx, [esp + 0x13]
push ecx
lea edx, [esp + 0x16]
push edx
push eax
mov eax, dword [ebp]
mov ecx, 0x4000
mov byte [esp + 0x1f], 0
call fcn.100584e0
mov esi, eax
add esp, 0xc
cmp esi, 0xffffff96
je 0x100593fa
test esi, esi
jl 0x100593fa
jle 0x100593ef
mov edx, dword [ebp + 0x13c]
push 0
lea ecx, [esp + 0x18]
push ecx
push esi
push edx
push ebx
call edi
test eax, eax
je 0x100593fa
cmp byte [esp + 0x12], 0
jne 0x100593fa
test esi, esi
jne 0x100593a6
mov edi, dword [ebp]
call fcn.10058760
mov esi, eax
test esi, esi
jne 0x10059427
lea eax, [esp + 0x134]
push eax
lea ecx, [esp + 0x128]
push ecx
lea edx, [esp + 0x134]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [esp + 0x36c], 1
je 0x10059438
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
mov ecx, dword [esp + 0x35c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.10127db1
add esp, 0x350
ret 0xc