Function at 0x5021a8
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff84
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x74], ebx
mov ebx, ecx
test ebx, ebx
js 0x5021cb
shr ebx, 2
mov esi, dword [edx + ebx*4]
dec ebx
push esi
jns 0x5021c4
mov edx, esp
mov dword [ebp - 0x70], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x502500
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x64]
push eax
push 0x40
push 5
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_VirtualProtect
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 9], al
cmp byte [ebp - 9], 0
je 0x5024dd
imul eax, dword [ebp - 0x3c], 0x31
mov dword [ebp - 0x48], eax
mov eax, dword [0x534a40]
mov dword [0x5349e0], eax
mov eax, dword [0x534a40]
mov dword [0x5349e0], eax
mov eax, dword [0x5349e0]
cmp eax, dword [0x5349e0]
jge 0x502255
xor eax, eax
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x58], 7
jge 0x50225e
inc dword [ebp - 0x58]
mov eax, dword [0x53485c]
call fcn.004071f4
mov dword [0x53485c], eax
cmp dword [ebp - 0x58], 7
jl 0x50223b
jmp 0x50225e
mov eax, dword [ebp - 0x4c]
imul dword [ebp - 0x2c]
mov dword [ebp - 0x24], eax
mov eax, dword [0x534874]
mov dword [0x5348dc], eax
mov eax, dword [ebp - 0x60]
sub eax, 0x12
mov dword [ebp - 0x34], eax
fild dword [ebp - 0x40]
call fcn.0040762c
mov dword [ebp - 0x38], eax
imul eax, dword [ebp - 0x1c], 0x9a
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, 5
call fcn.00406fb0
mov eax, dword [ebp - 0x3c]
add eax, dword [ebp - 0x58]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x68], eax
cmp dword [ebp - 0x68], 0
je 0x5022b6
mov eax, dword [ebp - 0x68]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x68], eax
cmp dword [ebp - 0x68], 0xc8
jne 0x5022f8
mov eax, dword [ebp - 0x2c]
add eax, 0xb9
mov dword [ebp - 0x7c], eax
fild dword [ebp - 0x7c]
call fcn.0040762c
mov dword [ebp - 0x34], eax
xor eax, eax
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x60]
sub eax, dword [ebp - 0x30]
mov dword [ebp - 0x40], eax
inc dword [ebp - 0x38]
cmp dword [ebp - 0x38], 0xf
jne 0x5022da
mov eax, dword [0x5349d0]
mov dword [0x5349ac], eax
jmp 0x50233c
mov eax, dword [ebp - 0x50]
sub eax, dword [ebp - 0x48]
cmp eax, 0xbc
jge 0x502325
xor eax, eax
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 1
jge 0x50232f
inc dword [ebp - 0x4c]
mov eax, dword [0x53494c]
mov dword [0x53487c], eax
cmp dword [ebp - 0x4c], 1
jl 0x502310
jmp 0x50232f
imul eax, dword [ebp - 0x18], 0xbc
mov dword [ebp - 0x20], eax
mov eax, dword [0x5349e0]
add eax, 0x44
mov dword [0x5349d8], eax
mov eax, dword [ebp - 0x48]
add eax, 0xf
mov dword [ebp - 0x7c], eax
fild dword [ebp - 0x7c]
call fcn.0040762c
mov dword [ebp - 0x1c], eax
mov eax, dword [0x5348b4]
sub eax, 0x40
mov dword [0x5348bc], eax
lea eax, [ebp - 0x10]
push eax
xor ecx, ecx
mov edx, 1
mov eax, dword [ebp - 0x10]
call fcn.0040abd8
mov eax, dword [0x534a08]
add eax, 0x70
mov dword [0x53493c], eax
lea eax, [ebp - 0x64]
push eax
mov eax, dword [ebp - 0x64]
push eax
push 5
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_VirtualProtect
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 9], al
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x6c], eax
cmp dword [ebp - 0x6c], 0
je 0x5023b0
mov eax, dword [ebp - 0x6c]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x6c], eax
cmp dword [ebp - 0x6c], 0xb1
jle 0x502445
mov eax, dword [0x534a40]
mov dword [0x534864], eax
xor eax, eax
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xc
jge 0x5023f9
inc dword [ebp - 0x1c]
lea eax, [ebp - 0x18]
push eax
push 0x53490c
lea ecx, [ebp - 0x4c]
lea edx, [ebp - 0x3c]
mov eax, 0x5348a4
call fcn.004f80d8
mov dword [ebp - 0x28], eax
jmp 0x5023f9
mov eax, dword [0x534904]
call fcn.004071f4
mov dword [0x534904], eax
mov eax, dword [0x5349d0]
mov dword [0x53490c], eax
mov eax, dword [0x53490c]
cmp eax, dword [0x534904]
jle 0x50242a
mov eax, dword [ebp - 0x34]
shl eax, 5
mov dword [ebp - 0x40], eax
jmp 0x502431
imul eax, dword [ebp - 0x20], 0x5c
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x38]
add eax, 4
mov dword [ebp - 0x7c], eax
fild dword [ebp - 0x7c]
call fcn.00407638
mov dword [ebp - 0x54], eax
xor eax, eax
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 8
jge 0x50248f
inc dword [ebp - 0x18]
call fcn.00500764
mov dword [0x5348fc], eax
mov eax, dword [ebp - 0x44]
imul dword [ebp - 0x58]
mov dword [ebp - 0x24], eax
fild dword [ebp - 0x50]
call fcn.00407638
mov dword [ebp - 0x2c], eax
xor eax, eax
mov dword [ebp - 0x5c], eax
mov eax, dword [0x534884]
mov dword [0x53498c], eax
inc dword [ebp - 0x5c]
cmp dword [ebp - 0x5c], 1
jne 0x502476
cmp dword [ebp - 0x18], 8
jl 0x502450
mov eax, dword [0x5348c4]
mov dword [0x5349e8], eax
xor eax, eax
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0xf
jge 0x5024bd
inc dword [ebp - 0x4c]
mov eax, dword [0x534964]
imul dword [0x5349f8]
mov dword [0x53488c], eax
cmp dword [ebp - 0x4c], 0xf
jl 0x5024a4
mov eax, dword [0x53485c]
add eax, dword [0x534a28]
mov dword [0x534904], eax
mov eax, 0x50
sub eax, dword [0x5349f8]
mov dword [0x534984], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x502507
lea eax, [ebp - 0x74]
call fcn.00409bf4
lea eax, [ebp - 0x14]
mov edx, 2
call fcn.00409c54
ret