Function at 0x403340
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov dword [ebp - 0xc], 0
mov dword [ebp - 8], 0
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0xc]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [edx + 0x50]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
je 0x403382
xor eax, eax
jmp 0x403512
push 0x40
push 0x3000
mov eax, dword [ebp - 0x14]
push eax
push 0
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x4033a9
xor eax, eax
jmp 0x403512
mov edx, dword [ebp - 0x14]
push edx
push 8
mov eax, dword [0x407c0c]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x4033c9
jmp 0x4034e1
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.00401980
add esp, 0xc
mov ecx, 8
imul edx, ecx, 5
mov eax, dword [ebp - 0x18]
lea ecx, [eax + edx + 0x78]
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x20]
cmp dword [edx + 4], 0
jbe 0x4034c9
mov eax, dword [ebp - 0x20]
cmp dword [eax], 0
jbe 0x4034c9
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0xc]
sub edx, dword [ecx + 0x34]
mov dword [ebp - 0x30], edx
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp + 0xc]
sub ecx, dword [eax + 0x34]
mov dword [ebp - 0x2c], ecx
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 8]
add eax, dword [edx]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
cmp dword [ecx], 0
je 0x4034c9
mov edx, dword [ebp - 4]
cmp dword [edx + 4], 8
jb 0x4034b8
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 4]
sub ecx, 8
shr ecx, 1
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 4]
add edx, 8
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x10], 0
jmp 0x403469
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
cmp ecx, dword [ebp - 0x28]
jae 0x4034b8
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x24]
movzx ecx, word [eax + edx*2]
test ecx, ecx
jle 0x4034b6
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x24]
movzx ecx, word [eax + edx*2]
and ecx, 0xfff
mov edx, dword [ebp - 4]
mov eax, dword [edx]
add eax, ecx
add eax, dword [ebp - 8]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ecx]
sub edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x1c]
mov dword [eax], edx
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ecx]
add edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x1c]
mov dword [eax], edx
jmp 0x403460
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 4]
add edx, dword [ecx + 4]
mov dword [ebp - 4], edx
jmp 0x40342b
push 0
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov ecx, dword [ebp - 8]
push ecx
push 8
mov edx, dword [0x407c0c]
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [ebp - 0xc], 0
jne 0x40350f
push 0x8000
push 0
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov eax, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret