Function at 0x402510
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x550
mov eax, dword [0x493afc]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x608]
movzx edx, word [ecx]
mov dword [ebp - 0x114], edx
cmp dword [ebp - 0x114], 0
je 0x40254a
mov eax, dword [ebp + 8]
cmp dword [eax + 0x60c], 0x60
ja 0x402566
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x610], 1
mov eax, 0xfffffffe
jmp 0x4027ca
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x608]
movzx ecx, word [eax + 2]
mov dword [ebp - 0x144], ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x608]
movzx ecx, word [eax + 0x3c]
mov dword [ebp - 0x128], ecx
push 0x10
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x608]
add eax, 0x40
push eax
lea ecx, [ebp - 0x140]
push ecx
call fcn.0045b6d0
add esp, 0xc
push 4
push 0x3000
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x60c]
sub eax, 0x60
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x12c], eax
cmp dword [ebp - 0x12c], 0
jne 0x4025ea
push str.Fatal_error:_not_enough_memory
call fcn.0045baba
add esp, 4
or eax, 0xffffffff
jmp 0x4027ca
mov ecx, dword [ebp + 0xc]
cmp dword [ecx + 0x80], 6
jae 0x402666
push 0
lea edx, [ebp - 0x124]
push edx
push 0x10
lea eax, [ebp - 0x140]
push eax
push 0x40
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.0040c060
push eax
call fcn.0040bf10
add esp, 0x1c
lea edx, [ebp - 0x124]
push edx
push 0x10
lea eax, [ebp - 0x550]
push eax
call fcn.0040b100
add esp, 0xc
mov ecx, dword [ebp - 0x12c]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x608]
add eax, 0x60
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x60c]
sub edx, 0x60
push edx
lea eax, [ebp - 0x550]
push eax
call fcn.0040ac40
add esp, 0x10
jmp 0x4026d8
lea ecx, [ebp - 0x100]
push ecx
push 0x80
mov edx, dword [ebp + 0xc]
add edx, 0x40
push edx
call fcn.0040a7b0
add esp, 0xc
push 0x10
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x608]
add ecx, 0x40
push ecx
lea edx, [ebp - 0x110]
push edx
call fcn.0045b6d0
add esp, 0xc
push 0
lea eax, [ebp - 0x110]
push eax
lea ecx, [ebp - 0x100]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x60c]
sub eax, 0x60
push eax
mov ecx, dword [ebp - 0x12c]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x608]
add eax, 0x60
push eax
call fcn.00409b00
add esp, 0x18
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x614], 1
push 0x10
mov edx, dword [ebp - 0x12c]
push edx
mov eax, dword [ebp + 8]
add eax, 0x628
push eax
call fcn.0045b6d0
add esp, 0xc
mov ecx, dword [ebp - 0x12c]
add ecx, 0x48
mov dword [ebp - 0x130], ecx
mov edx, dword [ebp - 0x114]
push edx
mov eax, dword [ebp - 0x130]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.0045b6d0
add esp, 0xc
mov eax, dword [ebp - 0x114]
shr eax, 1
xor edx, edx
mov ecx, 2
div ecx
mov eax, dword [ebp - 0x114]
lea ecx, [eax + edx*2]
add ecx, dword [ebp - 0x130]
mov dword [ebp - 0x130], ecx
mov edx, dword [ebp - 0x144]
push edx
mov eax, dword [ebp - 0x130]
push eax
mov ecx, dword [ebp + 8]
add ecx, 0x404
push ecx
call fcn.0045b6d0
add esp, 0xc
mov eax, dword [ebp - 0x144]
shr eax, 1
xor edx, edx
mov ecx, 2
div ecx
mov eax, dword [ebp - 0x144]
lea ecx, [eax + edx*2]
add ecx, dword [ebp - 0x130]
mov dword [ebp - 0x130], ecx
mov edx, dword [ebp - 0x128]
push edx
mov eax, dword [ebp - 0x130]
push eax
mov ecx, dword [ebp + 8]
add ecx, 0x202
push ecx
call fcn.0045b6d0
add esp, 0xc
push 0x8000
push 0
mov edx, dword [ebp - 0x12c]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045b6bb
mov esp, ebp
pop ebp
ret