Function at 0x516140
Capabilities:
Inject apc
Resume thread

Disassembly:
sub esp, 0x54
push ebx
mov ebx, dword [esp + 0x5c]
mov eax, edx
push ebp
mov dword [esp + 0x28], eax
xor ebp, ebp
push esi
mov eax, dword [eax]
add eax, 2
mov dword [esp + 0xc], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x20], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], eax
push edi
mov edi, ecx
test ebx, ebx
je 0x51619f
mov eax, dword [ebx]
add eax, 2
mov dword [esp + 0x18], eax
push 0
lea eax, [esp + 0x28]
push eax
push 0
push str.RtlExitUserThread
push 0x6309f4
push edi
call sym.SystemInformer.exe_Ordinal_1525
mov esi, eax
test esi, esi
js 0x516379
push 0
lea eax, [esp + 0x30]
push eax
push 0
push str.SetEnvironmentVariableW
push 0x6309fc
push edi
lfence
call sym.SystemInformer.exe_Ordinal_1525
mov esi, eax
test esi, esi
js 0x516379
push 4
push 0x1000
lea eax, [esp + 0x28]
push eax
push 0
lea eax, [esp + 0x20]
push eax
push edi
lfence
call dword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
mov esi, eax
test esi, esi
js 0x516379
mov eax, dword [esp + 0x30]
push 0
lfence
push dword [eax]
push dword [eax + 4]
push dword [esp + 0x1c]
push edi
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x516379
test ebx, ebx
je 0x516288
push 4
push 0x1000
lea eax, [esp + 0x20]
push eax
push 0
lea eax, [esp + 0x24]
push eax
push edi
lfence
call dword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
mov esi, eax
test esi, esi
js 0x516379
push 0
lfence
push dword [ebx]
push dword [ebx + 4]
push dword [esp + 0x20]
push edi
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x516379
cmp dword [0x62db64], 0x3e
jb 0x5162ad
lea edx, [esp + 0x1c]
mov ecx, edi
lfence
call fcn.0051df40
mov ebp, dword [esp + 0x1c]
mov esi, eax
test esi, esi
js 0x51633a
push 0
lea eax, [esp + 0x2c]
push eax
push 0
lfence
push dword [esp + 0x30]
push 0
push 0
push ecx
push 1
mov ecx, edi
call fcn.004fe940
mov ebx, dword [esp + 0x28]
mov esi, eax
test esi, esi
js 0x51632f
push 0
push dword [esp + 0x18]
push dword [esp + 0x18]
push dword [esp + 0x38]
push ebx
call dword [sym.imp.ntdll.dll_NtQueueApcThread]
mov esi, eax
test esi, esi
js 0x51632f
push 0
push ebx
call dword [sym.imp.ntdll.dll_NtResumeThread]
mov esi, eax
test esi, esi
js 0x51632f
push dword [esp + 0x6c]
push 0
push ebx
call dword [sym.imp.ntdll.dll_NtWaitForSingleObject]
mov esi, eax
test esi, esi
js 0x51632f
push 0
push 0x1c
lea eax, [esp + 0x4c]
push eax
push 0
push ebx
call dword [sym.imp.ntdll.dll_NtQueryInformationThread]
mov esi, eax
test esi, esi
cmovns esi, dword [esp + 0x44]
test ebx, ebx
je 0x51633a
push ebx
call dword [sym.imp.ntdll.dll_NtClose]
test ebp, ebp
je 0x516379
push 0
push 0
push 0x10
lea eax, [esp + 0x40]
xorps xmm0, xmm0
movups xmmword [esp + 0x40], xmm0
push eax
push 0x2c
mov dword [esp + 0x48], ebp
mov dword [esp + 0x4c], 3
mov byte [esp + 0x50], 0
mov dword [esp + 0x54], 0
call dword [sym.imp.ntdll.dll_NtPowerInformation]
push ebp
call dword [sym.imp.ntdll.dll_NtClose]
cmp dword ds:[esp + 0x10], 0
je 0x5163a6
push 0x8000
lea eax, [esp + 0x24]
mov dword [esp + 0x24], 0
push eax
lea eax, [esp + 0x18]
push eax
push edi
call dword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
cmp dword [esp + 0x14], 0
je 0x5163cb
push 0x8000
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
lea eax, [esp + 0x1c]
push eax
push edi
call dword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret 8