Function at 0x10008060
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0x74
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
test eax, eax
je 0x10008261
mov edi, dword [eax]
test edi, edi
je 0x10008261
test ebx, ebx
je 0x10008261
xor esi, esi
call fcn.10007c50
mov eax, edi
call fcn.10007ca0
mov edi, eax
mov eax, ebx
call fcn.10007ca0
mov dword [ebp + 0xc], eax
xor eax, eax
push 0x50
push eax
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x6c], eax
lea eax, [ebp - 0x68]
push eax
call fcn.1001acc0
add esp, 0xc
lea ecx, [ebp - 0x70]
push ecx
push edi
call fcn.10007f40
inc dword [0x10050318]
mov ebx, eax
add esp, 8
cmp ebx, 5
jb 0x10008242
mov edx, dword [ebp - 0x64]
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp - 0x6c]
push edx
mov edx, dword [ebp - 0x70]
push eax
push ecx
push edx
mov eax, edi
call fcn.10007d30
mov esi, eax
add esp, 0x10
test esi, esi
je 0x1000823c
call dword [sym.imp.KERNEL32.DLL_GetCurrentProcess]
xor ecx, ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], ecx
lea ecx, [ebp - 0xc]
push ecx
push 0x40
push ebx
push edi
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.DLL_VirtualProtectEx]
test eax, eax
je 0x10008211
mov eax, dword [ebp - 4]
lea edx, [ebp - 8]
push edx
push 0x40
push 0x6c
push esi
push eax
call dword [sym.imp.KERNEL32.DLL_VirtualProtectEx]
inc dword [0x10050318]
test eax, eax
je 0x100081ef
xor eax, eax
lea edx, [esi + 0x2c]
test ebx, ebx
je 0x10008169
mov ecx, edi
sub ecx, edx
mov dword [ebp - 0x14], ecx
jmp 0x1000815a
mov ecx, dword [ebp - 0x14]
mov cl, byte [ecx + edx]
mov byte [edx], cl
mov byte [esi + eax + 0x4c], cl
inc eax
inc edx
cmp eax, ebx
jb 0x10008157
lea ecx, [ebx + edi]
lea eax, [esi + ebx + 0x2c]
call fcn.10007ce0
mov ecx, dword [ebp + 0xc]
add dword [0x10050318], 2
cmp ecx, edi
jae 0x10008189
mov eax, edi
sub eax, ecx
jmp 0x1000818d
mov eax, ecx
sub eax, edi
cmp eax, 0x7fff0000
jbe 0x100081b3
lea eax, [esi + 0xc]
call fcn.10007ce0
mov ecx, dword [ebp - 4]
sub eax, esi
sub eax, 0xc
push eax
lea eax, [esi + 0xc]
push eax
push ecx
call dword [sym.imp.KERNEL32.DLL_FlushInstructionCache]
lea ecx, [esi + 0xc]
mov eax, edi
call fcn.10007ce0
mov edx, dword [ebp + 0xc]
inc dword [0x10050318]
push ebx
lea eax, [esi + 0x2c]
push eax
mov eax, dword [ebp - 4]
push eax
mov dword [esi + 4], ebx
mov dword [esi], edi
mov dword [esi + 8], edx
call dword [sym.imp.KERNEL32.DLL_FlushInstructionCache]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
lea ecx, [ebp - 8]
push ecx
push edx
push 0x6c
push esi
push eax
call dword [sym.imp.KERNEL32.DLL_VirtualProtectEx]
mov ecx, dword [ebp - 4]
push ebx
push edi
push ecx
call dword [sym.imp.KERNEL32.DLL_FlushInstructionCache]
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 4]
lea edx, [ebp - 0xc]
push edx
push eax
push ebx
push edi
push ecx
call dword [sym.imp.KERNEL32.DLL_VirtualProtectEx]
jmp 0x10008217
inc dword [0x10050318]
cmp dword [esi], 0
je 0x10008226
mov eax, dword [ebp + 8]
lea edx, [esi + 0x2c]
mov dword [eax], edx
jmp 0x10008242
inc dword [0x10050318]
push 1
mov edx, esi
call fcn.10007ec0
add esp, 4
xor esi, esi
jmp 0x10008242
inc dword [0x10050318]
push 0x100501d4
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
inc dword [0x10050318]
xor eax, eax
test esi, esi
setne al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
inc dword [0x10050318]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret