Function at 0x10065e7
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x10]
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, esi
sub edi, dword [ecx + 0xc]
add esi, 0xfffffffc
shr edi, 0xf
mov ecx, edi
imul ecx, ecx, 0x204
lea ecx, [ecx + eax + 0x144]
mov dword [ebp - 0x10], ecx
mov ecx, dword [esi]
dec ecx
test cl, 1
mov dword [ebp - 4], ecx
jne 0x1006736
push ebx
lea ebx, [ecx + esi]
mov edx, dword [ebx]
mov dword [ebp - 0xc], edx
mov edx, dword [esi - 4]
mov dword [ebp - 8], edx
mov edx, dword [ebp - 0xc]
test dl, 1
mov dword [ebp + 0xc], ebx
jne 0x10064ed
sar edx, 4
dec edx
cmp edx, 0x3f
jbe 0x1006485
push 0x3f
pop edx
mov ecx, dword [ebx + 4]
cmp ecx, dword [ebx + 8]
jne 0x10064cf
cmp edx, 0x20
mov ebx, 0x80000000
jae 0x10064b0
mov ecx, edx
shr ebx, cl
lea ecx, [edx + eax + 4]
not ebx
and dword [eax + edi*4 + 0x44], ebx
dec byte [ecx]
jne 0x10064cc
mov ecx, dword [ebp + 8]
and dword [ecx], ebx
jmp 0x10064cc
lea ecx, [edx - 0x20]
shr ebx, cl
lea ecx, [edx + eax + 4]
not ebx
and dword [eax + edi*4 + 0xc4], ebx
dec byte [ecx]
jne 0x10064cc
mov ecx, dword [ebp + 8]
and dword [ecx + 4], ebx
mov ebx, dword [ebp + 0xc]
mov edx, dword [ebx + 8]
mov ebx, dword [ebx + 4]
mov ecx, dword [ebp - 4]
add ecx, dword [ebp - 0xc]
mov dword [edx + 4], ebx
mov edx, dword [ebp + 0xc]
mov ebx, dword [edx + 4]
mov edx, dword [edx + 8]
mov dword [ebx + 8], edx
mov dword [ebp - 4], ecx
mov edx, ecx
sar edx, 4
dec edx
cmp edx, 0x3f
jbe 0x10064fb
push 0x3f
pop edx
mov ebx, dword [ebp - 8]
and ebx, 1
mov dword [ebp - 0xc], ebx
jne 0x1006599
sub esi, dword [ebp - 8]
mov ebx, dword [ebp - 8]
sar ebx, 4
push 0x3f
mov dword [ebp + 0xc], esi
dec ebx
pop esi
cmp ebx, esi
jbe 0x1006520
mov ebx, esi
add ecx, dword [ebp - 8]
mov edx, ecx
sar edx, 4
dec edx
cmp edx, esi
mov dword [ebp - 4], ecx
jbe 0x1006532
mov edx, esi
cmp ebx, edx
je 0x1006594
mov ecx, dword [ebp + 0xc]
mov esi, dword [ecx + 4]
cmp esi, dword [ecx + 8]
jne 0x100657c
cmp ebx, 0x20
mov esi, 0x80000000
jae 0x1006562
mov ecx, ebx
shr esi, cl
not esi
and dword [eax + edi*4 + 0x44], esi
dec byte [ebx + eax + 4]
jne 0x100657c
mov ecx, dword [ebp + 8]
and dword [ecx], esi
jmp 0x100657c
lea ecx, [ebx - 0x20]
shr esi, cl
not esi
and dword [eax + edi*4 + 0xc4], esi
dec byte [ebx + eax + 4]
jne 0x100657c
mov ecx, dword [ebp + 8]
and dword [ecx + 4], esi
mov ecx, dword [ebp + 0xc]
mov esi, dword [ecx + 8]
mov ecx, dword [ecx + 4]
mov dword [esi + 4], ecx
mov ecx, dword [ebp + 0xc]
mov esi, dword [ecx + 4]
mov ecx, dword [ecx + 8]
mov dword [esi + 8], ecx
mov esi, dword [ebp + 0xc]
jmp 0x100659c
mov ebx, dword [ebp + 8]
cmp dword [ebp - 0xc], 0
jne 0x10065aa
cmp ebx, edx
je 0x100662a
mov ecx, dword [ebp - 0x10]
lea ecx, [ecx + edx*8]
mov ebx, dword [ecx + 4]
mov dword [esi + 8], ecx
mov dword [esi + 4], ebx
mov dword [ecx + 4], esi
mov ecx, dword [esi + 4]
mov dword [ecx + 8], esi
mov ecx, dword [esi + 4]
cmp ecx, dword [esi + 8]
jne 0x100662a
mov cl, byte [edx + eax + 4]
mov byte [ebp + 0xf], cl
inc cl
cmp edx, 0x20
mov byte [edx + eax + 4], cl
jae 0x1006601
cmp byte [ebp + 0xf], 0
jne 0x10065f0
mov ecx, edx
mov ebx, 0x80000000
shr ebx, cl
mov ecx, dword [ebp + 8]
or dword [ecx], ebx
mov ebx, 0x80000000
mov ecx, edx
shr ebx, cl
lea eax, [eax + edi*4 + 0x44]
or dword [eax], ebx
jmp 0x100662a
cmp byte [ebp + 0xf], 0
jne 0x1006617
lea ecx, [edx - 0x20]
mov ebx, 0x80000000
shr ebx, cl
mov ecx, dword [ebp + 8]
or dword [ecx + 4], ebx
lea ecx, [edx - 0x20]
mov edx, 0x80000000
shr edx, cl
lea eax, [eax + edi*4 + 0xc4]
or dword [eax], edx
mov eax, dword [ebp - 4]
mov dword [esi], eax
mov dword [eax + esi - 4], eax
mov eax, dword [ebp - 0x10]
dec dword [eax]
jne 0x1006735
mov eax, dword [0x100cd44]
test eax, eax
je 0x1006727
mov ecx, dword [0x100cd5c]
mov esi, dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x4000
shl ecx, 0xf
add ecx, dword [eax + 0xc]
mov ebx, 0x8000
push ebx
push ecx
call esi
mov ecx, dword [0x100cd5c]
mov eax, dword [0x100cd44]
mov edx, 0x80000000
shr edx, cl
or dword [eax + 8], edx
mov eax, dword [0x100cd44]
mov eax, dword [eax + 0x10]
mov ecx, dword [0x100cd5c]
and dword [eax + ecx*4 + 0xc4], 0
mov eax, dword [0x100cd44]
mov eax, dword [eax + 0x10]
dec byte [eax + 0x43]
mov eax, dword [0x100cd44]
mov ecx, dword [eax + 0x10]
cmp byte [ecx + 0x43], 0
jne 0x10066b8
and dword [eax + 4], 0xfffffffe
mov eax, dword [0x100cd44]
cmp dword [eax + 8], 0xffffffff
jne 0x1006727
push ebx
push 0
push dword [eax + 0xc]
call esi
mov eax, dword [0x100cd44]
push dword [eax + 0x10]
push 0
push dword [0x100cfa0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [0x100cd48]
mov edx, dword [0x100cd4c]
lea eax, [eax + eax*4]
shl eax, 2
mov ecx, eax
mov eax, dword [0x100cd44]
sub ecx, eax
lea ecx, [ecx + edx - 0x14]
push ecx
lea ecx, [eax + 0x14]
push ecx
push eax
call fcn.01007af0
mov eax, dword [ebp + 8]
add esp, 0xc
dec dword [0x100cd48]
cmp eax, dword [0x100cd44]
jbe 0x100671d
sub dword [ebp + 8], 0x14
mov eax, dword [0x100cd4c]
mov dword [0x100cd54], eax
mov eax, dword [ebp + 8]
mov dword [0x100cd44], eax
mov dword [0x100cd5c], edi
pop ebx
pop edi
pop esi
leave
ret