Function at 0x10014890
Capabilities:
Write file on windows

Disassembly:
push ebx
mov ebx, eax
mov eax, dword [esi + 0x24]
push ebp
mov ebp, dword [esp + 0x10]
push edi
cmp eax, 4
je 0x100148a6
cmp eax, 1
jne 0x100148f9
mov eax, dword [esi + 0x20]
cmp eax, 1
jne 0x100148d2
mov edi, dword [esp + 0x10]
cmp dword [edi + 0x14], 0
je 0x100148f9
lea eax, [edi + 0x5c]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
cmp eax, dword [edi + 0x68]
jge 0x100148f9
xor eax, eax
mov ecx, edi
call fcn.10014ca0
jmp 0x100148f9
test eax, eax
jne 0x100148f9
mov ecx, dword [esp + 0x10]
cmp dword [ecx + 4], eax
je 0x100148f9
mov edi, ecx
lea edx, [edi + 0x64]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
cmp eax, dword [edi + 0x6c]
jge 0x100148f9
push 0
mov ecx, edi
call fcn.10014b30
mov eax, dword [esi + 0x24]
dec eax
cmp eax, 4
ja case.default.0x10014906
jmp dword [eax*4 + 0x10014b18]
test ebx, ebx
mov ebx, dword [esp + 0x10]
mov edi, 1
jne 0x10014946
mov eax, dword [ebx]
mov edx, dword [eax + 4]
push esi
mov ecx, ebx
call edx
test eax, eax
je 0x10014946
cmp dword [esi + 0x30], 0
mov dword [esi + 0x2c], edi
mov dword [esi + 0x24], 2
jne 0x10014946
mov eax, esi
call fcn.10015090
mov edi, eax
neg edi
sbb edi, edi
inc edi
mov eax, dword [esi + 0x30]
or eax, edi
je 0x10014957
lea ecx, [esi + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea edx, [esi + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne case.default.0x10014906
mov ecx, ebx
push esi
call fcn.10015480
pop edi
pop ebp
pop ebx
ret 8
mov edi, 1
test ebx, ebx
jne 0x100149d0
mov eax, dword [esi + 0x20]
sub eax, ebx
mov dword [esi + 0x24], 2
je 0x100149a5
dec eax
jne 0x100149d0
push eax
mov eax, dword [esi + 0x1c]
push 0x10014520
push eax
call dword [sym.imp.KERNEL32.dll_BindIoCompletionCallback]
test eax, eax
je 0x100149d0
mov ebx, dword [esp + 0x10]
mov edx, dword [ebx]
mov eax, dword [edx + 4]
push esi
mov ecx, ebx
call eax
test eax, eax
je 0x100149d4
cmp dword [esi + 0x30], 0
mov dword [esi + 0x2c], edi
jne 0x100149d4
mov eax, esi
call fcn.10015090
mov edi, eax
neg edi
sbb edi, edi
inc edi
jmp 0x100149d4
mov ebx, dword [esp + 0x10]
mov ecx, dword [esi + 0x30]
or ecx, edi
je 0x100149e5
lea edx, [esi + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea eax, [esi + 0x28]
push eax
jmp 0x1001495b
mov edi, 1
test ebx, ebx
je 0x10014a03
cmp ebx, 0x80000005
jne 0x10014ae7
mov ecx, dword [esp + 0x10]
push 0
push ecx
mov eax, ebp
mov ecx, esi
call fcn.10015130
test eax, eax
js 0x10014ae7
mov eax, esi
call fcn.10015090
mov edi, eax
neg edi
sbb edi, edi
inc edi
jmp 0x10014ae7
test ebx, ebx
jne 0x10014a7e
mov eax, dword [esi + 0x30]
cmp ebp, eax
jae 0x10014a7e
add dword [esi + 0x2c], ebp
sub eax, ebp
mov dword [esi + 0x30], eax
test eax, eax
jle 0x10014a7e
lea edi, [esi + 0x28]
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [esi + 0x30]
mov ecx, dword [esi + 0x2c]
push esi
lea edx, [esi + 0x34]
push edx
mov edx, dword [esi + 0x1c]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10014a7e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x10014a7e
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea eax, [esi + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne case.default.0x10014906
push esi
call fcn.1001b930
add esp, 4
pop edi
pop ebp
pop ebx
ret 8
mov edi, 1
test ebx, ebx
je 0x10014ab0
cmp ebx, 0x80000005
jne 0x10014ae7
mov ecx, dword [esp + 0x10]
push 1
push ecx
mov eax, ebp
mov ecx, esi
call fcn.10015130
test eax, eax
jne 0x10014ad4
mov eax, esi
call fcn.10015090
mov edi, eax
neg edi
sbb edi, edi
inc edi
jmp 0x10014ae7
jle 0x10014ae7
mov eax, dword [esi + 0x58]
xor edi, edi
cmp eax, 0xffffffff
je 0x10014ae7
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esi + 0x30]
or edx, edi
je 0x10014af8
lea eax, [esi + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea ecx, [esi + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne case.default.0x10014906
mov ecx, dword [esp + 0x10]
push esi
call fcn.10015480
pop edi
pop ebp
pop ebx
ret 8