Function at 0x402d30
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x23c
mov eax, dword [0x410008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
push edi
mov dword [ebp - 0x23c], eax
mov ebx, edx
mov eax, dword [ebp + 0x14]
mov edi, ecx
push 0x21c
mov dword [ebp - 0x234], eax
lea eax, [ebp - 0x230]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov eax, 0x208
mov word [ebp - 0x222], ax
test edi, edi
je 0x402db3
mov ecx, 0x104
mov eax, edi
nop dword [eax]
cmp word [eax], 0
je 0x402d9e
add eax, 2
sub ecx, 1
jne 0x402d90
test ecx, ecx
je 0x402db3
mov eax, 0x104
sub eax, ecx
add eax, eax
neg ecx
sbb ecx, ecx
and ecx, eax
jmp 0x402db5
xor ecx, ecx
lea edx, [ebp - 0x21c]
mov esi, 0x104
mov eax, edx
sub edi, eax
lea eax, [esi + 0x7ffffefa]
test eax, eax
je 0x402de2
movzx eax, word [edi + edx]
test ax, ax
je 0x402de2
mov word [edx], ax
add edx, 2
sub esi, 1
jne 0x402dc4
lea eax, [edx - 2]
test esi, esi
cmovne eax, edx
xor edx, edx
mov dword [ebp - 8], edx
mov word [eax], dx
lea eax, [ebp - 8]
push eax
mov word [ebp - 0x224], cx
mov edx, str.ntdll.dll
push str.LdrLoadDll
mov ecx, ebx
call fcn.00401a90
add esp, 8
test al, al
jne 0x402e39
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x234]
mov dword [ecx], eax
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a480
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
mov esi, 0x402fd0
push 0x40
sub esi, 0x402f90
mov dword [ebp - 0x22c], eax
push 0x3000
lea eax, [esi + 0x22c]
push eax
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edi, eax
lea eax, [edi + 0x22b]
and eax, 0xfffffff0
mov dword [ebp - 0x238], eax
test edi, edi
jne 0x402e9b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x234]
mov dword [ecx], eax
lea eax, [edi + 0xd]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a480
mov esp, ebp
pop ebp
ret
push 0
push 0x21c
lea eax, [ebp - 0x230]
push eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x402ee8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x234]
push 0x8000
push 0
push edi
push ebx
mov dword [ecx], eax
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov eax, 9
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a480
mov esp, ebp
pop ebp
ret
push 0
push esi
push 0x402f90
push dword [ebp - 0x238]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x402eb5
mov ecx, dword [ebp - 0x234]
lea eax, [ebp - 0xc]
mov esi, dword [ebp + 8]
mov edx, dword [ebp - 0x238]
push eax
mov eax, dword [ebp + 0xc]
shr eax, 5
push ecx
and al, 1
mov dword [ebp - 0xc], 0
movzx eax, al
mov ecx, ebx
push eax
push esi
push edi
call fcn.00406fe0
add esp, 0x14
mov dword [ebp - 0x238], eax
lea eax, [ebp - 0x230]
push 0
push 0x21c
push eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov eax, dword [ebp - 0x23c]
mov ecx, dword [ebp - 0xc]
mov dword [eax], ecx
cmp esi, 3
je 0x402f6f
push 0x8000
push 0
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x238]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0040a480
mov esp, ebp
pop ebp
ret