Function at 0x10004940
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x10056b28], eax
je 0x1000495d
mov eax, 0x10dd
mov esp, ebp
pop ebp
ret 8
mov eax, dword [0x10056b2c]
test eax, eax
jne 0x10004b30
push edi
mov edi, dword [ebp + 0xc]
test edi, edi
jne 0x1000497c
lea eax, [edi + 0x57]
pop edi
mov esp, ebp
pop ebp
ret 8
push esi
mov esi, dword [ebp + 8]
test esi, esi
je 0x10004999
cmp dword [esi], 0
jne 0x100049a6
mov dword [0x10056b2c], 6
mov dword [0x10056b30], esi
pop esi
mov eax, 6
pop edi
mov esp, ebp
pop ebp
ret 8
push ebx
push 0x18
call fcn.100090c2
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x100049bf
lea esi, [eax + 8]
jmp 0x10004b0e
mov esi, dword [esi]
test esi, esi
je 0x10004a2a
cmp byte [esi], 0xff
jne 0x100049e9
cmp byte [esi + 1], 0x25
jne 0x100049e9
mov eax, dword [esi + 2]
push eax
push esi
mov dword [ebp + 0xc], eax
call fcn.10004250
add esp, 8
test al, al
je 0x100049e9
mov esi, dword [ebp + 0xc]
mov esi, dword [esi]
cmp byte [esi], 0xeb
jne 0x10004a2a
movsx eax, byte [esi + 1]
add esi, 2
add esi, eax
mov al, byte [esi]
cmp al, 0xff
jne 0x10004a1e
cmp byte [esi + 1], 0x25
jne 0x10004a1e
mov eax, dword [esi + 2]
push eax
push esi
mov dword [ebp + 0xc], eax
call fcn.10004250
add esp, 8
test al, al
je 0x10004a2a
mov esi, dword [ebp + 0xc]
mov esi, dword [esi]
jmp 0x10004a2a
cmp al, 0xe9
jne 0x10004a2a
mov eax, dword [esi + 1]
add esi, 5
add esi, eax
cmp byte [edi], 0xff
jne 0x10004a4e
cmp byte [edi + 1], 0x25
jne 0x10004a4e
mov eax, dword [edi + 2]
push eax
push edi
mov dword [ebp + 0xc], eax
call fcn.10004250
add esp, 8
test al, al
je 0x10004a4e
mov edi, dword [ebp + 0xc]
mov edi, dword [edi]
cmp byte [edi], 0xeb
jne 0x10004a8f
movsx eax, byte [edi + 1]
add edi, 2
add edi, eax
mov al, byte [edi]
cmp al, 0xff
jne 0x10004a83
cmp byte [edi + 1], 0x25
jne 0x10004a83
mov eax, dword [edi + 2]
push eax
push edi
mov dword [ebp + 0xc], eax
call fcn.10004250
add esp, 8
test al, al
je 0x10004a8f
mov edi, dword [ebp + 0xc]
mov edi, dword [edi]
jmp 0x10004a8f
cmp al, 0xe9
jne 0x10004a8f
mov eax, dword [edi + 1]
add edi, 5
add edi, eax
movzx eax, byte [esi + 0x36]
mov ecx, dword [esi + 0x40]
sub ecx, eax
mov dword [ebp + 0xc], ecx
test eax, eax
je 0x10004b00
cmp eax, 0x1e
ja 0x10004b00
cmp dword [esi + 0x44], edi
jne 0x10004b00
lea edx, [ebp - 4]
mov dword [ebp - 4], 0
push edx
push 0x40
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x10004acc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x10004b0e
mov eax, dword [ebp + 8]
mov dword [ebx + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0xc], eax
mov dword [ebx + 0x10], esi
mov dword [ebx + 4], 1
mov eax, dword [ebp - 4]
mov dword [ebx + 0x14], eax
mov eax, dword [0x10056b38]
mov dword [ebx], eax
xor eax, eax
mov dword [0x10056b38], ebx
pop ebx
pop esi
pop edi
mov esp, ebp
pop ebp
ret 8
cmp dword [0x10056b20], 0
mov esi, 9
jne 0x10004b14
mov dword [0x10056b2c], esi
test ebx, ebx
je 0x10004b23
push 0x18
push ebx
call fcn.100093b2
add esp, 8
mov eax, dword [ebp + 8]
pop ebx
mov dword [0x10056b30], eax
mov eax, esi
pop esi
pop edi
mov esp, ebp
pop ebp
ret 8