Function at 0x10030810
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x350
mov eax, dword [0x1017455c]
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 0x1003085f
cmp edi, 2
je 0x10030946
cmp edi, 1
je 0x10030946
mov eax, 0x10000
jmp 0x10030c5a
mov eax, dword [ebp + 4]
cmp ebx, eax
je 0x100308d5
cmp eax, 0xffffffff
je 0x10030873
mov edi, dword [ebp]
call fcn.1002ff80
mov eax, dword [ebp]
mov dword [ebp + 4], 0xffffffff
cmp ebx, dword [eax + 4]
jge 0x10030855
cmp ebx, dword [eax + 0x10]
jge 0x100308a0
mov esi, eax
call fcn.1002f8f0
test eax, eax
je 0x1003089c
mov eax, 0x700
jmp 0x10030c5a
mov esi, dword [esp + 0x14]
mov eax, dword [ebp]
cmp dword [eax + 0x10], ebx
jge 0x100308c0
mov esi, dword [ebp]
call fcn.1002f930
test eax, eax
jne 0x10030892
mov ecx, dword [ebp]
cmp dword [ecx + 0x10], ebx
jl 0x100308a8
mov esi, dword [esp + 0x14]
mov edx, dword [ebp + 0x138]
mov eax, dword [ebp]
push edx
call fcn.1002fb80
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.1002fd00
mov esi, eax
add esp, 0xc
test esi, esi
jl 0x10030906
jne 0x10030915
cmp byte [esp + 0x12], 0
jne 0x10030915
mov edi, dword [ebp]
call fcn.1002ff80
mov dword [ebp + 4], 0xffffffff
cmp byte [esp + 0x13], 0
jne 0x10030a68
test esi, esi
jle 0x1003092e
mov eax, 0x600
jmp 0x10030c5a
mov eax, esi
sub eax, 0xffffff96
neg eax
sbb eax, eax
and eax, 0x4fff000
add eax, 0x1000
jmp 0x10030c5a
cmp dword [ebp + 4], 0xffffffff
je 0x1003095b
mov edi, dword [ebp]
call fcn.1002ff80
mov edi, dword [esp + 0x36c]
mov eax, dword [ebp]
mov dword [ebp + 4], 0xffffffff
cmp ebx, dword [eax + 4]
jge 0x10030855
cmp ebx, dword [eax + 0x10]
jge 0x1003098d
mov esi, eax
call fcn.1002f8f0
test eax, eax
jne 0x10030892
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x36c]
mov edx, dword [ebp]
cmp dword [edx + 0x10], ebx
jge 0x10030a05
mov esi, dword [ebp]
test esi, esi
je 0x10030892
cmp dword [esi + 0x18], 0
je 0x10030892
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x10030892
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.1002f650
xor ecx, ecx
add esp, 0x10
test eax, eax
sete cl
mov dword [esi + 0x18], ecx
test eax, eax
jne 0x10030892
mov edx, dword [ebp]
cmp dword [edx + 0x10], ebx
jl 0x10030995
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.100300c0
mov ecx, dword [esp + 0x120]
shr ecx, 4
test cl, 1
je 0x10030a6f
cmp edi, 1
je 0x10030a68
mov al, byte [esi]
cmp al, 0x2f
je 0x10030a46
cmp al, 0x5c
je 0x10030a46
test al, al
je 0x10030a58
cmp byte [esi + 1], 0x3a
jne 0x10030a58
push esi
push 0
call fcn.100306a0
add esp, 8
xor eax, eax
jmp 0x10030c5a
push esi
add ebp, 0x140
push ebp
call fcn.100306a0
add esp, 8
xor eax, eax
jmp 0x10030c5a
mov byte [esp + 0x250], 0
cmp edi, 1
jne 0x10030a83
mov ebx, esi
jmp 0x10030b20
mov al, byte [esi]
mov edi, esi
mov ecx, esi
test al, al
je 0x10030aa3
lea ecx, [ecx]
cmp al, 0x2f
je 0x10030a98
cmp al, 0x5c
jne 0x10030a9b
lea edi, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x10030a90
push 0x104
lea edx, [esp + 0x14c]
push esi
push edx
call fcn.1010ffa3
add esp, 0xc
cmp edi, esi
jne 0x10030b2f
mov byte [esp + 0x148], 0
push edi
lea ecx, [esp + 0x14c]
push ecx
lea esi, [ebp + 0x140]
push esi
lea edx, [esp + 0x25c]
push str._s_s_s
push edx
call fcn.1010d6a8
add esp, 0x14
lea eax, [esp + 0x148]
push eax
push esi
call fcn.100306a0
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 0x10030b92
mov eax, 0x200
jmp 0x10030c5a
mov eax, edi
sub eax, esi
mov byte [esp + eax + 0x148], 0
mov al, byte [esp + 0x148]
cmp al, 0x2f
je 0x10030b60
cmp al, 0x5c
je 0x10030b60
test al, al
je 0x10030ac5
cmp byte [esp + 0x149], 0x3a
jne 0x10030ac5
push edi
lea ecx, [esp + 0x14c]
push ecx
lea edx, [esp + 0x258]
push 0x1014a0c0
push edx
call fcn.1010d6a8
lea eax, [esp + 0x158]
push eax
push 0
call fcn.100306a0
add esp, 0x18
jmp 0x10030afb
mov eax, dword [ebp + 0x138]
push eax
mov eax, dword [ebp]
call fcn.1002fb80
add esp, 4
cmp dword [ebp + 0x13c], 0
jne 0x10030bc0
push 0x4000
call fcn.1010ccc2
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.1002fd00
mov esi, eax
add esp, 0xc
cmp esi, 0xffffff96
je 0x10030c1a
test esi, esi
jl 0x10030c1a
jle 0x10030c0f
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 0x10030c1a
cmp byte [esp + 0x12], 0
jne 0x10030c1a
test esi, esi
jne 0x10030bc6
mov edi, dword [ebp]
call fcn.1002ff80
mov esi, eax
test esi, esi
jne 0x10030c47
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 0x10030c58
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.1010d699
add esp, 0x350
ret 0xc