1

While using IDA Python and related code of idaapi, the processor type is not returned correctly. Specially we will have MetaPC instead of the exact processor type. This is my code that I used it:

info = idaapi.get_inf_structure()
    print info.procName

Is there any way to correct this problem??

6
  • metapc is the actual default processor module for most x86/x64 binaries. What did you expect to get instead?
    – Igor Skochinsky
    Oct 6, 2017 at 8:44
  • I want the processor type exactly, not default processor module! Oct 6, 2017 at 8:46
  • got an example of what you expected?
    – Igor Skochinsky
    Oct 6, 2017 at 8:51
  • For example, I want the processor type such as ARM or MIPS exactly. Not the default which you are saying metapc. Oct 6, 2017 at 9:01
  • how and when are you running the script?
    – Igor Skochinsky
    Oct 6, 2017 at 9:07

1 Answer 1

1

IDA can only know the actual processor type if the file format provides it (e.g. e_machine value in the ELF header), or you specify it manually. If you pass a plain binary file, there's no way to for IDA detect the CPU so the default one ("metapc") gets loaded.

A simple solution is to specify the correct CPU type using the -p commandline switch, e.g.:

ida -pmipsb -A -Sscript.py binary_file 
2
  • Unfortunately I don't have the correct processor type. Is there any way to identify the processor type correctly? Oct 6, 2017 at 12:49
  • that's a different question; feel free to ask a new one
    – Igor Skochinsky
    Oct 6, 2017 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.