Function at 0x40d350
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x47b9f8
mov eax, dword fs:[0]
push eax
sub esp, 0x50
mov eax, dword [0x49d7a0]
xor eax, esp
mov dword [esp + 0x48], eax
push ebx
push esi
push edi
mov eax, dword [0x49d7a0]
xor eax, esp
push eax
lea eax, [esp + 0x60]
mov dword fs:[0], eax
mov ebx, ecx
cmp dword [ebx + 0x3c], 0
mov dword [esp + 0x38], ebx
je 0x40d642
cmp byte [ebx + 0x41], 0
je 0x40d642
mov eax, dword [ebx]
mov edx, dword [eax + 4]
push 0xffffffffffffffff
call edx
cmp eax, 0xffffffff
je 0x40d635
lea esi, [esp + 0x3c]
call fcn.0040cdb0
mov dword [esp + 0x68], 0
lea ecx, [esp + 0x3c]
call fcn.004025e0
lea ecx, [esp + 0x14]
mov esi, eax
call fcn.004076e0
test esi, esi
je 0x40d3fa
lea ecx, [esp + 0x3c]
call fcn.004025e0
cmp eax, esi
ja 0x40d3fa
lea ecx, [esp + 0x3c]
call fcn.004025e0
add eax, dword [esp + 0x50]
cmp esi, eax
jbe 0x40d3ff
call fcn.0043c2d0
lea eax, [esp + 0x3c]
mov ecx, eax
cmp ecx, 0xfffffffe
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], esi
je 0x40d429
call fcn.004025e0
mov edx, dword [esp + 0x14]
add eax, dword [edx + 0x14]
cmp dword [esp + 0x18], eax
jb 0x40d429
call fcn.0043c2d0
mov edi, dword [esp + 0x18]
lea ecx, [esp + 0x3c]
call fcn.004025e0
lea ecx, [esp + 0x1c]
mov esi, eax
call fcn.004076e0
test esi, esi
je 0x40d463
lea ecx, [esp + 0x3c]
call fcn.004025e0
cmp eax, esi
ja 0x40d463
lea ecx, [esp + 0x3c]
call fcn.004025e0
add eax, dword [esp + 0x50]
cmp esi, eax
jbe 0x40d468
call fcn.0043c2d0
lea eax, [esp + 0x3c]
mov ecx, eax
cmp ecx, 0xfffffffe
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], esi
je 0x40d492
call fcn.004025e0
mov edx, dword [esp + 0x1c]
add eax, dword [edx + 0x14]
cmp dword [esp + 0x20], eax
jb 0x40d492
call fcn.0043c2d0
mov esi, dword [esp + 0x20]
lea ecx, [esp + 0x3c]
call fcn.004024e0
mov ecx, dword [ebx + 0x3c]
mov edx, dword [ecx]
add eax, edi
lea edi, [esp + 0x34]
push edi
push eax
push esi
lea eax, [ebx + 0x44]
push eax
mov eax, dword [edx + 0x18]
call eax
sub eax, 0
je 0x40d4d2
sub eax, 1
je 0x40d4d6
sub eax, 2
lea ecx, [esp + 0x3c]
jne 0x40d630
jmp 0x40d63d
mov byte [ebx + 0x41], 0
lea ecx, [esp + 0x3c]
call fcn.004025e0
lea ecx, [esp + 0x24]
mov esi, eax
call fcn.004076e0
test esi, esi
je 0x40d50c
lea ecx, [esp + 0x3c]
call fcn.004025e0
cmp eax, esi
ja 0x40d50c
lea ecx, [esp + 0x3c]
call fcn.004025e0
add eax, dword [esp + 0x50]
cmp esi, eax
jbe 0x40d511
call fcn.0043c2d0
lea ecx, [esp + 0x3c]
mov edx, ecx
cmp edx, 0xfffffffe
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], esi
je 0x40d53b
call fcn.004025e0
mov ecx, dword [esp + 0x24]
add eax, dword [ecx + 0x14]
cmp dword [esp + 0x28], eax
jb 0x40d53b
call fcn.0043c2d0
mov esi, dword [esp + 0x34]
sub esi, dword [esp + 0x28]
je 0x40d5c4
lea ecx, [esp + 0x3c]
call fcn.004025e0
lea ecx, [esp + 0x2c]
mov edi, eax
call fcn.004076e0
test edi, edi
je 0x40d57b
lea ecx, [esp + 0x3c]
call fcn.004025e0
cmp eax, edi
ja 0x40d57b
lea ecx, [esp + 0x3c]
call fcn.004025e0
add eax, dword [esp + 0x50]
cmp edi, eax
jbe 0x40d580
call fcn.0043c2d0
lea edx, [esp + 0x3c]
mov eax, edx
cmp eax, 0xfffffffe
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edi
je 0x40d5ac
mov ecx, edx
call fcn.004025e0
mov ecx, dword [esp + 0x2c]
add eax, dword [ecx + 0x14]
cmp dword [esp + 0x30], eax
jb 0x40d5ac
call fcn.0043c2d0
mov edx, dword [ebx + 0x4c]
mov eax, dword [esp + 0x30]
push edx
push esi
push 1
push eax
call fcn.0043f8bc
add esp, 0x10
cmp esi, eax
jne 0x40d62c
cmp byte [ebx + 0x41], 0
je 0x40d639
test esi, esi
jne 0x40d3c4
or ecx, 0xffffffff
sub ecx, dword [esp + 0x50]
cmp ecx, 8
ja 0x40d5e3
call fcn.00458fd4
mov edi, dword [esp + 0x50]
push 0
add edi, 8
push edi
lea ecx, [esp + 0x44]
call fcn.00402540
test al, al
je 0x40d3c4
mov ebx, dword [esp + 0x50]
lea ecx, [esp + 0x3c]
mov byte [esp + 0x10], 0
xor esi, esi
call fcn.004025e0
add eax, ebx
mov dword [eax], esi
push edi
lea ecx, [esp + 0x40]
mov dword [eax + 4], esi
call fcn.00402500
mov ebx, dword [esp + 0x38]
jmp 0x40d3c4
lea ecx, [esp + 0x3c]
call fcn.00402010
xor al, al
jmp 0x40d644
lea ecx, [esp + 0x3c]
call fcn.00402010
mov al, 1
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0043bd9a
mov esp, ebp
pop ebp
ret