Function at 0x10047ca0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x100b6e38
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x100e01f0]
xor eax, esp
mov dword [esp + 0x38], eax
push ebx
push esi
push edi
mov eax, dword [0x100e01f0]
xor eax, esp
push eax
lea eax, [esp + 0x50]
mov dword fs:[0], eax
mov ebx, ecx
mov ecx, dword [ebp + 8]
cmp ecx, 0xffffffff
jne 0x10047ce8
xor eax, eax
jmp 0x10047f68
mov eax, dword [ebx + 0x20]
mov edx, dword [eax]
test edx, edx
je 0x10047d16
mov esi, dword [ebx + 0x30]
mov edi, dword [esi]
lea eax, [edi + edx]
cmp edx, eax
jae 0x10047d16
lea eax, [edi - 1]
mov dword [esi], eax
mov ecx, dword [ebx + 0x20]
mov edx, dword [ecx]
lea eax, [edx + 1]
mov dword [ecx], eax
mov eax, dword [ebp + 8]
mov byte [edx], al
jmp 0x10047f68
cmp dword [ebx + 0x50], 0
jne 0x10047d24
or eax, 0xffffffff
jmp 0x10047f68
mov edx, dword [ebx + 0xc]
lea eax, [ebx + 0x44]
cmp dword [edx], eax
jne 0x10047d45
mov eax, dword [ebx + 0x38]
mov ecx, dword [ebx + 0x3c]
mov dword [edx], eax
mov eax, dword [ebx + 0x1c]
mov dword [eax], ecx
mov eax, dword [ebx + 0x2c]
sub ecx, ecx
mov dword [eax], ecx
mov ecx, dword [ebp + 8]
cmp dword [ebx + 0x40], 0
jne 0x10047d6a
push dword [ebx + 0x50]
movsx eax, cl
push eax
call fcn.1007f84a
or ecx, 0xffffffff
add esp, 8
cmp eax, ecx
cmovne ecx, dword [ebp + 8]
mov eax, ecx
jmp 0x10047f68
mov byte [esp + 0x16], cl
lea ecx, [esp + 0x17]
call fcn.10003ad0
push eax
lea ecx, [esp + 0x34]
call fcn.10003210
push 0
push 0
lea ecx, [esp + 0x38]
call fcn.10003b00
push 0
push 8
lea ecx, [esp + 0x38]
call fcn.10003b90
test al, al
je 0x10047db9
push 0
push 8
push 0
lea ecx, [esp + 0x3c]
call fcn.1003dc20
push 8
lea ecx, [esp + 0x34]
call fcn.10003cd0
lea ecx, [esp + 0x30]
mov dword [esp + 0x58], 0
call fcn.10003ca0
lea ecx, [esp + 0x30]
push ecx
push eax
lea ecx, [esp + 0x20]
call fcn.1003dd10
lea ecx, [esp + 0x18]
call fcn.1003aa00
lea ecx, [esp + 0x30]
mov edi, eax
call fcn.10003ca0
lea ecx, [esp + 0x30]
push ecx
push eax
lea ecx, [esp + 0x24]
call fcn.1003dd10
lea ecx, [esp + 0x1c]
call fcn.1003aa00
lea ecx, [esp + 0x30]
mov esi, eax
call fcn.100032c0
mov ecx, dword [ebx + 0x40]
lea edx, [eax + edi]
mov eax, dword [ecx]
lea ecx, [esp + 0x20]
push ecx
push edx
push esi
lea ecx, [esp + 0x30]
push ecx
lea ecx, [esp + 0x27]
push ecx
lea ecx, [esp + 0x2a]
push ecx
mov ecx, dword [ebx + 0x40]
lea edi, [ebx + 0x48]
push edi
call dword [eax + 0x1c]
test eax, eax
js 0x10047f5a
cmp eax, 1
jg 0x10047f8d
lea ecx, [esp + 0x30]
call fcn.10003ca0
lea ecx, [esp + 0x30]
push ecx
push eax
lea ecx, [esp + 0x30]
call fcn.1003dd10
lea ecx, [esp + 0x28]
call fcn.1003aa00
mov esi, dword [esp + 0x20]
sub esi, eax
je 0x10047eaa
lea ecx, [esp + 0x30]
call fcn.10003ca0
lea ecx, [esp + 0x30]
push ecx
push eax
lea ecx, [esp + 0x34]
call fcn.1003dd10
lea ecx, [esp + 0x2c]
call fcn.1003aa00
push dword [ebx + 0x50]
push esi
push 1
push eax
call fcn.1007ced5
add esp, 0x10
cmp esi, eax
jne 0x10047f5a
lea eax, [esp + 0x16]
mov byte [ebx + 0x45], 1
cmp dword [esp + 0x24], eax
jne 0x10047f88
test esi, esi
jne 0x10047ede
lea ecx, [esp + 0x30]
call fcn.100032c0
cmp eax, 0x20
jae 0x10047f5a
push esi
push 8
lea ecx, [esp + 0x38]
call fcn.1003b500
lea ecx, [esp + 0x30]
call fcn.10003ca0
lea ecx, [esp + 0x30]
push ecx
push eax
lea ecx, [esp + 0x20]
call fcn.1003dd10
lea ecx, [esp + 0x18]
call fcn.1003aa00
lea ecx, [esp + 0x30]
mov edi, eax
call fcn.10003ca0
lea ecx, [esp + 0x30]
push ecx
push eax
lea ecx, [esp + 0x24]
call fcn.1003dd10
lea ecx, [esp + 0x1c]
call fcn.1003aa00
lea ecx, [esp + 0x30]
mov esi, eax
call fcn.100032c0
mov ecx, dword [ebx + 0x40]
lea edx, [eax + edi]
mov eax, dword [ecx]
lea edi, [esp + 0x20]
push edi
push edx
push esi
lea edx, [esp + 0x30]
push edx
lea edx, [esp + 0x27]
push edx
lea edx, [esp + 0x2a]
push edx
lea edx, [ebx + 0x48]
push edx
call dword [eax + 0x1c]
test eax, eax
jns 0x10047e40
or ebx, 0xffffffff
lea ecx, [esp + 0x30]
call fcn.100031c0
mov eax, ebx
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.1007ab33
mov esp, ebp
pop ebp
ret 4
mov ebx, dword [ebp + 8]
jmp 0x10047f5d
cmp eax, 3
jne 0x10047f5a
mov edx, dword [ebx + 0x50]
mov cl, byte [esp + 0x16]
call fcn.10049b20
or ecx, 0xffffffff
test al, al
cmovne ecx, dword [ebp + 8]
mov ebx, ecx
jmp 0x10047f5d