From 505e2772400916b71b7280de1a33c43d29f0fad6 Mon Sep 17 00:00:00 2001 From: clc5q <clc5q@git.zephyr-software.com> Date: Sat, 14 Apr 2018 19:37:51 +0000 Subject: [PATCH] Add script to suppress ASM generation to save time. Former-commit-id: d7bdf90f5f65fe9eba085b0a2cedaff526be1bd0 --- .gitattributes | 1 + scripts/SMP7noasm.idc | 57 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 scripts/SMP7noasm.idc diff --git a/.gitattributes b/.gitattributes index a6eeb7c8..1f6a4e3d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -55,6 +55,7 @@ scripts/Makefile.in -text scripts/SMP.idc -text scripts/SMP6.idc -text scripts/SMP7.idc -text +scripts/SMP7noasm.idc -text scripts/plugin.script -text scripts/rebuild_for_multiple_idas -text src/Makefile.in -text diff --git a/scripts/SMP7noasm.idc b/scripts/SMP7noasm.idc new file mode 100644 index 00000000..74eba29a --- /dev/null +++ b/scripts/SMP7noasm.idc @@ -0,0 +1,57 @@ +// +// Sample IDC program to automate IDA Pro. +// +// IDA Pro can be run from the command line in the +// batch (non-interactive) mode. +// +// If IDA is started with +// +// idag -A -Sanalysis.idc file +// +// then this IDC file will be executed. It performs the following: +// +// - the code segment is analyzed +// - the output file is created +// - IDA exits to OS +// +// Feel free to modify this file as you wish +// (or write your own script/plugin to automate IDA) +// +// Since the script calls the Exit() function at the end, +// it can be used in the batch files (use text mode idaw.exe) +// +// NB: "idag -B file" is equivalent to the command line above +// + +#include <idc.idc> + +static main() +{ + auto file; + + // turn on coagulation of data in the final pass of analysis +// The #if below is not supported. Left in as documentation. +// #if __IDA_SDK_VERSION__ < 700 +// SetShortPrm(INF_AF2, GetShortPrm(INF_AF2) | AF2_DODATA); +//#else + set_inf_attr(INF_AF, get_inf_attr(INF_AF) | AF_DODATA | AF_FINAL); +//#endif + + Batch(0); + Wait(); + + file = GetInputFile(); + Message("INFO: Input file name %s \n", file); + auto DebugFile = "stubtest.idaoutput"; + auto fd = fopen(DebugFile, "w"); + fprintf(fd, "Input file name: %s \n", file); + fclose(fd); + +// file = substr(file,0,strstr(file,".")) + ".asm"; +// WriteTxt(file, 0, BADADDR); // create the assembler file + +// if (!RunPlugin("SMPStaticAnalyzer", 1)) +// Message("Could not load SMPStaticAnalyzer plugin.\n"); + + Exit(0); // exit to OS, error code 0 - success +} -- GitLab