PAGalaxyLab / YAHFA

Yet Another Hook Framework for ART
GNU General Public License v3.0
1.57k stars 351 forks source link

P 版本一运行就闪退,请问trampline的原理能否解释下? #67

Closed ymirror closed 6 years ago

rk700 commented 6 years ago

可参见之前的文章 http://rk700.github.io/2017/03/30/YAHFA-introduction/

ymirror commented 6 years ago

signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x75d427a028 x0 0000000070d2d010 x1 0000000013cc3058 x2 0000000013cc3020 x3 000000754f014c00 x4 0000007fec84e430 x5 00000000734f951d x6 7173522e666d606b x7 0000000000000000 x8 000000000000000c x9 00000075d427a028 x10 00000000734f9520 x11 000000754ba8e030 x12 000000754ba8e078 x13 000000754ba8e0c0 x14 000000754ba8e120 x15 0000000000000000 x16 000000754bb6df88 x17 0000000000000000 x18 0000000000000000 x19 000000754f014c00 x20 0000000000000000 x21 000000754f014c00 x22 0000007fec84e280 x23 00000000734f951d x24 0000000000000008 x25 00000075d57c55e0 x26 000000754f014ca0 x27 0000000000000002 x28 0000000000000006 x29 0000007fec84e0a8 sp 0000007fec84e090 lr 000000754ba8e18c pc 00000075d427a028

ymirror commented 6 years ago

P版本报错SIGILL, memcpy((char *) targetMethod + OFFSET_entry_point_from_quick_compiled_code_in_ArtMethod, &newEntrypoint, pointer_size);

ymirror commented 6 years ago

0x75d427a028是这里替换的newEntrypoint的地址

ymirror commented 6 years ago

搞定了,是我搞错了,修改了trapoline