Function at 0x10009840
Capabilities:
Allocate or change rwx memory
Get system information on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x10a0
call fcn.10064fe0
mov eax, dword [0x100bc570]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword fs:[0x2c]
mov ecx, dword [0x10194644]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x100c034c]
mov esi, dword [ebp + 0x18]
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x1018], ebx
mov dword [ebp - 0x102c], edi
mov dword [ebp - 0x1020], ecx
cmp eax, dword [ecx + 4]
jg 0x10009c0c
cmp dword [ebp + 0x14], 0
mov ecx, 1
mov dword [ebp - 0x1014], ecx
je 0x100098d1
test esi, esi
je 0x100098d1
push dword [ebp + 0x10]
push ebx
push esi
call fcn.10009710
add esp, 0xc
test eax, eax
jne 0x100098cc
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10064a7b
mov esp, ebp
pop ebp
ret
mov ecx, 1
mov edx, dword [ebp + 0x10]
test edx, edx
je 0x10009bf9
nop dword [eax]
mov eax, dword [0x100c0344]
mov esi, 0x1000
cmp edx, esi
cmovb esi, edx
mov edx, dword [ebp - 0x1020]
mov ecx, esi
mov dword [ebp - 0x1028], esi
mov dword [ebp - 0x1008], ecx
cmp eax, dword [edx + 4]
jg 0x10009c61
jmp 0x10009917
mov ecx, dword [ebp - 0x1008]
xor eax, eax
mov dword [ebp - 0x101c], 0
mov dword [ebp - 0x100c], eax
lea ebx, [ebp - 0x1004]
mov eax, 1
test esi, esi
je 0x10009a59
nop dword [eax]
mov esi, dword [0x100c0340]
xor edx, edx
mov eax, edi
mov dword [ebp - 0x1010], 1
div esi
sub esi, edx
cmp ecx, esi
cmovle esi, ecx
test edi, edi
je 0x100099be
push 0x1c
lea eax, [ebp - 0x1048]
mov dword [ebp - 0x1030], 0
xorps xmm0, xmm0
push eax
push edi
movups xmmword [ebp - 0x1048], xmm0
movq qword [ebp - 0x1038], xmm0
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x100099be
cmp dword [ebp - 0x1038], 0x1000
jne 0x100099be
test byte [ebp - 0x1034], 0xee
je 0x100099be
mov ecx, dword [ebp - 0x103c]
cmp esi, ecx
ja 0x100099be
mov eax, edi
sub ecx, esi
sub eax, dword [ebp - 0x1048]
cmp eax, ecx
jbe 0x100099f9
lea eax, [ebp - 0x101c]
push eax
push 0x40
push esi
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x100099ef
push esi
push eax
push ebx
mov dword [ebp - 0x1010], eax
call fcn.100663f0
mov ecx, dword [ebp - 0x100c]
mov dword [ebp - 0x100c], ecx
jmp 0x10009a07
mov dword [ebp - 0x100c], 1
push esi
push edi
push ebx
call fcn.10065e70
mov ecx, dword [ebp - 0x100c]
add esp, 0xc
test ecx, ecx
je 0x10009a35
lea eax, [ebp - 0x1054]
push eax
push dword [ebp - 0x101c]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x10009a35
push edi
push str.__page_read___could_not_restore_original_permissions_for_ptr__p_n
call fcn.1000a0a0
add esp, 8
mov ecx, dword [ebp - 0x1008]
add ebx, esi
add edi, esi
sub ecx, esi
mov dword [ebp - 0x1008], ecx
jne 0x10009940
mov eax, dword [ebp - 0x1010]
mov esi, dword [ebp - 0x1028]
mov edx, dword [ebp - 0x1020]
xor ecx, ecx
test eax, eax
mov eax, dword [0x100c033c]
cmovne ecx, dword [ebp - 0x1014]
mov dword [ebp - 0x1014], ecx
mov ecx, esi
mov dword [ebp - 0x1008], ecx
cmp eax, dword [edx + 4]
jg 0x10009cb6
jmp 0x10009a91
mov ecx, dword [ebp - 0x1008]
mov edi, dword [ebp - 0x1018]
lea ebx, [ebp - 0x1004]
mov dword [ebp - 0x1024], 0
mov eax, 1
mov dword [ebp - 0x1010], 0
test esi, esi
je 0x10009bc4
nop
mov esi, dword [0x100c0338]
xor edx, edx
mov eax, edi
mov dword [ebp - 0x100c], 1
div esi
sub esi, edx
cmp ecx, esi
cmovle esi, ecx
test edi, edi
je 0x10009b3e
push 0x1c
lea eax, [ebp - 0x1048]
mov dword [ebp - 0x1030], 0
xorps xmm0, xmm0
push eax
push edi
movups xmmword [ebp - 0x1048], xmm0
movq qword [ebp - 0x1038], xmm0
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x10009b3e
cmp dword [ebp - 0x1038], 0x1000
jne 0x10009b3e
test byte [ebp - 0x1034], 0xcc
je 0x10009b3e
mov ecx, dword [ebp - 0x103c]
cmp esi, ecx
ja 0x10009b3e
mov eax, edi
sub ecx, esi
sub eax, dword [ebp - 0x1048]
cmp eax, ecx
jbe 0x10009b65
lea eax, [ebp - 0x1024]
push eax
push 0x40
push esi
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x10009b5b
mov dword [ebp - 0x100c], eax
jmp 0x10009b70
mov dword [ebp - 0x1010], 1
push esi
push ebx
push edi
call fcn.10065e70
add esp, 0xc
cmp dword [ebp - 0x1010], 0
je 0x10009ba0
lea eax, [ebp - 0x1058]
push eax
push dword [ebp - 0x1024]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x10009ba0
push edi
push str.__page_write___could_not_restore_original_permissions_for_ptr__p_n
call fcn.1000a0a0
add esp, 8
mov ecx, dword [ebp - 0x1008]
add edi, esi
add ebx, esi
sub ecx, esi
mov dword [ebp - 0x1008], ecx
jne 0x10009ac0
mov eax, dword [ebp - 0x100c]
mov esi, dword [ebp - 0x1028]
mov edx, dword [ebp + 0x10]
xor ecx, ecx
mov edi, dword [ebp - 0x102c]
test eax, eax
cmovne ecx, dword [ebp - 0x1014]
sub edx, esi
add dword [ebp - 0x1018], esi
add edi, esi
mov dword [ebp - 0x1014], ecx
mov dword [ebp + 0x10], edx
mov dword [ebp - 0x102c], edi
test edx, edx
jne 0x100098e0
mov eax, ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10064a7b
mov esp, ebp
pop ebp
ret
push 0x100c034c
call fcn.10064f73
add esp, 4
cmp dword [0x100c034c], 0xffffffff
jne 0x10009895
mov eax, dword [0x100bbae0]
cmp eax, 0xffffffff
jne 0x10009c4a
lea eax, [ebp - 0x1050]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [ebp - 0x104c]
mov dword [0x100bbae0], eax
jmp 0x10009c4a
push 0x100c034c
mov dword [0x100c0348], eax
call fcn.10064f22
add esp, 4
jmp 0x10009895
push 0x100c0344
call fcn.10064f73
add esp, 4
cmp dword [0x100c0344], 0xffffffff
jne 0x10009911
mov eax, dword [0x100bbae0]
cmp eax, 0xffffffff
jne 0x10009c9f
lea eax, [ebp - 0x107c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [ebp - 0x1078]
mov dword [0x100bbae0], eax
jmp 0x10009c9f
push 0x100c0344
mov dword [0x100c0340], eax
call fcn.10064f22
add esp, 4
jmp 0x10009911
push 0x100c033c
call fcn.10064f73
add esp, 4
cmp dword [0x100c033c], 0xffffffff
jne 0x10009a8b
mov eax, dword [0x100bbae0]
cmp eax, 0xffffffff
jne 0x10009cf4
lea eax, [ebp - 0x10a0]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [ebp - 0x109c]
mov dword [0x100bbae0], eax
jmp 0x10009cf4
push 0x100c033c
mov dword [0x100c0338], eax
call fcn.10064f22
add esp, 4
jmp 0x10009a8b