Function at 0x456890
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
push esi
push edi
lea edi, [edx + 0x1f]
mov ebx, ecx
and edi, 0xffffffe0
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], edi
jne 0x4568b2
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea esi, [ebx + 4]
push esi
mov dword [ebp - 0x2c], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [ebx + 0x3c]
mov eax, dword [ebx + 0x1c]
mov dword [ebp - 4], edx
mov dword [ebp - 0x30], eax
test edx, edx
je 0x4569d6
mov eax, dword [edx + 0x18]
sub eax, dword [edx + 0x1c]
cmp eax, edi
jb 0x4569b5
mov ecx, dword [edx + 0x28]
cmp ecx, edi
jae 0x4568f0
test ecx, ecx
jne 0x4569b5
mov eax, dword [edx + 0x2c]
xor ecx, ecx
mov edi, dword [edx + 0x20]
xor ebx, ebx
mov dword [ebp - 0x18], eax
mov eax, dword [edx + 0x24]
mov edx, dword [ebp - 0x10]
dec edx
mov dword [ebp - 0x24], eax
add eax, edx
mov dword [ebp - 0x20], edi
xor edx, edx
div dword [ebp - 0x24]
xor edx, edx
mov dword [ebp - 8], eax
mov dword [ebp - 0x14], edx
test edi, edi
je 0x45699b
nop dword [eax]
mov edi, dword [ebp - 0x18]
mov eax, dword [edi]
add edi, 4
mov dword [ebp - 0x18], edi
lea edi, [edx + 0x20]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x1c], edi
cmp eax, 0xffffffff
jne 0x456949
cmp ecx, ebx
mov dword [ebp - 0x14], edi
mov edx, edi
cmovbe ecx, ebx
mov ebx, ecx
xor ecx, ecx
jmp 0x456996
mov eax, dword [ebp - 0x20]
mov edi, 0x20
cmp dword [ebp - 0x1c], eax
jbe 0x45695a
mov edi, eax
sub edi, edx
xor eax, eax
lea edx, [eax + 1]
test edi, edi
je 0x456990
mov esi, dword [ebp - 0x2c]
inc eax
test dword [ebp - 0x28], edx
jne 0x456981
inc ecx
cmp ecx, dword [ebp - 8]
jne 0x45698a
mov ebx, dword [ebp - 0x14]
sub eax, ecx
mov edi, dword [ebp - 4]
add ebx, eax
jmp 0x456ae8
cmp ecx, ebx
cmovbe ecx, ebx
mov ebx, ecx
xor ecx, ecx
add edx, edx
cmp eax, edi
jb 0x456963
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x14], edx
cmp edx, dword [ebp - 0x20]
jb 0x456920
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 4]
mov edi, dword [ebp - 0x10]
imul eax, ebx
mov ebx, dword [ebp - 0xc]
mov dword [edx + 0x28], eax
mov edx, dword [edx + 0x14]
mov dword [ebp - 4], edx
jmp 0x4569ce
mov ecx, dword [edx + 0x14]
cmp eax, dword [ebp - 0x30]
jae 0x4569c9
cmp edx, dword [ebx + 0x3c]
jne 0x4569c9
test ecx, ecx
je 0x4569c9
mov dword [ebx + 0x3c], ecx
mov edx, ecx
mov dword [ebp - 4], ecx
test edx, edx
jne 0x4568d3
mov eax, dword [ebx + 0x1c]
cmp eax, dword [ebp - 0x10]
cmovae edi, eax
mov eax, dword [ebx + 0x20]
mov ebx, dword [ebx]
mov dword [ebp - 0x24], eax
test edi, edi
je 0x456b7a
call fcn.00456160
test ebx, ebx
jne 0x4569fb
mov ebx, dword [eax + 8]
mov eax, dword [eax]
dec edi
push 0x40
add edi, eax
neg eax
push 0x3000
and edi, eax
push edi
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebp - 0x20], eax
test eax, eax
je 0x456b7a
xor edx, edx
mov eax, edi
div dword [ebp - 0x24]
push 0x34
mov dword [ebp - 0x30], eax
lea ebx, [eax + 7]
shr ebx, 3
add ebx, 3
and ebx, 0xfffffffc
mov dword [ebp - 0x28], ebx
call fcn.005231b7
mov dword [ebp - 4], eax
lea eax, [ebx + ebx]
push eax
mov dword [ebp - 0x2c], eax
call fcn.005231b7
mov ecx, dword [ebp - 4]
add esp, 8
mov ebx, eax
test ecx, ecx
je 0x456b3a
test ebx, ebx
je 0x456b3a
push dword [ebp - 0x2c]
mov eax, dword [ebp - 0x20]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x30]
mov dword [ecx + 0x20], eax
mov eax, dword [ebp - 0x24]
push 0
push ebx
mov dword [ecx], 0
mov dword [ecx + 4], 0
mov dword [ecx + 0xc], 1
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 0
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x1c], 0
mov dword [ecx + 0x24], eax
mov dword [ecx + 0x28], edi
call fcn.00513df0
mov edi, dword [ebp - 4]
add esp, 0xc
mov eax, dword [ebp - 0x28]
mov edx, edi
mov ecx, dword [ebp - 0xc]
add eax, ebx
mov dword [edi + 0x2c], ebx
mov dword [edi + 0x30], eax
call fcn.004563a0
mov eax, dword [ebp - 0x10]
xor edx, edx
dec eax
mov ecx, dword [ebp - 0xc]
add eax, dword [edi + 0x24]
xor ebx, ebx
div dword [edi + 0x24]
mov dword [ebp - 8], eax
mov eax, dword [edi + 0x18]
add dword [ecx + 0x28], eax
push dword [ebp - 8]
mov ecx, dword [edi + 0x2c]
mov edx, ebx
call fcn.00456320
mov eax, dword [ebp - 8]
mov edx, ebx
mov ecx, dword [edi + 0x30]
dec eax
push eax
call fcn.00456320
mov eax, dword [edi + 0x24]
add esp, 8
imul eax, dword [ebp - 8]
mov ecx, dword [ebp - 0xc]
mov dword [edi + 0x28], 0
push esi
add dword [edi + 0x1c], eax
add dword [ecx + 0x2c], eax
mov edi, dword [edi + 0x24]
mov eax, dword [ebp - 4]
imul edi, ebx
add edi, dword [eax + 8]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xc]
mov edi, dword [eax]
call fcn.00456160
test edi, edi
jne 0x456b4b
mov edi, dword [eax + 8]
mov eax, dword [ebp - 0x20]
push 0x8000
push 0
push eax
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov eax, dword [ebp - 4]
test eax, eax
je 0x456b6d
push eax
call fcn.00520056
add esp, 4
test ebx, ebx
je 0x456b7a
push ebx
call fcn.00520056
add esp, 4
push esi
xor edi, edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret