Function at 0x10049f50
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x100517d5
push eax
mov dword fs:[0], esp
sub esp, 0x50
cmp byte [ebp + 8], 0
push ebx
push esi
mov esi, ecx
push edi
mov ecx, dword [esi + 0x38]
je 0x1004a21d
mov edx, dword [esi + 0x28]
mov dword [ebp - 0x10], edx
test ecx, ecx
jne 0x1004a1ad
mov edi, dword [esi + 0x18]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], ecx
sub esp, 0x10
mov dword [ebp - 4], ecx
lea eax, [ebp - 0x14]
mov ecx, edx
push eax
call fcn.1004a6b0
mov ecx, dword [esi + 0x28]
sub esp, 8
call fcn.10045870
push ecx
lea edx, [esi + 0x28]
mov ecx, edi
call fcn.10045a10
mov ecx, dword [esi + 0x28]
lea eax, [ebp - 0x14]
add esp, 4
lea ecx, [ecx + 0x28]
push eax
call fcn.100440d0
mov edi, dword [esi + 0x28]
lea ecx, [ebp - 0x30]
sub esp, 8
call fcn.10043600
lea eax, [ebp - 0x30]
push eax
push 0
push 0
lea ecx, [ebp - 0x5c]
call fcn.10043a80
lea eax, [ebp - 0x5c]
mov ecx, edi
push eax
push 0x10056568
call fcn.10044f80
mov edi, dword [esi + 0x28]
lea eax, [esi + 0x20]
push eax
lea eax, [ebp - 0x5c]
push eax
call fcn.10043b10
push 0x10056568
push eax
mov ecx, edi
call fcn.10044f80
mov ecx, dword [esi + 0x28]
push 0x58
sub esp, 0xc
call fcn.10044eb0
mov ecx, dword [esi + 0x28]
lea eax, [esi - 0x80]
mov edx, 0xfffffeff
cmp edx, eax
push esi
sbb eax, eax
and eax, 0xfffffff0
add eax, 0x2d0
add eax, ecx
push eax
call fcn.10044ed0
mov ecx, dword [esi + 0x28]
push 0x50
sub esp, 0xc
call fcn.10044eb0
mov ecx, dword [esi + 0x28]
sub esp, 0x10
push 0x1004a290
call fcn.10044ba0
mov eax, dword [esi + 0x28]
push dword [eax + 0x20]
push dword [eax + 0x1c]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov eax, dword [esi + 0x28]
mov edi, dword [eax + 0x1c]
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x1004a096
mov ecx, dword [ebp - 0x14]
test ecx, ecx
je 0x1004a096
lea edx, [ebp - 0x14]
push edx
push eax
call fcn.10043b60
mov dword [esi + 0x38], edi
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], 1
xor edi, edi
mov ebx, dword [esi + 0x18]
nop word [eax + eax]
lea edx, [ebp - 0x4c]
mov ecx, ebx
call fcn.1004ef6c
movzx eax, byte [ebp - 0x4c]
add edi, eax
add ebx, eax
cmp edi, 5
jb 0x1004a0c0
lea eax, [ebp + 8]
mov dword [esi + 0x24], edi
push eax
push 0x40
push edi
push dword [esi + 0x18]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x1004a198
mov edi, dword [esi + 0x24]
push edi
call fcn.1004fcf7
push edi
mov ebx, eax
push 0
push ebx
call sub.VCRUNTIME140.dll_memset
lea edi, [esi + 0x1c]
add esp, 0x10
lea eax, [ebp - 0x18]
cmp edi, eax
je 0x1004a11e
mov eax, dword [edi]
mov dword [edi], ebx
test eax, eax
je 0x1004a127
push eax
jmp 0x1004a11f
push ebx
call fcn.1004f8f8
add esp, 4
push dword [esi + 0x24]
push dword [esi + 0x18]
push dword [edi]
call sub.VCRUNTIME140.dll_memcpy
mov edi, dword [esi + 0x18]
mov ebx, 0xe9
mov edx, dword [esi + 0x38]
sub edx, edi
sub edx, 5
mov eax, dword [edi]
cmp al, 0xe8
movzx ecx, al
mov dword [ebp - 0x14], eax
cmovne ecx, ebx
mov dword [ebp - 0x13], edx
mov byte [ebp - 0x14], cl
mov eax, dword [ebp - 0x14]
mov dword [edi], eax
movzx eax, byte [ebp - 0x10]
mov byte [edi + 4], al
mov eax, dword [esi + 0x24]
sub eax, 5
push eax
mov eax, dword [esi + 0x18]
add eax, 5
push 0x90
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0x18
lea eax, [ebp + 8]
push eax
push 0x20
push dword [esi + 0x24]
push dword [esi + 0x18]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x1004a25d
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
cmp dword [edx + 0x18], 0
mov eax, dword [esi + 0x30]
mov ebx, dword [esi + 0x34]
mov dword [ebp + 8], eax
ja 0x1004a1da
push 0x486
push str.C:UsersAdministratorDesktopCharlinhoCharlenoexample_win32_directx9kthookxbyakxbyakxbyak.h
push str.offset___maxSize_
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
mov eax, dword [ebp + 8]
add esp, 0xc
mov edx, dword [ebp - 0x10]
mov edx, dword [edx + 0x1c]
mov ecx, eax
mov byte [edx], al
mov eax, ebx
shrd ecx, eax, 8
mov eax, ebx
mov byte [edx + 4], bl
mov byte [edx + 1], cl
mov ecx, dword [ebp + 8]
shrd ecx, eax, 0x10
mov eax, ebx
mov byte [edx + 2], cl
mov ecx, dword [ebp + 8]
shrd ecx, eax, 0x18
mov eax, ebx
shr eax, 8
mov byte [edx + 5], al
mov eax, ebx
shr eax, 0x10
shr ebx, 0x18
mov byte [edx + 3], cl
mov byte [edx + 6], al
mov byte [edx + 7], bl
jmp 0x1004a25d
test ecx, ecx
je 0x1004a25d
mov eax, dword [ecx]
mov edi, dword [esi + 0x28]
mov ecx, dword [ecx + 4]
mov dword [esi + 0x30], eax
mov dword [esi + 0x34], ecx
cmp dword [edi + 0x18], 0
ja 0x1004a24d
push 0x486
push str.C:UsersAdministratorDesktopCharlinhoCharlenoexample_win32_directx9kthookxbyakxbyakxbyak.h
push str.offset___maxSize_
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
add esp, 0xc
mov eax, dword [edi + 0x1c]
mov dword [eax], 0x90909090
mov dword [eax + 4], 0x90909090
mov eax, dword [esi + 0x28]
push dword [eax + 0x20]
push dword [esi + 0x38]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov ecx, dword [ebp - 0xc]
mov al, 1
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4