Function at 0x5163d4
Capabilities:
Create thread

Disassembly:
push edi
push esi
push ebx
sub esp, 0x50
mov edi, dword [esp + 0x60]
mov esi, dword [esp + 0x64]
mov dword [esp], 0x64
call fcn.004ed800
mov ebx, eax
call fcn.00515928
mov dword [ebx + 0xc], 0
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x5c], 0
mov dword [ebx + 0x14], edi
mov dword [ebx + 0x18], esi
mov eax, dword [esp + 0x68]
mov dword [ebx + 0x1c], eax
mov eax, dword [esp + 0x6c]
mov dword [ebx + 0x20], eax
mov eax, dword [esp + 0x70]
mov dword [ebx + 0x24], eax
mov dword [ebx + 0x50], 0
mov dword [ebx + 0x54], 0
mov dword [ebx + 0x4c], 0
mov dword [ebx + 4], 0
mov dword [ebx + 8], 0
call fcn.004ee2f4
mov dword [ebx + 0x28], eax
test edi, edi
je 0x51667c
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 1
mov dword [esp], 0
call sub.KERNEL32.dll_CreateEventA
sub esp, 0x10
mov dword [ebx + 0x38], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateEventA
sub esp, 0x10
mov dword [ebx + 0x44], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call sub.KERNEL32.dll_CreateEventA
sub esp, 0x10
mov dword [ebx + 0x48], eax
lea eax, [esp + 0x24]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x5155c4
mov dword [esp + 4], 0x100
mov dword [esp], 0
call sub.KERNEL32.dll_CreateThread
sub esp, 0x18
mov dword [ebx + 0x30], eax
mov dword [esp + 4], 2
mov dword [esp], eax
call sub.KERNEL32.dll_SetThreadPriority
sub esp, 8
or dword [ebx + 8], 2
test esi, esi
je 0x5165f9
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 1
mov dword [esp], 0
call sub.KERNEL32.dll_CreateEventA
sub esp, 0x10
mov dword [ebx + 0x34], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateEventA
sub esp, 0x10
mov dword [ebx + 0x3c], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call sub.KERNEL32.dll_CreateEventA
sub esp, 0x10
mov dword [ebx + 0x40], eax
lea eax, [esp + 0x24]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x5154c4
mov dword [esp + 4], 0x100
mov dword [esp], 0
call sub.KERNEL32.dll_CreateThread
sub esp, 0x18
mov dword [ebx + 0x2c], eax
mov dword [esp + 4], 2
mov eax, dword [ebx + 0x30]
mov dword [esp], eax
call sub.KERNEL32.dll_SetThreadPriority
sub esp, 8
or dword [ebx + 8], 4
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x6161b0
lea esi, [esp + 0x28]
mov dword [esp], esi
call sub.msvcrt.dll_sprintf
mov eax, dword [ebx + 8]
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp], str.pipe
call fcn.004d6320
mov dword [ebx + 4], eax
mov dword [esp + 0xc], 0x6161b7
mov dword [esp + 8], 0x6161bc
mov dword [esp + 4], eax
mov dword [esp], 0
call fcn.004db940
mov dword [esp + 0xc], 0x6161c9
mov dword [esp + 8], 0x6161ce
mov eax, dword [ebx + 4]
mov dword [esp + 4], eax
mov dword [esp], 0
call fcn.004db940
mov eax, dword [ebx + 4]
add esp, 0x50
pop ebx
pop esi
pop edi
ret
mov dword [ebx + 0x30], 0
jmp 0x516523