Function at 0x10003870
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x10037158
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x10045c94]
xor eax, esp
mov dword [esp + 0x38], eax
push ebx
push esi
push edi
mov eax, dword [0x10045c94]
xor eax, esp
push eax
lea eax, [esp + 0x50]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
mov edx, ecx
mov dword [esp + 0x14], edx
cmp ebx, 0xffffffff
jne 0x100038bc
xor eax, eax
jmp 0x10003bf7
mov eax, dword [edx + 0x24]
mov ecx, dword [eax]
test ecx, ecx
je 0x100038e5
mov eax, dword [edx + 0x34]
mov esi, dword [eax]
add esi, ecx
cmp ecx, esi
jae 0x100038e5
dec dword [eax]
mov eax, dword [edx + 0x24]
mov ecx, dword [eax]
lea edx, [ecx + 1]
mov dword [eax], edx
mov byte [ecx], bl
mov eax, ebx
jmp 0x10003bf7
mov eax, dword [edx + 0x4c]
test eax, eax
je 0x10003bf4
cmp dword [edx + 0x3c], 0
jne 0x10003913
push eax
movsx eax, bl
push eax
call fcn.1001f241
add esp, 8
cmp eax, 0xffffffff
je 0x10003bf4
mov eax, ebx
jmp 0x10003bf7
mov ecx, 0xf
xor eax, eax
mov byte [esp + 0x30], 0
mov byte [esp + 0x13], bl
mov dword [esp + 0x44], ecx
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x40], 8
cmp ecx, 0x10
jae 0x10003940
lea eax, [esp + 0x30]
mov byte [eax + 8], 0
mov dword [esp + 0x58], 0
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x44]
cmp edx, 0x10
jb 0x10003b19
mov ebx, ecx
mov dword [esp + 0x18], ebx
test ecx, ecx
je 0x1000398b
mov eax, ecx
cmp edx, 0x10
jae 0x10003972
lea eax, [esp + 0x30]
cmp eax, ebx
ja 0x1000398b
mov eax, ecx
cmp edx, 0x10
jae 0x10003981
lea eax, [esp + 0x30]
mov esi, dword [esp + 0x40]
add eax, esi
cmp ebx, eax
jbe 0x10003998
call fcn.1001f12d
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0x2c]
cmp eax, 0xfffffffc
je 0x100039c3
mov eax, ecx
cmp edx, 0x10
jae 0x100039ac
lea eax, [esp + 0x30]
mov esi, dword [esp + 0x40]
add eax, esi
cmp ebx, eax
jb 0x100039c3
call fcn.1001f12d
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x30]
mov edi, dword [esp + 0x40]
cmp edx, 0x10
jb 0x10003b26
mov esi, ecx
test ecx, ecx
je 0x100039fe
mov eax, ecx
cmp edx, 0x10
jae 0x100039e1
lea eax, [esp + 0x30]
cmp eax, esi
ja 0x100039fe
mov eax, ecx
cmp edx, 0x10
jae 0x100039f0
lea eax, [esp + 0x30]
mov ebx, dword [esp + 0x40]
add eax, ebx
mov ebx, dword [esp + 0x18]
cmp esi, eax
jbe 0x10003a0b
call fcn.1001f12d
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0x2c]
cmp eax, 0xfffffffc
je 0x10003a2e
mov eax, ecx
cmp edx, 0x10
jae 0x10003a1f
lea eax, [esp + 0x30]
mov ecx, dword [esp + 0x40]
add eax, ecx
cmp esi, eax
jb 0x10003a2e
call fcn.1001f12d
mov edx, dword [esp + 0x14]
mov ecx, dword [edx + 0x3c]
mov edx, dword [ecx]
mov edx, dword [edx + 0x14]
lea eax, [esp + 0x1c]
push eax
add ebx, edi
push ebx
push esi
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x27]
push eax
mov eax, dword [esp + 0x2c]
add eax, 0x44
push eax
call edx
test eax, eax
jl 0x10003beb
cmp eax, 1
jg 0x10003ba4
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x30]
cmp edx, 0x10
jb 0x10003b2f
mov esi, ecx
test ecx, ecx
je 0x10003aa8
mov eax, ecx
cmp edx, 0x10
jae 0x10003a8f
lea eax, [esp + 0x30]
cmp eax, esi
ja 0x10003aa8
mov eax, ecx
cmp edx, 0x10
jae 0x10003a9e
lea eax, [esp + 0x30]
mov edi, dword [esp + 0x40]
add eax, edi
cmp esi, eax
jbe 0x10003ab5
call fcn.1001f12d
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0x2c]
cmp eax, 0xfffffffc
je 0x10003ae0
mov eax, ecx
cmp edx, 0x10
jae 0x10003ac9
lea eax, [esp + 0x30]
mov edi, dword [esp + 0x40]
add eax, edi
cmp esi, eax
jb 0x10003ae0
call fcn.1001f12d
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x30]
mov edi, dword [esp + 0x1c]
sub edi, esi
je 0x10003b71
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x30]
call fcn.10004970
mov esi, eax
mov eax, dword [esi]
cmp eax, 0xfffffffc
je 0x10003b4a
test eax, eax
jne 0x10003b0c
call fcn.1001f12d
mov eax, dword [esi]
cmp dword [eax + 0x18], 0x10
jb 0x10003b38
mov ecx, dword [eax + 4]
jmp 0x10003b3b
lea ebx, [esp + 0x30]
mov dword [esp + 0x18], ebx
jmp 0x10003967
lea esi, [esp + 0x30]
jmp 0x100039d6
lea esi, [esp + 0x30]
jmp 0x10003a84
lea ecx, [eax + 4]
mov edx, dword [eax + 0x14]
add edx, ecx
cmp dword [esi + 4], edx
jb 0x10003b4a
call fcn.1001f12d
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 0x4c]
mov esi, dword [esi + 4]
push ecx
push edi
push 1
push esi
call fcn.1001fa57
add esp, 0x10
cmp edi, eax
jne 0x10003beb
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x14]
mov byte [eax + 0x41], 1
lea eax, [esp + 0x13]
cmp dword [esp + 0x20], eax
jne 0x10003bdd
test edi, edi
ja 0x10003954
cmp dword [esp + 0x40], 0x20
lea ecx, [esp + 0x2c]
jae 0x10003bef
push 0
push 8
call fcn.10004720
jmp 0x1000394c
cmp eax, 3
jne 0x10003beb
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x4c]
mov cl, byte [esp + 0x13]
call fcn.100022f0
test al, al
je 0x10003bcd
mov esi, dword [ebp + 8]
lea ecx, [esp + 0x2c]
call fcn.10003260
mov eax, esi
jmp 0x10003bf7
lea ecx, [esp + 0x2c]
or esi, 0xffffffff
call fcn.10003260
mov eax, esi
jmp 0x10003bf7
lea ecx, [esp + 0x2c]
call fcn.10003260
mov eax, dword [ebp + 8]
jmp 0x10003bf7
lea ecx, [esp + 0x2c]
call fcn.10003260
or eax, 0xffffffff
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x38]
xor ecx, esp
call fcn.1001ec96
mov esp, ebp
pop ebp
ret 4