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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x100a427d
mov eax, dword fs:[0]
push eax
sub esp, 0x6c
mov eax, dword [0x100c60c8]
xor eax, esp
mov dword [esp + 0x64], eax
push esi
push edi
mov eax, dword [0x100c60c8]
xor eax, esp
push eax
lea eax, [esp + 0x78]
mov dword fs:[0], eax
mov edi, dword [ebx + 0xc]
xor esi, esi
cmp edi, esi
mov dword [esp + 0xc], edi
je 0x1002225b
mov eax, dword [edi]
mov edx, dword [eax]
mov ecx, edi
call edx
mov dword [esp + 0x80], esi
cmp edi, esi
jne 0x10022276
mov dword [esp + 0x80], 0xffffffff
jmp 0x100225df
cmp dword [ebx + 0x44], esi
ja 0x10022280
cmp dword [ebx + 0x40], esi
jbe 0x10022289
cmp dword [ebx + 0x48], esi
je 0x100224df
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], esi
mov byte [esp + 0x80], 1
mov eax, 0x2000
lea ecx, [esp + 0x14]
call fcn.10022a40
mov al, byte [ebx + 0x38]
test al, al
jne 0x100224be
mov eax, dword [esp + 0x18]
cmp eax, esi
mov dword [esp + 0x10], esi
mov dword [esp + 0x2c], esi
je 0x100222d0
mov ecx, dword [esp + 0x1c]
sub ecx, eax
sar ecx, 1
jne 0x100222da
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0xc]
mov edx, dword [edi]
mov edx, dword [edx + 0x1c]
lea ecx, [esp + 0x2c]
push ecx
lea ecx, [esp + 0x14]
push ecx
push 0x2000
push eax
mov ecx, edi
call edx
mov esi, eax
xor eax, eax
cmp dword [esp + 0x10], eax
mov dword [esp + 0x24], esi
mov dword [ebx + 0x3c], esi
jbe 0x10022488
cmp dword [ebx + 0x48], eax
jne 0x100223fb
mov ecx, dword [ebx + 0x40]
or ecx, dword [ebx + 0x44]
jne 0x100224c7
mov dword [esp + 0x4c], 7
mov dword [esp + 0x48], eax
mov word [esp + 0x38], ax
mov byte [esp + 0x80], 2
lea edx, [esp + 0x50]
push edx
call fcn.10080860
mov byte [esp + 0x80], 3
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x54]
push ecx
call fcn.10080a10
test al, al
je 0x100224f8
mov edx, dword [esp + 0x50]
push 0x24
mov byte [edx], 0
call sub.MSVCR80.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x30], eax
mov byte [esp + 0x80], 4
test eax, eax
je 0x1002238d
mov edx, eax
call fcn.1006ebf0
jmp 0x1002238f
xor eax, eax
mov byte [esp + 0x80], 3
push 4
push 1
push 0x40000000
lea edi, [esp + 0x40]
mov esi, eax
mov dword [ebx + 0x48], eax
call fcn.1006ea30
test al, al
je 0x10022538
mov byte [esp + 0x80], 2
lea eax, [esp + 0x50]
push eax
call fcn.10080960
mov byte [esp + 0x80], 1
cmp dword [esp + 0x4c], 8
jb 0x100223e4
mov ecx, dword [esp + 0x38]
push ecx
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 4
mov esi, dword [esp + 0x24]
xor eax, eax
mov dword [esp + 0x4c], 7
mov dword [esp + 0x48], eax
mov word [esp + 0x38], ax
cmp dword [ebx + 0x48], 0
je 0x1002244c
mov eax, dword [esp + 0x18]
test eax, eax
mov dword [esp + 0x28], 0
je 0x1002241b
mov edx, dword [esp + 0x1c]
sub edx, eax
sar edx, 1
jne 0x10022425
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
push ecx
mov ecx, dword [ebx + 0x48]
lea edi, [esp + 0x2c]
call fcn.1006ee00
test al, al
je 0x1002258d
mov edx, dword [esp + 0x28]
cmp edx, dword [esp + 0x10]
jne 0x1002258d
mov eax, dword [esp + 0x10]
add dword [ebx + 0x40], eax
mov cl, byte [ebx + 0x39]
adc dword [ebx + 0x44], 0
test cl, cl
je 0x10022471
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x10022471
push 0x7d0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [ebx + 0x44], 0
ja 0x10022480
cmp dword [ebx + 0x40], 0x6400000
jbe 0x10022484
mov byte [ebx + 0x39], 1
mov edi, dword [esp + 0xc]
cmp esi, 1
je 0x100225a4
cmp esi, 0x8000000a
jne 0x100224a9
cmp dword [esp + 0x10], 0
jne 0x100224b1
push 1
call sub.KERNEL32.dll_Sleep
jmp 0x100224b1
test esi, esi
jne 0x1002259d
mov dl, byte [ebx + 0x38]
xor esi, esi
test dl, dl
je 0x100222b6
mov edi, dword [esp + 0xc]
jmp 0x100225a6
mov dword [ebx + 0x3c], 0x80004005
mov byte [esp + 0x80], 0
lea esi, [esp + 0x14]
call fcn.10007450
mov dword [esp + 0x80], 0xffffffff
mov eax, dword [edi]
mov edx, dword [eax + 4]
mov ecx, edi
call edx
jmp 0x100225df
mov dword [ebx + 0x3c], 0x80004005
mov byte [esp + 0x80], 2
lea eax, [esp + 0x50]
push eax
call fcn.10080960
mov byte [esp + 0x80], 1
lea esi, [esp + 0x34]
call fcn.10006e70
mov byte [esp + 0x80], 0
lea esi, [esp + 0x14]
call fcn.10007450
jmp 0x100225cb
mov esi, ebx
call fcn.10021d40
mov dword [ebx + 0x3c], 0x80004005
mov byte [esp + 0x80], 2
lea ecx, [esp + 0x50]
push ecx
call fcn.10080960
mov byte [esp + 0x80], 1
lea esi, [esp + 0x34]
call fcn.10006e70
mov byte [esp + 0x80], 0
lea esi, [esp + 0x14]
call fcn.10007450
mov dword [esp + 0x80], 0xffffffff
mov ecx, dword [esp + 0xc]
mov edx, dword [ecx]
jmp 0x100225da
mov esi, ebx
call fcn.10021d40
mov dword [ebx + 0x3c], 0x80004005
jmp 0x10022569
mov esi, ebx
call fcn.10021d40
xor esi, esi
mov byte [esp + 0x80], 0
mov eax, dword [esp + 0x18]
cmp eax, esi
je 0x100225bf
push eax
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 4
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], esi
mov dword [esp + 0x80], 0xffffffff
mov edx, dword [edi]
mov ecx, edi
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x78]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x64]
xor ecx, esp
call fcn.1009176c
mov esp, ebp
pop ebp
ret