Skip to content

x86_64平台 API:30 调用栈偏移问题 #9

Answered by Mr-JingShi
Mr-JingShi asked this question in Q&A
Discussion options

You must be logged in to vote

老师你好,x86_64平台 API:30

libsample反汇编 126c: e8 4f fa ff ff callq cc0 tgkill@plt 1271: bf 04 00 00 00 mov $0x4,%edi

CFI方式: I/xunwind_tag: #1 pc 0000000000001270 /data/app/~~WZ_mVkK4mGpxxUIdnHz4Mg==/io.hexhacking.xunwind.sample-B_YKIacqKu-eUUOxomuhFQ==/lib/x86_64/libsample.so 与实际调用栈偏移4个字节。

EH方式: I/xunwind_tag: #5 pc 0000000000001271 /data/app/~~WZ_mVkK4mGpxxUIdnHz4Mg==/io.hexhacking.xunwind.sample-B_YKIacqKu-eUUOxomuhFQ==/lib/x86_64/libsample.so 与实际调用栈偏移5个字节。

这是怎么回事呢? 我想做一个自动化的转换工具,该怎么兼容呢?

uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf, ArchEnum arch) {
  switch (arch) {
    case ARCH_ARM: {
      if (!elf->valid()) {
        return 2;
      }

      uint64_t load_bias = elf->GetLoadBias(…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@caikelun
Comment options

Answer selected by Mr-JingShi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants