• Stars
    star
    149
  • Rank 248,619 (Top 5 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created over 9 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

IDA Signsrch

IDA Signsrch

IDA Pro plug-in conversion of Luigi Auriemma's signsrch signature matching tool.

Version 1.4, May 2015 By Sirmabus

----- [Description] -----------------------------------------------------------

Luigi's original signsrch description: "Tool for searching signatures inside files, extremely useful as help in reversing jobs like figuring or having an initial idea of what encryption/- compression algorithm is used for a proprietary protocol or file. It can recognize tons of compression, multimedia and encryption algorithms and many other things like known strings and anti-debugging code which can be also manually added since it's all based on a text signature file read at runtime and easy to modify."

I've used his tool in the past to help find various bits of crypto sections and what not. For example the log-in sections of some online game clients. To use the tool in IDA I would have to run signsrch output piped to a text file, like this: "signsrch -b Target.exe >Temp.txt". And then tediously take these address of each match offset and look them up manually. Plus facilitated by a plug-in I added an automatic label commenting feature.

Not be confused with IDA FLIRT "sig" technology, these signatures are direct binary patterns. Currently there are about 1400 of these signatures from the source text database "signsrch.sig".

----- [Install] ---------------------------------------------------------------

Copy the plug-in and signsrch.xml file to your IDA Pro "plugins" directory. The default hot key is "Ctrl-0". If it conflicts or otherwise wanted to change then you'll need to edit your "..\plugins\plugins.cfg" to setup it up with your own hotkey combination.

For example add these two lines: ; Sirmabus "Class Informer" plug-in IDA Signsrch IDA_Signsrch.plw Alt-7 0

See IDA documentation for more on installing and using plug-ins.

----- [How to run it] ---------------------------------------------------------

Invoke like any other plug-in in IDA through the hot key, or through the IDA's Edit->Plugins menu.

You should be presented with the "IDA Signsrch" plug-in dialog. If you are running the normal non-QT IDA version ("idag.exe" not "idaq.exe", with a 'g') you should see my custom UI modifications. Either way it should run the same.

There are four options:

  1. "Alternate endian search.": What is "endian" you say? http://en.wikipedia.org/wiki/Endianness By default the plug-in will use the endian based on the IDB (not the current machine like the exe does). It is better left unchecked in most circumstances as otherwise increases the search time about double. If for some reason the target has opposite endian data then you want it checked. FYI the PC and most other mainstream desktops are "little endian".

If you look in "signsrch.xml" you will see things work as runs of bytes. You might think endian is not relative but actually it is here because these patterns are often composed of various other data types (like 32bit, etc).

  1. "Output to debug channel.": With this checked match info will be outputted to the debug out channel. You can view the output in a tool like Mark Russinovich's DebugView available at: http://goo.gl/D3P0

  2. "Include code segments.": You normally want this option checked so that signatures can be found in mixed code/data segments plus there are several relevant unique 32bit size code value signatures in the DB as well. Unchecked only data segments (".data", ".rdata", etc) will be searched.

  3. "Place signature comments.": With this checked as signatures are located a comment will be placed automatically made up of a special tag "<$ignsrch> "followed by the signature label name. I.E: '<$ignsrch> "CRC-1 poly 0x1 [..256]"' Is skipped if the special tag already exists so you can run the tool multiple times with out replicating the comments. If there is an existing comment at the same place a space will be appended or a "new line" first if the comment was long.

Click on "Continue" to let it run. The searching is pretty fast. On my machine it takes about 10 seconds to scan through a 21mb executable IDB.

On completion if any matches are found it will show them sorted by address in an IDA list box labeled "[ Signsrch matches ]". Browse and double click on a line to jump to it's address location.

----- [Design] ----------------------------------------------------------------

I had been wanting to do this project for some time and thought initially it was going to be a quick easy project since after all there is some source for it. But after hours of struggling with the parser source I had to just take the original source (that would compile fine in MS VS2010) and add a quick and dirty raw XML format exporter. Now Luigi's original "sig" text format is quite flexible. The patterns can be stated as C style values, in various forms of arrays in bytes, 32bits, floats, etc. It appears you can just copy directly from C code and paste it in. While very convenient it is hard to duplicate as it's mostly hard coded C and lacks documentation for small details. Plus I found what appears to be memory leaks that might be okay for a console app that just of runs then dies, but won't do for a plug-in that could potentially corrupt the host IDA Pro environment. Also my raw XML format loads faster sans all the extra parsing anyhow. However not to detract from Luigi's original tool however. It along with it's detailed database are brilliant.

On the plug-in side the only only source file actually used is derived from "hal_search.c" refactored and modified to use a static expanding buffer for speed et al. The search algorithm is based on "A Fast Generic Search Algorithm" by David R. Musser and Gor V. Nishanov: http://www.cs.rpi.edu/~musser/gp/gensearch/index.html There could be faster and more optimized these days as this sort of pattern matching must be the heart of many contemporary anti-virus scanning engines, but it's plenty fast as it is.

----- [Adding more and editing signatures] ------------------------------------

The XML format is simple and should be mostly self explanatory when viewed in a text or XML viewer. There is however some tags in the label/title that need some explanation. In them between two brackets are embedded important details. The size, endianness, and an optional bit wise stepping value. The format is '[', optional bits value, '.', endian type "le" or "be" w/optional "rev" for reverse, '.', the pattern size, then optionally a '&' to indicate the special bit stepping value, then a ']' to close. Example: "[32.le.56]" means 32 bits, little endian, with a pattern size of 56 bytes. Another: "MD5 digest [32.be.272&]" code in there means 32 bit stepping (the "&"), big endian, and a pattern size of 272 bytes. Note in my XML form the bit field ("TYPE" in original format) is only relevant when the '&' granularity stepping flag is present.

To add more patterns one can either edit "signsrch.xml", or edit the source "signsrch.sig" in it's original formatting style then run it with the included "Signsrch2XML.exe" utility to convert it over. Just put the "signsrch.sig" file in the same folder as Signsrch2XML and run it, then copy it over in your IDA plugins folder.

See the comments at the top of "signsrch.sig" for more information on it's formatting.

----- [Change log] ------------------------------------------------------------

1.4 - 1) Updated to IDA SDK 6.8 version. 2) Added a 64 bit "EA64" version.

1.3 - 1) Fixed bad standard/CRT mixed with custom allocator method bug. 2) Updated and fixed custom UI elements.

1.2 - Minor clean up of GUI customisations.

----- [License] ------------------------------------------------------------

GNU GENERAL PUBLIC LICENSE version 3 See "license.txt"

More Repositories

1

ScyllaHide

C++
232
star
2

hexrays_tools

C++
204
star
3

IDA-IDC-Scripts

Varoius IDC-scripts I've collected during the years.
Python
130
star
4

idastealth

C
98
star
5

IDA_ClassInformer

IDA ClassInformer PlugIn
C++
63
star
6

GUID-Finder

C++
50
star
7

IDASimulator

IDASimulator is a plugin that extends IDA's conditional breakpoint support, making it easy to augment / replace complex executable code inside a debugged process with Python code. Specifically, IDASimulator makes use of conditional breakpoints in the IDA debugger to hijack the execution flow of a process and invoke Python handler functions whenever particular code blocks are executed. With support for multiple target architectures, it handles details such as register initialization, memory allocation, pointers, function arguments and return values seamlessly and transparently, making it easy to replace, modify and subvert existing functionality (or lack thereof) in the target process. IDASimulator also includes the IDASim python module, on which IDASimulator is based. This allows for all of the features of IDASimulator to be integrated into more complex IDAPython scripts. IDASimulator currently supports the x86, x86_64, ARM and MIPS32 architectures. Porting to other architectures is very easy.
Python
47
star
8

ida-pro-swf

C++
29
star
9

IDA_FunctionStringAssociate_PlugIn

IDA FunctionStringAssociate PlugIn
C++
27
star
10

idascope

Python
26
star
11

IDA_COM_Plugin

C++
25
star
12

Fast_IDB2Sig_and_LoadMap_IDA_plugins

C++
20
star
13

optimice

Python
17
star
14

arm-thumb-decompiler-plugin

C++
17
star
15

IDA_Extrapass

IDA ExtraPass PlugIn
C
15
star
16

idapathfinder

Python
15
star
17

IndirectCalls

C++
15
star
18

detpdb

C++
14
star
19

desquirr

C++
14
star
20

idatools

Tools for IDA
JavaScript
13
star
21

IDAProBoschME7

Siemens Bosch ME7.x Disassembler Helper for IDA Pro
C
13
star
22

ida-x86emu-QT

C++
12
star
23

bios_parse

Python
12
star
24

PPCAltivec

C++
12
star
25

idaplugs

Plugins for IDA Pro by servil
C++
11
star
26

uberstealth

C
11
star
27

IDA2PAT_Reloaded

C++
10
star
28

turbodiff

C++
10
star
29

CommentViewer

C++
9
star
30

patchdiff3

Continuation of the popular patchdiff IDA plugin
C++
9
star
31

RECPP

RECPP is a IDA plugin / API for reversing C++ applications based on Igor Skochinsky articles and scripts (http://www.openrce.org/articles/full_view/21)
C++
8
star
32

idastruct

C++
8
star
33

jeb2-plugin-macho

Mach-O Object Plugin for JEB2 https://www.pnfsoftware.com
Java
8
star
34

HeapTracer

C++
8
star
35

ida-libbfd-loader

IDA Pro libbfd based loader for misc formats that IDA cannot handle, like IRIX ECOFF etc.
CMake
7
star
36

bflt-utils

C
7
star
37

ida-plugins-collection

Python
7
star
38

ida-unicode-string-convert

C++
7
star
39

WhatAPIs

IDA WhatAPIs PlugIn
C++
7
star
40

ida-sync-plugin

C++
6
star
41

ida-pro-plugin-wizard-for-vs2013

JavaScript
6
star
42

StructDump

C++
6
star
43

axis-cris-idp

IDA Pro CPU plugin for the AXIS CRIS architecture
C++
6
star
44

arm-helper

C++
6
star
45

IDA-CC

http://forum.exetools.com/showthread.php?t=13569&page=3
6
star
46

idainject

C++
6
star
47

binarydiffer

C++
6
star
48

garmin-ida-loader

C++
6
star
49

processstalker

C++
6
star
50

Cypress-M8-IDA-Processor-Module

C++
6
star
51

analyzecore

C++
6
star
52

IDA-omf2pat

IDA FLAIR helpers for making .SIG files from Borland sources by servil
C++
5
star
53

IDA-rails

C++
5
star
54

IDA-pinlog

C
5
star
55

findStrcpy

C++
5
star
56

fujitsu-fr30-idp

IDA Pro CPU plugin for the Fujitsu FR30 architecture
C++
5
star
57

cyrplw

C
5
star
58

findMemcpy

C++
5
star
59

bignum-dumper

C++
5
star
60

findMalloc

C++
4
star
61

get-asm-code

C++
4
star
62

Automated-Generic-Function-Naming

Python
4
star
63

MIPSJT

MIPS JT fixup for IDA PRO
C++
4
star
64

rsrcExtractor

C++
4
star
65

IdaThingy

C++
4
star
66

ppc2

C++
4
star
67

krypton

Python
4
star
68

gerbay1

C++
4
star
69

ida-dbdump

C++
4
star
70

tree-cbass

Python
4
star
71

ida-x86emu

C++
4
star
72

IDAWinHelpViewer

C++
3
star
73

depload

C++
3
star
74

ppchelper

C++
3
star
75

ida_objectivec_plugins

C++
3
star
76

IDA_MarkRefCnt

IDA MarkRefCount PlugIn
C++
3
star
77

idaplugininfo

This is a little utility to dump information about installed IDA Pro plugins. The key parts of the IDA PLUGIN export "plugin_t" struct data.
C#
3
star
78

REDB

Python
3
star
79

IDA_WaitBoxEx

IDA WaitBoxEx
C++
3
star
80

CopyAndPast

Binary Copy and Paste
C++
2
star
81

idaocaml

C
2
star
82

idapatchwork

https://bitbucket.org/daniel_plohmann/idapatchwork
Python
2
star
83

ncoverage

C#
2
star
84

ida_load_all_dump_load

C++
2
star
85

IDA-auto-declaration

IDA PRO plugin for automatic type declaration like char, byte, float, double wchar etc...
2
star
86

vctaxo

C++
2
star
87

malflare

C++
2
star
88

ParseBinTree

take IDA PRO memory lines and print binary tree node.
Python
2
star
89

IDACSharp

C# 'Scripts' for IDA 6.6+ based on https://idacsharp.codeplex.com/
2
star
90

mynav

Python
2
star
91

wwcd2

Ida pro What Would Capstone Decode by Stefan Esser
C++
2
star
92

Hotch

C++
2
star
93

rails

C++
1
star
94

ida-vs2005templates

C++
1
star
95

classinformer

https://sourceforge.net/projects/classinformer/ partially adapted for ida64
1
star
96

ida_plugin_depack_aplib_and_lzma

Assembly
1
star
97

CLU

C
1
star
98

idastruct-1

Script helper in working with ida structures
Python
1
star
99

COSA-IDA

Comprehensive Static Analyzer For Android Application (COSA with IDA Pro)
Java
1
star
100

lltd-osx

LLTD (LLD2D) for OS X
C
1
star