Function at 0x516ca8
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.004edfec
mov ebx, eax
call fcn.005161fc
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.004eeae0
mov dword [ebx + 0x28], eax
test edi, edi
je 0x516f50
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], 0x515e98
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 0x516ecd
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], 0x515d98
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], 0x6258f0
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.004d6a3c
mov dword [ebx + 4], eax
mov dword [esp + 0xc], 0x6258f7
mov dword [esp + 8], 0x6258fc
mov dword [esp + 4], eax
mov dword [esp], 0
call fcn.004dc05c
mov dword [esp + 0xc], 0x625909
mov dword [esp + 8], 0x62590e
mov eax, dword [ebx + 4]
mov dword [esp + 4], eax
mov dword [esp], 0
call fcn.004dc05c
mov eax, dword [ebx + 4]
add esp, 0x50
pop ebx
pop esi
pop edi
ret
mov dword [ebx + 0x30], 0
jmp 0x516df7