Function at 0x4058c0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
push edi
lea edi, [edx + 0x1f]
mov ebx, ecx
and edi, 0xffffffe0
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x18], edi
jne 0x4058e2
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea esi, [ebx + 4]
push esi
mov dword [ebp - 0x28], 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 - 0x2c], eax
test edx, edx
je 0x405a02
mov eax, dword [edx + 0x18]
sub eax, dword [edx + 0x1c]
cmp eax, edi
jb 0x4059de
mov ecx, dword [edx + 0x28]
cmp ecx, edi
jae 0x405920
test ecx, ecx
jne 0x4059de
mov eax, dword [edx + 0x20]
xor ecx, ecx
mov edi, dword [edx + 0x2c]
xor ebx, ebx
mov dword [ebp - 0x14], eax
mov eax, dword [edx + 0x24]
mov edx, dword [ebp - 0x18]
dec edx
mov dword [ebp - 0x20], eax
add eax, edx
xor edx, edx
div dword [ebp - 0x20]
xor edx, edx
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], edx
cmp dword [ebp - 0x14], ecx
jbe 0x4059c4
nop dword [eax + eax]
mov eax, dword [edi]
add edi, 4
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x1c], edi
cmp eax, 0xffffffff
jne 0x40596b
cmp ecx, ebx
cmovbe ecx, ebx
mov ebx, ecx
xor ecx, ecx
jmp 0x4059b9
lea eax, [edx + 0x20]
mov edi, 0x20
cmp eax, dword [ebp - 0x14]
jbe 0x40597d
mov edi, dword [ebp - 0x14]
sub edi, edx
xor eax, eax
lea edx, [eax + 1]
test edi, edi
je 0x4059b3
mov esi, dword [ebp - 0x28]
inc eax
test dword [ebp - 0x24], edx
jne 0x4059a4
inc ecx
cmp ecx, dword [ebp - 8]
jne 0x4059ad
mov ebx, dword [ebp - 0xc]
sub eax, ecx
mov edi, dword [ebp - 4]
add ebx, eax
jmp 0x405b0d
cmp ecx, ebx
cmovbe ecx, ebx
mov ebx, ecx
xor ecx, ecx
add edx, edx
cmp eax, edi
jb 0x405986
mov edi, dword [ebp - 0x1c]
mov edx, dword [ebp - 0xc]
add edx, 0x20
mov dword [ebp - 0xc], edx
cmp edx, dword [ebp - 0x14]
jb 0x405950
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 4]
mov edi, dword [ebp - 0x18]
imul eax, ebx
mov ebx, dword [ebp - 0x10]
mov dword [edx + 0x28], eax
mov edx, dword [edx + 0x14]
mov dword [ebp - 4], edx
jmp 0x4059f7
mov ecx, dword [edx + 0x14]
cmp eax, dword [ebp - 0x2c]
jae 0x4059f2
test ecx, ecx
je 0x4059f2
cmp edx, dword [ebx + 0x3c]
jne 0x4059f2
mov dword [ebx + 0x3c], ecx
mov edx, ecx
mov dword [ebp - 4], ecx
test edx, edx
jne 0x405903
mov eax, dword [ebx + 0x1c]
cmp eax, dword [ebp - 0x18]
cmovae edi, eax
mov eax, dword [ebx + 0x20]
mov ebx, dword [ebx]
mov dword [ebp - 0x20], eax
test edi, edi
je 0x405c72
call fcn.00405100
test ebx, ebx
jne 0x405a24
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 - 0x1c], eax
test eax, eax
je 0x405c72
xor edx, edx
mov eax, edi
div dword [ebp - 0x20]
push 0x34
mov dword [ebp - 0x2c], eax
lea ebx, [eax + 7]
shr ebx, 3
add ebx, 3
and ebx, 0xfffffffc
call fcn.004282a0
mov dword [ebp - 4], eax
lea eax, [ebx + ebx]
push eax
call fcn.004282a0
mov ecx, dword [ebp - 4]
add esp, 8
mov dword [ebp - 0x14], eax
test ecx, ecx
je 0x405c40
test eax, eax
je 0x405c40
mov edx, dword [ebp - 0x1c]
mov dword [ecx + 8], edx
mov edx, dword [ebp - 0x2c]
mov dword [ecx + 0x20], edx
mov edx, dword [ebp - 0x20]
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], edx
mov dword [ecx + 0x28], edi
lea ecx, [ebx + ebx]
push ecx
push 0
push eax
call fcn.004213e0
mov edi, dword [ebp - 4]
add esp, 0xc
mov eax, dword [ebp - 0x14]
mov edx, edi
mov ecx, dword [ebp - 0x10]
mov dword [edi + 0x2c], eax
add eax, ebx
mov dword [edi + 0x30], eax
call fcn.004053c0
mov eax, dword [ebp - 0x18]
xor edx, edx
dec eax
mov ecx, dword [ebp - 0x10]
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
mov dword [ebp - 0xc], ebx
cmp dword [ebp - 8], 0
mov ecx, dword [edi + 0x2c]
je 0x405b8c
mov edi, ebx
mov edx, ebx
mov ebx, dword [ebp - 8]
and edi, 0x1f
shr edx, 5
mov eax, 0x20
sub eax, edi
cmp eax, ebx
cmovbe ebx, eax
lea eax, [ecx + edx*4]
mov edx, dword [ebp - 8]
mov ecx, 0x20
mov dword [ebp - 0x18], eax
sub ecx, ebx
or eax, 0xffffffff
sub edx, ebx
shr eax, cl
mov ecx, edi
mov edi, dword [ebp - 0x18]
shl eax, cl
or dword [edi], eax
add edi, 4
mov dword [ebp - 0x18], edi
cmp edx, 0x20
jb 0x405b7a
mov ebx, edx
shr ebx, 5
or eax, 0xffffffff
mov ecx, ebx
rep stosd dword es:[edi], eax
mov edi, dword [ebp - 0x18]
lea edi, [edi + ebx*4]
nop
sub edx, 0x20
sub ebx, 1
jne 0x405b70
jmp 0x405b7d
or eax, 0xffffffff
test edx, edx
je 0x405b8c
mov ecx, 0x20
sub ecx, edx
shr eax, cl
or dword [edi], eax
mov ecx, dword [ebp - 8]
add ecx, 0xffffffff
je 0x405c0c
mov edx, dword [ebp - 0xc]
mov eax, 0x20
mov ebx, edx
mov edi, ecx
and ebx, 0x1f
sub eax, ebx
cmp eax, ecx
mov ecx, 0x20
cmovbe edi, eax
mov eax, dword [ebp - 4]
shr edx, 5
sub ecx, edi
mov eax, dword [eax + 0x30]
lea edx, [eax + edx*4]
or eax, 0xffffffff
shr eax, cl
mov ecx, ebx
shl eax, cl
or dword [edx], eax
add edx, 4
mov dword [ebp - 0x18], edx
mov edx, dword [ebp - 8]
dec edx
sub edx, edi
mov edi, dword [ebp - 0x18]
cmp edx, 0x20
jb 0x405bfa
mov ebx, edx
shr ebx, 5
or eax, 0xffffffff
mov ecx, ebx
rep stosd dword es:[edi], eax
mov edi, dword [ebp - 0x18]
lea edi, [edi + ebx*4]
nop
sub edx, 0x20
sub ebx, 1
jne 0x405bf0
jmp 0x405bfd
or eax, 0xffffffff
test edx, edx
je 0x405c0c
mov ecx, 0x20
sub ecx, edx
shr eax, cl
or dword [edi], eax
mov ecx, dword [ebp - 4]
mov ebx, dword [ebp - 0x10]
push esi
mov eax, dword [ecx + 0x24]
imul eax, dword [ebp - 8]
mov dword [ecx + 0x28], 0
add dword [ecx + 0x1c], eax
add dword [ebx + 0x2c], eax
mov edi, dword [ecx + 0x24]
imul edi, dword [ebp - 0xc]
add edi, dword [ecx + 8]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x1c]
push edi
push edx
push dword [ebx]
call sym.warface.exe_public:_static_unsigned_int___cdecl_asmjit::VMemUtil::releaseProcessMemory_void___void___unsigned_int_
mov eax, dword [ebp - 4]
add esp, 0xc
test eax, eax
je 0x405c62
push eax
call fcn.0042716d
add esp, 4
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x405c72
push eax
call fcn.0042716d
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