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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x8c
mov eax, dword [esp + 0xa4]
mov ebx, dword [esp + 0xa0]
mov ebp, dword [esp + 0xa8]
mov dword [esp + 0x28], eax
mov dword [esp + 0x44], eax
test ebx, ebx
mov eax, dword [esp + 0xac]
mov dword [esp + 0x48], ebp
mov dword [esp + 0x4c], eax
je 0x47b390
mov esi, dword [esp + 0x28]
test esi, esi
setne cl
test ebp, ebp
setne dl
cmp cl, dl
jne 0x47b390
mov dword [esp + 4], esi
mov dword [esp + 8], ebp
mov dword [esp + 0xc], eax
mov dword [esp], 0x7a0
call fcn.004081b0
test eax, eax
mov esi, eax
je 0x47b390
cmp ebx, 0x40
mov eax, 0x40
mov dword [esp + 4], 0x190
cmovbe eax, ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 8], eax
lea eax, [esi + 0x14]
mov dword [esp], eax
call fcn.00412b80
mov edi, dword [esp + 0xb0]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x4c]
mov dword [esi + 0x768], 1
test edi, edi
mov dword [esi + 0x788], ecx
mov dword [esi + 0x78c], edx
mov dword [esi + 0x790], eax
je 0x47b39f
mov ecx, dword [esp + 0xb0]
or byte [esi + 0x79c], 1
mov dword [esi], ecx
lea ecx, [ebx + 2]
mov edx, dword [esp + 0x28]
mov edi, 1
mov dword [esp + 0x70], eax
mov dword [esp + 0xc], eax
mov eax, 0x108
bsr ecx, ecx
mov dword [esp + 0x48], ebp
mov dword [esp + 0x6c], ebp
add ecx, 1
mov dword [esp + 0x44], edx
mov dword [esp + 0x68], edx
shl eax, cl
mov dword [esp + 4], edx
mov dword [esp + 8], ebp
mov dword [esp], eax
shl edi, cl
call fcn.004081b0
test eax, eax
mov dword [esp + 0x30], eax
je 0x47b3fa
test edi, edi
mov eax, edi
je 0x47b3d1
mov edx, dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov ecx, dword [esp + 0x30]
xor edi, edi
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], ebp
mov esi, eax
mov dword [esp + 0x24], edx
mov edx, dword [sym.imp.KERNEL32.dll_InitializeConditionVariable]
lea ebx, [ecx + 8]
mov dword [esp + 0x34], edx
mov ebp, edx
jmp 0x47b112
mov edi, eax
mov dword [esp], ebx
call dword [esp + 0x24]
lea eax, [ebx + 0x18]
sub esp, 4
add ebx, 0x108
mov dword [esp], eax
call ebp
lea eax, [edi + 1]
sub esp, 4
cmp esi, eax
jne 0x47b110
mov esi, dword [esp + 0x38]
mov ebp, dword [esp + 0x3c]
mov eax, dword [esp + 0x30]
mov dword [esi + 4], eax
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x4c]
mov ecx, dword [esp + 0x28]
mov dword [esi + 0x758], edi
mov dword [esp + 0x60], ebp
add eax, eax
mov dword [esp + 8], ebp
lea ebx, [eax + 3]
lea eax, [eax*8 + 0x48]
mov dword [esp + 0x64], edx
mov dword [esp + 0x5c], ecx
mov dword [esp + 4], ecx
mov dword [esp + 0xc], edx
mov dword [esp], eax
call fcn.004081b0
test eax, eax
mov edi, eax
je 0x47b1b7
mov dword [esp], eax
call dword [esp + 0x24]
sub esp, 4
mov dword [edi + 0x18], 0x10000
mov dword [edi + 0x1c], ebx
mov eax, dword [esp + 0x5c]
mov dword [edi + 0x20], 0
mov dword [edi + 0x24], eax
mov eax, dword [esp + 0x60]
mov dword [edi + 0x28], eax
mov eax, dword [esp + 0x64]
mov dword [edi + 0x2c], eax
mov dword [esi + 8], edi
mov eax, dword [esp + 0x4c]
mov edi, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x54], ebp
mov dword [esp + 8], ebp
mov dword [esp + 0x58], eax
mov dword [esp + 0xc], eax
lea eax, [edi*4 + 0x2c]
mov dword [esp + 0x50], edx
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.004081b0
test eax, eax
mov ebx, eax
je 0x47b3f3
mov dword [esp], eax
call dword [esp + 0x24]
sub esp, 4
mov dword [ebx + 0x18], edi
mov dword [ebx + 0x1c], 1
mov ecx, dword [esp + 0x50]
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x58]
mov dword [ebx + 0x20], ecx
mov dword [ebx + 0x24], edx
mov dword [ebx + 0x28], eax
mov dword [esp], ecx
mov dword [esp + 4], edx
mov dword [esp + 8], eax
call fcn.00412050
test eax, eax
mov dword [ebx + 0x2c], eax
je 0x47b416
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov edi, dword [esp + 0x4c]
mov dword [esi + 0xc], ebx
mov dword [esp + 0x78], ebp
mov dword [esp + 8], ebp
mov dword [esp + 0x74], eax
mov dword [esp + 4], eax
lea eax, [ecx*8 + 0x30]
mov dword [esp + 0x7c], edi
mov dword [esp + 0xc], edi
mov dword [esp], eax
call fcn.004081b0
test eax, eax
mov ebx, eax
je 0x47b2c2
mov dword [esp], eax
call dword [esp + 0x24]
sub esp, 4
mov dword [ebx + 0x18], 0x10000
mov dword [ebx + 0x20], 0
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
mov dword [ebx + 0x28], ebp
mov dword [ebx + 0x2c], edi
mov dword [ebx + 0x1c], ecx
mov dword [ebx + 0x24], eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
mov dword [ebx + 0x18], 0
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
lea edx, [esi + 0xd8]
lea edi, [esi + 0xdc]
xor eax, eax
mov dword [esi + 0x10], ebx
mov dword [esi + 0xd8], 0
mov ecx, edx
and edi, 0xfffffffc
mov dword [esi + 0x73c], 0
sub ecx, edi
add ecx, 0x668
shr ecx, 2
rep stosd dword es:[edi], eax
mov dword [esp], edx
mov edi, dword [esp + 0x24]
call edi
lea eax, [esi + 0xf0]
sub esp, 4
mov ebx, dword [esp + 0x34]
mov dword [esp], eax
call ebx
lea eax, [esi + 0x70c]
sub esp, 4
mov dword [esp], eax
call edi
lea eax, [esi + 0x724]
sub esp, 4
mov dword [esp], eax
call ebx
mov edx, dword [esi]
mov ecx, dword [esi + 4]
sub esp, 4
mov ebx, dword [esi + 8]
mov edi, dword [esi + 0xc]
mov dword [esi + 0xcc], 0
mov dword [esi + 0xd0], 0
test edx, edx
mov dword [esi + 0xd4], 0
sete al
test ecx, ecx
sete dl
or eax, edx
test ebx, ebx
sete dl
or eax, edx
test edi, edi
sete dl
or al, dl
jne 0x47b37f
mov eax, dword [esi + 0x10]
test eax, eax
jne 0x47b392
mov dword [esp], esi
call fcn.0047acc0
mov esi, esi
lea edi, [edi]
xor esi, esi
add esp, 0x8c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 8], ecx
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.00405f60
and byte [esi + 0x79c], 0xfe
mov dword [esi], eax
mov eax, dword [esp + 0x4c]
jmp 0x47b083
mov ecx, dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [esp + 0x30]
mov edi, 0xffffffff
mov dword [esp + 0x24], ecx
mov ecx, dword [sym.imp.KERNEL32.dll_InitializeConditionVariable]
mov dword [esp + 0x34], ecx
jmp 0x47b140
xor ebx, ebx
jmp 0x47b23b
mov ecx, dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea edi, [ebx + 1]
mov dword [esp + 0x24], ecx
mov ecx, dword [sym.imp.KERNEL32.dll_InitializeConditionVariable]
mov dword [esp + 0x34], ecx
jmp 0x47b140
mov eax, dword [ebx + 0x18]
xor edi, edi
test eax, eax
jle 0x47b433
mov eax, dword [ebx + edi*4 + 0x2c]
add edi, 1
mov dword [esp], eax
call fcn.004123a0
cmp edi, dword [ebx + 0x18]
jl 0x47b41f
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov eax, dword [ebx + 0x20]
sub esp, 4
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x24]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x28]
mov dword [esp], ebx
xor ebx, ebx
mov dword [esp + 0xc], eax
call fcn.00408210
jmp 0x47b23b