Import the map file to the IDA pro Applet

Source: Internet
Author: User

Ida pro is an essential tool for reverse engineering, but it seems that Ida pro does not support direct import of Map Files (if anyone knows, please let me know ). When I analyzed a program a few days ago, it was strange that the map was provided but the PDB was not provided. Unhappy, I wrote a python applet that converts the map file into Ida pro's IDC script:

#-*-Coding: UTF-8 -*-
From _ future _ import with_statement
Import sys
Import OS

Def map2idc (in_file, out_file ):
With open (out_file, 'w') as fout:
Fout. Write ('# include <IDC. IDC> \ n ')
Fout. Write ('static main () \ n {\ n ')
With open (in_file) as fin:
For line in Fin:
List = line. Split ()
If Len (list)> = 3 and Len (STR (list [2]) = 8 and STR (list [2]). isalnum ():
Fout. Write ('\ tmakename (0x % s, "% s"); \ n' % (list [2], list [1])
Fout. Write ('} \ n ')

Def main ():
From optparse import optionparser
Parser = optionparser (usage = 'usage: % prog <map FILENAME> ')
(Options, argS) = parser. parse_args ()
If Len (ARGs) <1:
Parser. Error ('encrect Number of arguments ')
Return map2idc (ARGs [0], OS. Path. splitext (ARGs [0]) [0] + '. IDC ')

If _ name __= = "_ main __":
SYS. Exit (main ())

Usage:

Python map2idc. py/path/to/mapfile

In Ida pro, after loading the program to be analyzed, select file --> IDC File... and select the generated IDC File.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.