Function at 0x13018490
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x1303fd28
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x1304c080]
xor eax, esp
mov dword [esp + 0x2c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x1304c080]
xor eax, esp
push eax
lea eax, [esp + 0x44]
mov dword fs:[0], eax
mov esi, dword [esp + 0x54]
cmp si, 0xffff
mov edx, ecx
mov dword [esp + 0x18], edx
jne 0x130184db
xor ax, ax
jmp 0x13018854
mov eax, dword [edx + 0x24]
mov ecx, dword [eax]
xor edi, edi
cmp ecx, edi
je 0x1301850a
mov eax, dword [edx + 0x34]
mov ebx, dword [eax]
lea ebx, [ecx + ebx*2]
cmp ecx, ebx
jae 0x1301850a
add dword [eax], 0xffffffff
mov eax, dword [edx + 0x24]
mov ecx, dword [eax]
lea edx, [ecx + 2]
mov dword [eax], edx
mov word [ecx], si
mov ax, si
jmp 0x13018854
mov eax, dword [edx + 0x4c]
cmp eax, edi
je 0x13018850
cmp dword [edx + 0x3c], edi
jne 0x1301853b
push eax
push esi
call fcn.13028e78
add esp, 8
cmp ax, 0xffff
movzx eax, si
jne 0x13018854
mov eax, 0xffff
jmp 0x13018854
movzx eax, si
mov ecx, 0xf
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x14], eax
xor eax, eax
cmp ecx, 0x10
mov byte [esp + 0x28], 0
mov dword [esp + 0x28], eax
mov dword [esp + 0x38], edi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x38], 8
jae 0x1301856f
lea eax, [esp + 0x28]
mov byte [eax + 8], 0
mov dword [esp + 0x4c], edi
mov eax, dword [esp + 0x28]
mov ebx, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
cmp edx, 0x10
jb 0x130187c9
test eax, eax
mov ebp, eax
je 0x130185b2
cmp edx, 0x10
mov ecx, eax
jae 0x1301859d
lea ecx, [esp + 0x28]
cmp ecx, ebp
ja 0x130185b2
cmp edx, 0x10
mov ecx, eax
jae 0x130185ac
lea ecx, [esp + 0x28]
add ecx, ebx
cmp ebp, ecx
jbe 0x130185c3
call fcn.13027af1
mov edx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x24]
cmp ecx, 0xfffffffe
je 0x130185ee
cmp edx, 0x10
mov ecx, eax
jae 0x130185d7
lea ecx, [esp + 0x28]
add ecx, ebx
cmp ebp, ecx
jb 0x130185ee
call fcn.13027af1
mov edx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
cmp edx, 0x10
mov edi, ebx
jb 0x130187d2
test eax, eax
mov esi, eax
je 0x1301861f
cmp edx, 0x10
mov ecx, eax
jae 0x1301860a
lea ecx, [esp + 0x28]
cmp ecx, esi
ja 0x1301861f
cmp edx, 0x10
mov ecx, eax
jae 0x13018619
lea ecx, [esp + 0x28]
add ecx, ebx
cmp esi, ecx
jbe 0x13018630
call fcn.13027af1
mov edx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x24]
cmp ecx, 0xfffffffe
je 0x1301864d
cmp edx, 0x10
jae 0x13018642
lea eax, [esp + 0x28]
add eax, ebx
cmp esi, eax
jb 0x1301864d
call fcn.13027af1
mov ebx, dword [esp + 0x18]
mov ecx, dword [ebx + 0x3c]
mov edx, dword [ecx]
mov edx, dword [edx + 0x14]
lea eax, [esp + 0x1c]
push eax
add ebp, edi
push ebp
push esi
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x26]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [ebx + 0x44]
push eax
call edx
test eax, eax
jl 0x1301883f
cmp eax, 1
jg 0x130187ed
mov edx, dword [esp + 0x3c]
cmp edx, 0x10
mov eax, dword [esp + 0x28]
jb 0x130187db
test eax, eax
mov esi, eax
je 0x130186c3
cmp edx, 0x10
mov ecx, eax
jae 0x130186aa
lea ecx, [esp + 0x28]
cmp ecx, esi
ja 0x130186c3
cmp edx, 0x10
mov ecx, eax
jae 0x130186b9
lea ecx, [esp + 0x28]
mov ebx, dword [esp + 0x38]
add ecx, ebx
cmp esi, ecx
jbe 0x130186d4
call fcn.13027af1
mov edx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x24]
cmp ecx, 0xfffffffe
je 0x130186ff
cmp edx, 0x10
mov ecx, eax
jae 0x130186e8
lea ecx, [esp + 0x28]
add ecx, ebx
cmp esi, ecx
jb 0x130186ff
call fcn.13027af1
mov edx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x1c]
sub edi, esi
je 0x13018790
cmp edx, 0x10
jb 0x130187e4
test eax, eax
mov esi, eax
je 0x1301873a
cmp edx, 0x10
mov ecx, eax
jae 0x13018725
lea ecx, [esp + 0x28]
cmp ecx, esi
ja 0x1301873a
cmp edx, 0x10
mov ecx, eax
jae 0x13018734
lea ecx, [esp + 0x28]
add ecx, ebx
cmp esi, ecx
jbe 0x1301874b
call fcn.13027af1
mov edx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x24]
cmp ecx, 0xfffffffe
je 0x13018768
cmp edx, 0x10
jae 0x1301875d
lea eax, [esp + 0x28]
add eax, ebx
cmp esi, eax
jb 0x13018768
call fcn.13027af1
mov edx, dword [esp + 0x18]
mov eax, dword [edx + 0x4c]
push eax
push edi
push 1
push esi
call fcn.13029636
add esp, 0x10
cmp edi, eax
jne 0x1301883f
mov edx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x18]
mov byte [ecx + 0x42], 1
lea ecx, [esp + 0x14]
cmp dword [esp + 0x20], ecx
jne 0x13018827
test edi, edi
ja 0x13018583
cmp ebx, 0x20
jae 0x1301883f
push 0
push 8
lea ecx, [esp + 0x2c]
call fcn.13006660
jmp 0x13018577
lea ebp, [esp + 0x28]
jmp 0x13018592
lea esi, [esp + 0x28]
jmp 0x130185ff
lea esi, [esp + 0x28]
jmp 0x1301869f
lea esi, [esp + 0x28]
jmp 0x1301871a
cmp eax, 3
jne 0x1301883f
mov edx, dword [ebx + 0x4c]
mov eax, dword [esp + 0x14]
push edx
push eax
call fcn.13017a30
movzx esi, word [esp + 0x5c]
add esp, 8
test al, al
jne 0x13018811
mov esi, 0xffff
mov dword [esp + 0x4c], 0xffffffff
lea ecx, [esp + 0x24]
call fcn.13004730
mov ax, si
jmp 0x13018854
mov dword [esp + 0x4c], 0xffffffff
lea ecx, [esp + 0x24]
call fcn.13004730
mov ax, word [esp + 0x54]
jmp 0x13018854
mov dword [esp + 0x4c], 0xffffffff
lea ecx, [esp + 0x24]
call fcn.13004730
or ax, 0xffff
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.1302732a
add esp, 0x3c
ret 4