bmax121 / KernelPatch

Patching and hooking the Linux kernel with only a stripped Linux kernel image.
GNU General Public License v2.0
736 stars 128 forks source link

Fix alignment issue in KernelPatch #116

Closed SakuraKyuo closed 3 months ago

SakuraKyuo commented 3 months ago

On certain devices, KernelPatch was reading offset without ensuring proper alignment before storing it in the inst variable. This misalignment could cause errors in subsequent operations that rely on the offset, leading to incorrect patching, throwing Segmentation fault in the end. This commit adds automatic alignment checks and adjustments to ensure that the offset is properly aligned before use.