Function at 0x406300
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0xc]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x28]
mov eax, dword [edx + 0x50]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], 0
push 0x40
push 0x3000
mov ecx, dword [ebp - 0x10]
push ecx
push 0
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
je 0x4064ba
push 0x40
push 0x3000
mov eax, dword [ebp - 0x10]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 0x2c]
push eax
call fcn.0040a470
add esp, 0xc
cmp dword [ebp - 0x2c], 0
je 0x406498
mov ecx, dword [ebp - 0x28]
add ecx, 0xa0
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 4], 0
jbe 0x406487
mov eax, dword [ebp - 0x1c]
cmp dword [eax], 0
jbe 0x406487
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x30]
sub edx, dword [ecx + 0x34]
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp + 0xc]
sub ecx, dword [eax + 0x34]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x2c]
add eax, dword [edx]
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x24]
cmp dword [ecx], 0
je 0x406460
mov edx, dword [ebp - 0x24]
cmp dword [edx + 4], 8
jb 0x40644f
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + 4]
sub ecx, 8
shr ecx, 1
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x24]
add edx, 8
mov dword [ebp - 0x18], edx
mov dword [ebp - 0xc], 0
jmp 0x406400
mov eax, dword [ebp - 0xc]
add eax, 1
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp - 0x20]
jae 0x40644f
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
movzx ecx, word [eax + edx*2]
test ecx, ecx
jle 0x40644d
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
movzx ecx, word [eax + edx*2]
and ecx, 0xfff
mov edx, dword [ebp - 0x24]
mov eax, dword [edx]
add eax, ecx
add eax, dword [ebp - 0x2c]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx]
sub edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov dword [eax], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx]
add edx, dword [ebp - 0x34]
mov eax, dword [ebp - 4]
mov dword [eax], edx
jmp 0x4063f7
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x24]
add edx, dword [ecx + 4]
mov dword [ebp - 0x24], edx
jmp 0x4063c2
push 0
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x2c]
push ecx
mov edx, dword [ebp - 0x30]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
neg eax
sbb eax, eax
neg eax
mov dword [ebp - 0x14], eax
jne 0x406487
xor eax, eax
jmp 0x4064bd
push 0x8000
push 0
mov ecx, dword [ebp - 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
cmp dword [ebp - 0x14], 0
jne 0x4064ba
push 0x8000
push 0
mov edx, dword [ebp - 0x30]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov dword [ebp - 0x30], 0
mov eax, dword [ebp - 0x30]
mov esp, ebp
pop ebp
ret