Function at 0x4046c0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x45e38d
mov eax, dword fs:[0]
push eax
sub esp, 0xac
mov eax, dword [0x46d040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x40], eax
mov byte [ebp - 0x1c], 0xc7
mov byte [ebp - 0x1b], 0x47
mov byte [ebp - 0x1a], 0x18
mov ecx, dword [ebp - 0x40]
and ecx, 0xff
mov byte [ebp - 0x19], cl
mov edx, dword [ebp - 0x40]
shr edx, 8
and edx, 0xff
mov byte [ebp - 0x18], dl
mov eax, dword [ebp - 0x40]
shr eax, 0x10
and eax, 0xff
mov byte [ebp - 0x17], al
mov ecx, dword [ebp - 0x40]
shr ecx, 0x18
and ecx, 0xff
mov byte [ebp - 0x16], cl
mov byte [ebp - 0x15], 0xf3
mov byte [ebp - 0x14], 0xf
mov byte [ebp - 0x13], 0x10
mov byte [ebp - 0x12], 0x47
mov byte [ebp - 0x11], 0x18
mov edx, dword [ebp + 0xc]
add edx, 0x149e5d9
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x3c], 0xc
movzx eax, byte [ebp + 0x10]
test eax, eax
je 0x404a73
cmp dword [0x508c4c], 0
jne 0x4047d0
mov ecx, dword [ebp - 0x3c]
add ecx, 0xa
mov dword [0x508c44], ecx
push 0x40
push 0x3000
mov edx, dword [0x508c44]
push edx
push 0
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [0x508c4c], eax
cmp dword [0x508c4c], 0
jne 0x4047d0
push 0x46057c
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push ecx
call fcn.004118c0
add esp, 8
mov dword [ebp - 0x54], eax
push 0x411d00
mov ecx, dword [ebp - 0x54]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
nop
jmp 0x404abd
mov edx, dword [0x508c4c]
mov dword [ebp - 0x50], edx
mov eax, dword [ebp - 0x44]
add eax, 5
mov dword [ebp - 0xa0], eax
mov ecx, dword [ebp - 0x44]
add ecx, 5
mov edx, dword [ebp - 0x50]
sub edx, ecx
mov dword [ebp - 0x34], edx
xor eax, eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
lea ecx, [ebp - 0x49]
mov dword [ebp - 0x58], ecx
mov edx, dword [ebp - 0x58]
mov dword [ebp - 0xb8], edx
mov eax, dword [0x508c44]
mov dword [ebp - 0x60], eax
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x5c], ecx
mov edx, dword [ebp - 0x5c]
mov dword [ebp - 0x48], edx
mov eax, dword [ebp - 0x48]
mov dword [eax], 0
mov ecx, dword [ebp - 0x48]
mov dword [ecx + 4], 0
mov edx, dword [ebp - 0x48]
mov dword [edx + 8], 0
mov eax, dword [ebp - 0x60]
push eax
lea ecx, [ebp - 0x30]
call fcn.004131b0
nop
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x64], ecx
mov edx, dword [ebp - 0x64]
mov dword [ebp - 0x68], edx
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x6c], eax
mov ecx, dword [ebp - 0x6c]
mov edx, dword [0x5082f4]
mov dword [ecx], edx
mov al, byte [0x5082f8]
mov byte [ecx + 4], al
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x70], ecx
mov edx, dword [ebp - 0x70]
mov dword [ebp - 0xb0], edx
mov eax, dword [ebp - 0xb0]
mov dword [ebp - 0xac], eax
mov ecx, dword [ebp - 0x3c]
push ecx
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0xac]
add eax, 5
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x50]
lea eax, [edx + ecx + 0xa]
mov ecx, dword [ebp - 0xa0]
sub ecx, eax
mov dword [ebp - 0x38], ecx
lea edx, [ebp - 0x30]
mov dword [ebp - 0x80], edx
mov eax, dword [ebp - 0x80]
mov ecx, dword [eax]
mov edx, dword [ebp - 0x3c]
lea eax, [ecx + edx + 5]
mov dword [ebp - 0xb4], eax
mov ecx, dword [ebp - 0xb4]
mov byte [ecx], 0xe9
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x74], edx
mov eax, dword [ebp - 0x74]
mov dword [ebp - 0x78], eax
mov ecx, dword [ebp - 0x78]
mov dword [ebp - 0x7c], ecx
mov edx, dword [ebp - 0x7c]
add edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x38]
mov dword [edx + 6], eax
mov ecx, dword [0x508c44]
mov dword [ebp - 0x90], ecx
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x84], edx
mov eax, dword [ebp - 0x84]
mov dword [ebp - 0x88], eax
mov ecx, dword [ebp - 0x88]
mov dword [ebp - 0x8c], ecx
mov edx, dword [ebp - 0x8c]
mov dword [ebp - 0x94], edx
mov eax, dword [0x508c4c]
mov dword [ebp - 0x98], eax
mov ecx, dword [ebp - 0x90]
push ecx
mov edx, dword [ebp - 0x94]
push edx
mov eax, dword [ebp - 0x98]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00403970
add esp, 0x10
movzx edx, al
test edx, edx
jne 0x4049cd
push str.Failed_to_write_trampoline_to_allocated_memory.
mov eax, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push eax
call fcn.004118c0
add esp, 8
mov dword [ebp - 0x9c], eax
push 0x411d00
mov ecx, dword [ebp - 0x9c]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
push 0x8000
push 0
mov ecx, dword [0x508c4c]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov dword [0x508c4c], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x30]
call fcn.004101d0
nop
jmp 0x404abd
mov byte [ebp - 0x24], 0xe9
xor eax, eax
mov dword [ebp - 0x23], eax
mov ecx, 1
shl ecx, 0
mov edx, dword [ebp - 0x34]
mov dword [ebp + ecx - 0x24], edx
push 5
lea eax, [ebp - 0x24]
push eax
mov ecx, dword [ebp - 0x44]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00403970
add esp, 0x10
movzx eax, al
test eax, eax
jne 0x404a61
push str.Failed_to_write_jump_to_trampoline_in_the_original_code.
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push ecx
call fcn.004118c0
add esp, 8
mov dword [ebp - 0xa4], eax
push 0x411d00
mov ecx, dword [ebp - 0xa4]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
push 0x8000
push 0
mov edx, dword [0x508c4c]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov dword [0x508c4c], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x30]
call fcn.004101d0
nop
jmp 0x404abd
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x30]
call fcn.004101d0
nop
jmp 0x404abd
push 5
push 0x5082f4
mov ecx, dword [ebp - 0x44]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00403970
add esp, 0x10
movzx eax, al
test eax, eax
jne 0x404abd
push str.Failed_to_restore_original_bytes.
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push ecx
call fcn.004118c0
add esp, 8
mov dword [ebp - 0xa8], eax
push 0x411d00
mov ecx, dword [ebp - 0xa8]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
nop
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0045caa8
mov esp, ebp
pop ebp
ret