Function at 0x4024ed
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x64
mov dword [ebp - 0x58], edx
mov edi, ecx
test ecx, ecx
je 0x4026f4
mov esi, eax
mov ecx, dword [0x407068]
test ecx, ecx
jle 0x402541
mov edx, dword [0x407064]
mov ebx, 0
mov dword [ebp - 0x54], edi
mov eax, dword [edx + 4]
cmp esi, eax
jb 0x402532
mov edi, dword [edx + 8]
add eax, dword [edi + 8]
cmp esi, eax
jb 0x402632
add ebx, 1
add edx, 0xc
cmp ebx, ecx
jne 0x40251d
mov edi, dword [ebp - 0x54]
jmp 0x402546
mov ebx, 0
mov dword [esp], esi
call fcn.00402ac6
mov dword [ebp - 0x54], eax
test eax, eax
jne 0x402565
mov dword [esp + 4], esi
mov dword [esp], str.Address__p_has_no_image_section
call fcn.004024a0
lea ebx, [ebx + ebx*2]
shl ebx, 2
mov eax, dword [0x407064]
add eax, ebx
mov dword [ebp - 0x5c], eax
mov edx, dword [ebp - 0x54]
mov dword [eax + 8], edx
mov dword [eax], 0
call fcn.00402b96
mov edx, dword [ebp - 0x54]
add eax, dword [edx + 0xc]
mov edx, dword [ebp - 0x5c]
mov dword [edx + 4], eax
mov dword [esp + 8], 0x1c
lea eax, [ebp - 0x4c]
mov dword [esp + 4], eax
mov eax, dword [0x407064]
mov eax, dword [eax + ebx + 4]
mov dword [esp], eax
call sub.kernel32.dll_VirtualQuery
sub esp, 0xc
test eax, eax
jne 0x4025dc
mov eax, dword [0x407064]
mov eax, dword [eax + ebx + 4]
mov dword [esp + 8], eax
mov edi, dword [ebp - 0x54]
mov eax, dword [edi + 8]
mov dword [esp + 4], eax
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
call fcn.004024a0
mov eax, dword [ebp - 0x38]
cmp eax, 4
je 0x402629
cmp eax, 0x40
je 0x402629
add ebx, dword [0x407064]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x40
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call sub.kernel32.dll_VirtualProtect
sub esp, 0x10
test eax, eax
jne 0x402629
call sub.kernel32.dll_GetLastError
mov dword [esp + 4], eax
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
call fcn.004024a0
add dword [0x407068], 1
jmp 0x402635
mov edi, dword [ebp - 0x54]
mov dword [esp + 8], 0x1c
lea eax, [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.kernel32.dll_VirtualQuery
sub esp, 0xc
test eax, eax
jne 0x40266b
mov dword [esp + 8], esi
mov dword [esp + 4], 0x1c
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
call fcn.004024a0
mov eax, dword [ebp - 0x18]
cmp eax, 4
je 0x4026e1
cmp eax, 0x40
je 0x4026e1
lea eax, [ebp - 0x30]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x40
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sub.kernel32.dll_VirtualProtect
sub esp, 0x10
mov dword [esp + 8], edi
mov edx, dword [ebp - 0x58]
mov dword [esp + 4], edx
mov dword [esp], esi
call sub.msvcrt.dll_memmove
mov eax, dword [ebp - 0x18]
cmp eax, 0x40
je 0x4026f4
cmp eax, 4
je 0x4026f4
lea eax, [ebp - 0x30]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sub.kernel32.dll_VirtualProtect
sub esp, 0x10
jmp 0x4026f4
mov dword [esp + 8], edi
mov edx, dword [ebp - 0x58]
mov dword [esp + 4], edx
mov dword [esp], esi
call sub.msvcrt.dll_memmove
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret