worawit / blutter

Flutter Mobile Application Reverse Engineering Tool
MIT License
752 stars 128 forks source link

question : does this tool support x86 ? #49

Open ligmaSec opened 3 months ago

ligmaSec commented 3 months ago

I tried running it on a x86_64 lib folder but I got this error : AssertionError: Unsupport architecture: EM_X86_64

AbhiTheModder commented 3 months ago

No, Only Aarch64 is supported!

On 32-bit: https://github.com/worawit/blutter/issues/9#issuecomment-1751973992

cryptax commented 1 month ago

I've been trying to add x86_64 support in my fork. So far, the correct Dart SDK if you specify --version, --snapshot, --arch and --os, and I've started creating Disassembler_x64.h and Disassembler_x64.cpp. The registers are now correctly mapped (I think), but I'm struggling with how to map correctly the instructions (see commented code in Disassembler_x64.h...).

Would love assistance, if anybody is interested :smile:

/workdir/blutter/blutter/src/Disassembler_x64.h: In member function ‘x86_sse_cc AsmInstruction::cc() const’:
/workdir/blutter/blutter/src/Disassembler_x64.h:274:58: error: ‘cs_x86’ {aka ‘struct cs_x86’} has no member named ‘cc’
  274 |         x86_sse_cc cc() const { return insn->detail->x86.cc; }
      |                                                          ^~
/workdir/blutter/blutter/src/Disassembler_x64.h: In member function ‘bool AsmInstruction::writeback() const’:
/workdir/blutter/blutter/src/Disassembler_x64.h:275:59: error: ‘cs_x86’ {aka ‘struct cs_x86’} has no member named ‘writeback’
  275 |         bool writeback() const { return insn->detail->x86.writeback; }
      |                                                           ^~~~~~~~~
/workdir/blutter/blutter/src/Disassembler_x64.h: At global scope:
/workdir/blutter/blutter/src/Disassembler_x64.h:351:41: error: ‘X64_CC_INVALID’ was not declared in this scope; did you mean ‘ARM_CC_INVALID’?
  351 |         bool IsBranch(x86_sse_cc cond = X64_CC_INVALID) const { return insn->id == X86_INS_B && cc() == cond; }
      |                                         ^~~~~~~~~~~~~~
      |                                         ARM_CC_INVALID
/workdir/blutter/blutter/src/Disassembler_x64.h: In member function ‘bool AsmIterator::IsMovz() const’:
/workdir/blutter/blutter/src/Disassembler_x64.h:349:36: error: ‘X86_INS_MOVZ’ was not declared in this scope; did you mean ‘X86_INS_MOVZX’?
  349 |                 return insn->id == X86_INS_MOVZ || (insn->id == X86_INS_MOV && op_count() == 2 && ops(1).type == X64_OP_IMM);
      |                                    ^~~~~~~~~~~~
AbhiTheModder commented 1 month ago

Would love assistance, if anybody is interested :smile:

Wow, would love to but sadly I've no idea about x86_64 asm.