Function at 0x51c7ad
Capabilities:
Create thread

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x4c]
mov ebx, ecx
push 0x611b34
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x30]
mov ebp, dword [esp + 0x3c]
mov dword [ebx + 8], ecx
xor ecx, ecx
mov dword [ebx], edx
mov esi, ecx
mov edx, dword [esp + 0x34]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x40]
mov dword [ebx + 4], edx
mov dword [ebx + 0x58], ecx
mov dword [ebx + 0x5c], ecx
mov dword [ebx + 0x60], ecx
mov dword [ebx + 0x64], ecx
mov dword [ebx + 0x68], ecx
mov dword [ebx + 0x6c], eax
mov dword [ebx + 0x70], ecx
mov dword [ebx + 0x74], ecx
mov dword [ebx + 0x78], ebp
mov dword [ebx + 0x7c], ecx
mov dword [ebx + 0x80], ecx
mov dword [ebx + 0x84], ecx
mov dword [ebx + 0x88], ecx
mov byte [ebx + 0x8c], cl
mov dword [ebx + 0xa8], ecx
mov dword [ebx + 0xac], ecx
mov dword [ebx + 0xb0], ecx
mov dword [ebx + 0xb4], ecx
mov dword [ebx + 0xb8], ecx
mov word [ebx + 0xbc], cx
mov byte [ebx + 0xbe], cl
mov dword [esp + 0x4c], esi
test edi, edi
jne 0x51c87b
cmp dword [esp + 0x44], ecx
je 0x51c8a3
push 0x364
call fcn.0053f5f8
pop ecx
push dword [esp + 0x54]
mov ecx, eax
push dword [esp + 0x54]
push dword [ebx + 0x6c]
push dword [esp + 0x50]
call fcn.0051e292
mov edi, eax
push edi
lea ecx, [esp + 0x50]
call fcn.0051d877
mov esi, dword [esp + 0x4c]
test esi, esi
je 0x51c8a3
mov ecx, esi
call fcn.0051e3c6
test al, al
je 0x51c8a3
push esi
lea ecx, [ebx + 0xc]
xor esi, esi
call fcn.0051d877
cmp dword [ebx + 0xc], 0
jne 0x51c956
lea eax, [ebx + 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov edi, dword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
push 0
push 1
push 0
push 0
call edi
mov dword [ebx + 0xa8], eax
xor eax, eax
push eax
push 1
push eax
push eax
call edi
mov dword [ebx + 0xac], eax
test eax, eax
je 0x51c90b
xor ecx, ecx
cmp dword [ebx + 0xa8], ecx
je 0x51c90b
lea eax, [esp + 0x34]
push eax
push ecx
push ebx
push 0x51cbd5
push 0x10000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [ebx + 0x88], eax
push 0x5dff80
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebx + 0x64], eax
test eax, eax
je 0x51c92e
push str.MiniDumpWriteDump
push eax
call edi
mov dword [ebx + 0x68], eax
push str.rpcrt4.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebx + 0x70], eax
test eax, eax
je 0x51c94b
push str.UuidCreate
push eax
call edi
mov dword [ebx + 0x74], eax
push dword [esp + 0x2c]
mov ecx, ebx
call fcn.0051c5f3
lea eax, [esp + 0x18]
xorps xmm0, xmm0
lea ecx, [ebx + 0xc0]
movlpd qword [esp + 0x18], xmm0
push eax
push dword [ecx]
xor edi, edi
mov dword [esp + 0x28], edi
call fcn.0051dd08
cmp dword [esp + 0x14], 1
jne 0x51c989
push 0x611b18
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
test ebp, ebp
je 0x51ca1d
push 0x611b18
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x611b38]
test eax, eax
jne 0x51c9ba
push 0xc
call fcn.0053f5f8
pop ecx
mov dword [0x611b38], eax
mov dword [eax], edi
mov dword [eax + 4], edi
mov dword [eax + 8], edi
lea ecx, [esp + 0x30]
mov dword [esp + 0x30], ebx
push ecx
mov ecx, eax
call fcn.0051d7d2
mov eax, dword [esp + 0x3c]
test al, 1
je 0x51c9e4
push 0x51ccc4
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [ebx + 0x7c], eax
mov eax, dword [esp + 0x3c]
test al, 2
je 0x51c9fd
push 0x51cd6d
call fcn.0054cdfd
mov dword [ebx + 0x80], eax
mov eax, dword [esp + 0x40]
pop ecx
test al, 4
je 0x51ca12
push 0x51cee9
call fcn.0054211a
pop ecx
mov dword [ebx + 0x84], eax
push 0x611b18
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
je 0x51ca29
push ecx
mov ecx, esi
call fcn.0051d93e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x2c