Function at 0x10168730
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 8
push ebx
push ebp
push edi
mov edi, ecx
mov ecx, 1
mov dword [esp + 0xc], ecx
test edi, edi
je 0x101689ab
cmp dword [edi + 0x20], 0
mov dword [edi + 0x18], 0
jne 0x10168764
mov dword [edi + 0x20], 0x10169d60
mov dword [edi + 0x28], 0
cmp dword [edi + 0x24], 0
jne 0x10168771
mov dword [edi + 0x24], 0x10169d50
mov ebx, dword [esp + 0x1c]
cmp edx, 0xffffffff
mov ebp, 6
cmovne ebp, edx
mov dword [esp + 0x10], ebp
test ebx, ebx
jns 0x1016878e
xor ecx, ecx
neg ebx
jmp 0x1016879b
cmp ebx, 0xf
jle 0x1016879f
mov ecx, 2
sub ebx, 0x10
mov dword [esp + 0xc], ecx
mov eax, dword [esp + 0x20]
dec eax
cmp eax, 8
ja 0x101689ab
cmp dword [esp + 0x18], 8
jne 0x101689ab
lea eax, [ebx - 8]
cmp eax, 7
ja 0x101689ab
cmp ebp, 9
ja 0x101689ab
cmp dword [esp + 0x24], 4
ja 0x101689ab
cmp ebx, 8
jne 0x101687e9
cmp ecx, 1
jne 0x101689ab
lea ebx, [ecx + 8]
mov eax, dword [edi + 0x20]
mov ebp, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push esi
push 0x16c4
cmp eax, 0x10169d60
jne 0x10168806
call ebp
add esp, 4
jmp 0x10168810
push 1
push dword [edi + 0x28]
call eax
add esp, 0xc
mov esi, eax
test esi, esi
je 0x1016899e
mov eax, dword [esp + 0x10]
mov ecx, ebx
mov dword [edi + 0x1c], esi
mov dword [esi + 0x18], eax
mov eax, 1
shl eax, cl
mov dword [esi + 0x2c], eax
mov dword [esp + 0x10], eax
dec eax
mov dword [esi + 0x30], ebx
mov ebx, dword [esp + 0x24]
mov dword [esi + 0x34], eax
mov eax, 1
mov dword [esi], edi
mov dword [esi + 4], 0x2a
lea ecx, [ebx + 7]
mov dword [esi + 0x1c], 0
shl eax, cl
mov dword [esi + 0x4c], eax
dec eax
mov dword [esi + 0x54], eax
mov eax, 0xaaaaaaab
mov dword [esi + 0x50], ecx
add ecx, 2
mul ecx
mov eax, dword [esp + 0x10]
shr edx, 1
mov dword [esi + 0x58], edx
mov ecx, dword [edi + 0x20]
cmp ecx, 0x10169d60
jne 0x1016888b
add eax, eax
push eax
call ebp
add esp, 4
jmp 0x10168896
push 2
push eax
push dword [edi + 0x28]
call ecx
add esp, 0xc
mov dword [esi + 0x38], eax
mov ecx, dword [edi + 0x20]
mov eax, dword [esi + 0x2c]
cmp ecx, 0x10169d60
jne 0x101688b1
add eax, eax
push eax
call ebp
add esp, 4
jmp 0x101688bc
push 2
push eax
push dword [edi + 0x28]
call ecx
add esp, 0xc
mov dword [esi + 0x40], eax
mov ecx, dword [edi + 0x20]
mov eax, dword [esi + 0x4c]
cmp ecx, 0x10169d60
jne 0x101688d7
add eax, eax
push eax
call ebp
add esp, 4
jmp 0x101688e2
push 2
push eax
push dword [edi + 0x28]
call ecx
add esp, 0xc
mov dword [esi + 0x44], eax
lea ecx, [ebx + 6]
mov eax, 1
mov dword [esi + 0x16c0], 0
shl eax, cl
mov dword [esi + 0x169c], eax
mov ecx, dword [edi + 0x20]
cmp ecx, 0x10169d60
jne 0x10168915
shl eax, 2
push eax
call ebp
add esp, 4
jmp 0x10168920
push 4
push eax
push dword [edi + 0x28]
call ecx
add esp, 0xc
cmp dword [esi + 0x38], 0
mov ecx, eax
mov edx, dword [esi + 0x169c]
mov dword [esi + 8], ecx
lea eax, [edx*4]
mov dword [esi + 0xc], eax
je 0x10168989
cmp dword [esi + 0x40], 0
je 0x10168989
cmp dword [esi + 0x44], 0
je 0x10168989
test ecx, ecx
je 0x10168989
mov eax, edx
mov byte [esi + 0x24], 8
shr eax, 1
lea eax, [ecx + eax*2]
mov dword [esi + 0x16a4], eax
lea eax, [ecx + edx*2]
add eax, edx
mov ecx, edi
mov dword [esi + 0x1698], eax
mov eax, dword [esp + 0x14]
mov dword [esi + 0x84], eax
mov eax, dword [esp + 0x28]
mov dword [esi + 0x88], eax
pop esi
pop edi
pop ebp
pop ebx
add esp, 8
jmp fcn.10168550
mov dword [esi + 4], 0x29a
mov ecx, edi
mov dword [edi + 0x18], str.insufficient_memory
call fcn.10169440
pop esi
pop edi
pop ebp
mov eax, 0xfffffffc
pop ebx
add esp, 8
ret
pop edi
pop ebp
mov eax, 0xfffffffe
pop ebx
add esp, 8
ret