stevemk14ebr / PolyHook_2_0

C++20, x86/x64 Hooking Libary v2.0
MIT License
1.58k stars 222 forks source link

Disassembler may go out of bounds into unmapped region #159

Closed EngineLessCC closed 1 year ago

EngineLessCC commented 1 year ago

I've encountered an edge-case at the following lines:

sources/x64Detour.cpp#L299 sources/ADetour.cpp#L72

dest + 100

May end up going beyond mapped memory and cause an av.

stevemk14ebr commented 1 year ago

Thanks, you're right. https://github.com/stevemk14ebr/PolyHook_2_0/blob/master/sources/ZydisDisassembler.cpp#L51 should be safe_mem_read instead