Function at 0x401350
Capabilities:
Access peb ldr_data
Allocate or change rwx memory
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x32c
mov eax, dword [0x413014]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x300]
push edi
mov edi, edx
mov dword [ebp - 0x30c], esi
push eax
push edi
mov dword [ebp - 0x314], edi
mov ebx, ecx
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x300], 0x10003
call dword [sym.imp.ntdll.dll_NtGetContextThread]
test eax, eax
js 0x4015c9
push 0x40
push 0x3000
lea eax, [ebp - 8]
mov dword [ebp - 8], 0x1000
push eax
push 0
lea eax, [ebp - 0x1c]
push eax
push ebx
call dword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
test eax, eax
js 0x4015c9
test esi, esi
je 0x4013d0
movzx esi, word [esi]
jmp 0x4013d2
xor esi, esi
xorps xmm0, xmm0
mov dword [ebp - 0x304], esi
movlpd qword [ebp - 0x320], xmm0
mov ecx, 0x401310
mov byte [ebp - 0x320], 1
mov edx, 0x8f8ed6b0
mov eax, dword [ebp - 0x320]
add eax, ecx
movlpd qword [ebp - 0x328], xmm0
mov dword [ebp - 0x310], eax
mov eax, 0x401340
sub eax, 0x401310
mov dword [ebp - 0x308], eax
mov eax, dword fs:[0x30]
mov eax, dword [eax + 0xc]
mov ecx, dword [eax + 0x1c]
mov ecx, dword [ecx + 8]
call fcn.004015e0
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x248]
mov dword [ebp - 0x30], eax
movzx eax, si
mov word [ebp - 0x28], ax
mov word [ebp - 0x26], ax
lea eax, [ecx + 0x10]
push 0
push 0x10
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x30]
push eax
push ecx
push ebx
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x4015a6
mov ecx, dword [ebp - 0x30c]
test ecx, ecx
je 0x401495
mov eax, dword [ebp - 0x1c]
push 0
push dword [ebp - 0x304]
add eax, 0x10
push dword [ecx + 4]
push eax
push ebx
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x4015a6
mov ecx, dword [ebp - 0x304]
mov eax, dword [ebp - 0x1c]
add ecx, 0x1f
push 0
push dword [ebp - 0x308]
add eax, ecx
push dword [ebp - 0x310]
and eax, 0xfffffff0
push eax
push ebx
mov dword [ebp - 0x248], eax
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x4015a6
push dword [ebp - 0x308]
push dword [ebp - 0x248]
push ebx
call dword [sym.imp.ntdll.dll_NtFlushInstructionCache]
lea eax, [ebp - 0x300]
push eax
push edi
call dword [sym.imp.ntdll.dll_NtSetContextThread]
mov esi, eax
test esi, esi
js 0x4015a6
lea eax, [ebp - 0x300]
push eax
push edi
call dword [sym.imp.ntdll.dll_NtGetContextThread]
push 0
push edi
call dword [sym.imp.ntdll.dll_NtResumeThread]
mov esi, eax
test esi, esi
js 0x4015a6
mov dword [ebp - 0x18], 0xffb3b4c0
mov edi, 0x1e
mov dword [ebp - 0x14], 0xffffffff
nop dword [eax + eax]
push 0
push 4
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 0x1c]
push ebx
call dword [sym.imp.ntdll.dll_NtReadVirtualMemory]
mov esi, eax
test esi, esi
js 0x4015a6
cmp dword [ebp - 0xc], 0
je 0x40155f
lea eax, [ebp - 0x18]
push eax
push 0
call dword [sym.imp.ntdll.dll_NtDelayExecution]
sub edi, 1
jne 0x401530
lea eax, [ebp - 0x18]
push eax
push 0
call dword [sym.imp.ntdll.dll_NtDelayExecution]
lea eax, [ebp - 0x300]
push eax
push dword [ebp - 0x314]
call dword [sym.imp.ntdll.dll_NtGetContextThread]
mov esi, eax
test esi, esi
js 0x4015a6
mov edx, dword [ebp - 0x248]
mov ecx, dword [ebp - 0x1c]
cmp edx, ecx
jb 0x4015a2
lea eax, [ecx + 0x1000]
cmp edx, eax
ja 0x4015a2
mov esi, 0xc0000001
jmp 0x4015a9
xor esi, esi
jmp 0x4015a9
mov ecx, dword [ebp - 0x1c]
push 0x8000
lea eax, [ebp - 0x10]
mov dword [ebp - 0x20], ecx
push eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x10], 0
push eax
push ebx
call dword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004018d7
mov esp, ebp
pop ebp
ret