Function at 0x502ad4
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd0
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x2c], ebx
mov ebx, ecx
test ebx, ebx
js 0x502af7
shr ebx, 2
mov esi, dword [edx + ebx*4]
dec ebx
push esi
jns 0x502af0
mov edx, esp
mov dword [ebp - 0x28], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x502e43
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [0x5338a4]
push eax
mov eax, dword [0x533a40]
push eax
mov eax, dword [0x5339bc]
push eax
mov ecx, dword [0x5339e0]
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
call fcn.004ebbec
mov dword [0x5339e8], eax
mov eax, dword [0x5338d4]
add eax, 0x8f
mov dword [0x533984], eax
mov eax, dword [0x5338c4]
add eax, dword [0x533a28]
mov dword [0x53385c], eax
jmp 0x502b6b
mov eax, dword [0x5338ec]
sub eax, 0x1f
mov dword [0x53395c], eax
imul eax, dword [0x53393c], 0x82
mov dword [0x533a18], eax
fild dword [0x5339e0]
call fcn.00407638
mov dword [0x5338ac], eax
mov eax, dword [0x53387c]
imul dword [0x5338d4]
mov dword [0x53394c], eax
mov eax, dword [0x5338f4]
imul dword [0x5339bc]
mov dword [0x5339f8], eax
lea eax, [ebp - 0x1c]
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
xor eax, eax
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xc
jge 0x502ca3
inc dword [ebp - 0x18]
mov eax, dword [0x53394c]
push eax
mov eax, dword [0x5338b4]
push eax
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [0x533a08]
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
call fcn.004f9168
mov eax, dword [0x533a00]
sub eax, dword [0x533a00]
mov dword [0x53396c], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x502c2b
mov eax, dword [ebp - 0x20]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0xc1
jne 0x502c41
lea eax, [ebp - 0x10]
mov edx, dword [ebp - 0x14]
call fcn.0040a01c
jmp 0x502c51
mov eax, dword [0x5338b4]
sub eax, dword [0x533884]
mov dword [0x53397c], eax
mov eax, dword [0x53391c]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
je 0x502c6a
mov eax, dword [ebp - 0x24]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0x5b
jle 0x502c8d
lea eax, [ebp - 0x18]
push eax
mov ecx, 0x53389c
lea edx, [ebp - 0x18]
mov eax, 0x53394c
call fcn.004f8190
mov dword [0x5339e8], eax
jmp 0x502c99
imul eax, dword [0x5338bc], 0x4e
mov dword [0x533a28], eax
cmp dword [ebp - 0x18], 0xc
jl 0x502be0
mov eax, dword [0x5338dc]
add eax, 0x7a
mov dword [0x533984], eax
imul eax, dword [0x53397c], 0x77
mov dword [0x533a38], eax
imul eax, dword [0x533a28], 0x73
mov dword [0x5338c4], eax
lea ecx, [ebp - 0x18]
mov edx, 0x5339d8
lea eax, [ebp - 0x18]
call fcn.004fde48
cmp byte [ebp - 9], 0
je 0x502e20
xor eax, eax
mov dword [ebp - 0x18], eax
lea ecx, [ebp - 0x18]
lea edx, [ebp - 0x18]
lea eax, [ebp - 0x18]
call fcn.004fde48
mov dword [0x5339ac], eax
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0xc
jne 0x502ce7
mov eax, dword [0x53397c]
add eax, 0x8d
mov dword [ebp - 0x30], eax
fild dword [ebp - 0x30]
call fcn.0040762c
mov dword [0x5339bc], eax
mov eax, 0xf0
sub eax, dword [0x5339d0]
mov dword [0x53386c], eax
mov eax, dword [0x5339bc]
imul dword [0x5338d4]
mov dword [0x53390c], eax
mov eax, dword [ebp - 0x18]
sub eax, dword [ebp - 0x18]
cmp eax, 0x26
jge 0x502d82
mov eax, dword [0x533a50]
mov dword [0x5339d0], eax
mov eax, dword [0x53393c]
mov dword [0x533a00], eax
mov eax, dword [0x5339d0]
cmp eax, dword [0x533a00]
jge 0x502d82
lea eax, [ebp - 0x18]
push eax
push 0x53398c
mov ecx, 0x53393c
lea edx, [ebp - 0x18]
lea eax, [ebp - 0x18]
call fcn.005028f8
mov eax, 0xab
sub eax, dword [0x533864]
mov dword [0x533a00], eax
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, 5
call fcn.00406fb0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x1c]
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, 0x65
sub eax, dword [0x5338e4]
mov dword [0x533984], eax
mov eax, dword [0x533934]
add eax, dword [0x533a18]
mov dword [0x533a48], eax
imul eax, dword [0x5338bc], 0xf7
mov dword [0x5338fc], eax
mov eax, dword [ebp - 0x18]
add eax, 0xc9
cmp eax, dword [ebp - 0x18]
jge 0x502e13
mov eax, dword [0x5339c4]
add eax, dword [0x5338f4]
mov edx, dword [0x53387c]
add edx, dword [0x5339c4]
cmp eax, edx
mov eax, dword [0x53387c]
add eax, 0x73
mov dword [0x5338a4], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x502e4a
lea eax, [ebp - 0x2c]
call fcn.00409bf4
lea eax, [ebp - 0x14]
mov edx, 2
call fcn.00409c54
ret