Function at 0x406b09
Capabilities:
Create thread

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
push edi
push 0x5a5470
mov ebp, ecx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov edx, dword [esp + 0x2c]
xor ebx, ebx
mov esi, ebx
mov dword [ebp], edx
mov edx, dword [esp + 0x30]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x3c]
mov dword [ebp + 4], edx
mov edx, dword [esp + 0x34]
mov dword [ebp + 0x6c], eax
mov eax, dword [esp + 0x38]
mov dword [ebp + 8], edx
mov dword [ebp + 0x58], ebx
mov dword [ebp + 0x5c], ebx
mov dword [ebp + 0x60], ebx
mov dword [ebp + 0x64], ebx
mov dword [ebp + 0x68], ebx
mov dword [ebp + 0x70], ebx
mov dword [ebp + 0x74], ebx
mov dword [ebp + 0x78], eax
mov dword [ebp + 0x7c], ebx
mov dword [ebp + 0x80], ebx
mov dword [ebp + 0x84], ebx
mov dword [ebp + 0x88], ebx
mov byte [ebp + 0x8c], bl
mov dword [ebp + 0xa8], ebx
mov dword [ebp + 0xac], ebx
mov dword [ebp + 0xb0], ebx
mov dword [ebp + 0xb4], ebx
mov dword [ebp + 0xb8], ebx
mov word [ebp + 0xbc], bx
mov byte [ebp + 0xbe], bl
mov dword [esp + 0x2c], esi
cmp dword [esp + 0x40], ebx
je 0x406c14
push 0x348
call fcn.004ff716
pop ecx
push dword [esp + 0x4c]
mov ecx, eax
push dword [ebp + 0x6c]
push dword [esp + 0x48]
call fcn.00407c29
push eax
lea ecx, [esp + 0x30]
call fcn.004076cb
mov esi, dword [esp + 0x2c]
test esi, esi
je 0x406c14
cmp dword [esi + 0x28], ebx
jne 0x406c05
mov ecx, esi
call fcn.00407cce
mov edi, eax
test edi, edi
je 0x406c14
push edi
mov ecx, esi
call fcn.00407d62
push edi
mov bl, al
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test bl, bl
je 0x406c12
xor ebx, ebx
push esi
lea ecx, [ebp + 0xc]
mov esi, ebx
call fcn.004076cb
jmp 0x406c14
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
jne 0x406cdd
lea eax, [ebp + 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov edi, dword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
push ebx
push 1
push ebx
push ebx
call edi
push ebx
push 1
push ebx
push ebx
mov dword [ebp + 0xa8], eax
call edi
mov dword [ebp + 0xac], eax
test eax, eax
je 0x406c74
cmp dword [ebp + 0xa8], ebx
je 0x406c74
lea eax, [esp + 0x40]
push eax
push ebx
push ebp
push 0x406db2
push 0x10000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [ebp + 0x88], eax
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push str.dbghelp.dll
call ebx
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp + 0x64], eax
test eax, eax
je 0x406c99
push str.MiniDumpWriteDump
push eax
call edi
mov dword [ebp + 0x68], eax
push str.rpcrt4.dll
call ebx
mov dword [ebp + 0x70], eax
test eax, eax
je 0x406cb2
push 0x586fc4
push eax
call edi
mov dword [ebp + 0x74], eax
lea edi, [ebp + 0x10]
xor ebx, ebx
cmp edi, dword [esp + 0x28]
je 0x406ccb
push 0xffffffffffffffff
push ebx
push dword [esp + 0x30]
mov ecx, edi
call fcn.00407907
cmp dword [edi + 0x14], 8
jb 0x406cd3
mov edi, dword [edi]
mov ecx, ebp
mov dword [ebp + 0x58], edi
call fcn.00407547
lea eax, [esp + 0x14]
mov dword [esp + 0x1c], ebx
xorps xmm0, xmm0
lea ecx, [ebp + 0xc0]
push eax
movlpd qword [esp + 0x18], xmm0
call fcn.004076fa
cmp dword [esp + 0x10], 1
mov edi, 0x5a5458
jne 0x406d0d
push edi
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov ebx, dword [esp + 0x38]
test ebx, ebx
je 0x406d90
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x5a5478], 0
jne 0x406d3c
push 0xc
call fcn.004ff716
pop ecx
xor ecx, ecx
mov dword [0x5a5478], eax
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
lea eax, [esp + 0x40]
mov dword [esp + 0x40], ebp
push eax
call fcn.0040766f
test bl, 1
je 0x406d5d
push 0x406eb3
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [ebp + 0x7c], eax
test bl, 2
je 0x406d73
push 0x406f63
call fcn.005083b4
pop ecx
mov dword [ebp + 0x80], eax
test bl, 4
je 0x406d89
push 0x4070e9
call fcn.0050418c
pop ecx
mov dword [ebp + 0x84], eax
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
je 0x406da8
mov ecx, esi
call fcn.00407c95
push 0x348
push esi
call fcn.004ff746
pop ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0x28