IDA C++ SDK
9.2
Loading...
Searching...
No Matches
libfuncs.hpp
Go to the documentation of this file.
1
/*
2
* Interactive disassembler (IDA).
3
* Copyright (c) 2005-2025 Hex-Rays SA <support@hex-rays.com>
4
* ALL RIGHTS RESERVED.
5
*
6
* Routines and data structures for working with library signatures (e.g. FLIRT).
7
*/
8
#ifndef __LIBFUNC_HPP
9
#define __LIBFUNC_HPP
10
#pragma pack(push, 1)
11
struct
idasgn_header_t
12
{
13
char
magic
[6];
// 'IDASGN'
14
#define SIGN_HEADER_MAGIC "IDASGN"
15
uchar
version
;
// currently 7 (see fix_version() below)
16
#define SIGN_HEADER_VERSION 10
17
uchar
processor_id
;
// idp id
18
uint32
file_formats
;
// allowed file formats (filetype_t)
19
uint16
ostype
;
// operation system type (bit field)
20
#define OSTYPE_MSDOS 0x0001
21
#define OSTYPE_WIN 0x0002
22
#define OSTYPE_OS2 0x0004
23
#define OSTYPE_NETW 0x0008
24
#define OSTYPE_UNIX 0x0010
25
#define OSTYPE_OTHER 0x0020
26
uint16
apptype
;
// application type:
27
#define APPT_CONSOLE 0x0001
// console
28
#define APPT_GRAPHIC 0x0002
// graphics
29
#define APPT_PROGRAM 0x0004
// EXE
30
#define APPT_LIBRARY 0x0008
// DLL
31
#define APPT_DRIVER 0x0010
// DRIVER
32
#define APPT_1THREAD 0x0020
// Singlethread
33
#define APPT_MTHREAD 0x0040
// Multithread
34
#define APPT_16BIT 0x0080
// 16 bit application
35
#define APPT_32BIT 0x0100
// 32 bit application
36
#define APPT_64BIT 0x0200
// 64 bit application
37
//
38
// Idea: check library date and exe date
39
//
40
uint16
flags
;
// signature file flags
41
#define LS_STARTUP 0x0001
// has startup entry as first module
42
#define LS_CTYPE 0x0002
// has ctype
43
#define LS_CTYPE2 0x0004
// ctype element is 2 bytes
44
#define LS_CTYPE_ALT 0x0008
// alternative ctype checksum present
45
#define LS_ZIP 0x0010
// compressed signature
46
#define LS_CTYPE_3V 0x0020
// 3rd variant of ctype checksum present
47
uint16
number_of_modules_v5
;
48
uint16
ctype_crc
;
49
char
ctype_name
[12];
50
uchar
libname_length
;
51
uint16
ctype_crc_alt
;
// added in version 5
52
uint32
number_of_modules
;
// added in version 6
53
uint16
pattern_length
;
54
uint16
ctype_crc_3v
;
// added in version 10
55
56
void
fix_version
(FILE *infp);
57
};
58
#pragma pack(pop)
59
65
66
idaman
bool
ida_export
get_idasgn_header_by_short_name
(
idasgn_header_t
*out_header,
qstring
*out_libname,
const
char
*name);
67
72
73
idaman
bool
ida_export
get_idasgn_path_by_short_name
(
qstring
*out_fullpath,
const
char
*name);
74
#endif
get_idasgn_header_by_short_name
idaman bool ida_export get_idasgn_header_by_short_name(idasgn_header_t *out_header, qstring *out_libname, const char *name)
Get idasgn header by a short signature name.
get_idasgn_path_by_short_name
idaman bool ida_export get_idasgn_path_by_short_name(qstring *out_fullpath, const char *name)
Get idasgn full path by a short signature name.
uint16
unsigned short uint16
unsigned 16 bit value
Definition
pro.h:346
uint32
unsigned int uint32
unsigned 32 bit value
Definition
pro.h:348
uchar
unsigned char uchar
unsigned 8 bit value
Definition
pro.h:337
qstring
_qstring< char > qstring
regular string
Definition
pro.h:3694
idasgn_header_t
Definition
libfuncs.hpp:12
idasgn_header_t::magic
char magic[6]
Definition
libfuncs.hpp:13
idasgn_header_t::file_formats
uint32 file_formats
Definition
libfuncs.hpp:18
idasgn_header_t::ctype_crc
uint16 ctype_crc
Definition
libfuncs.hpp:48
idasgn_header_t::number_of_modules_v5
uint16 number_of_modules_v5
Definition
libfuncs.hpp:47
idasgn_header_t::flags
uint16 flags
Definition
libfuncs.hpp:40
idasgn_header_t::processor_id
uchar processor_id
Definition
libfuncs.hpp:17
idasgn_header_t::ctype_crc_alt
uint16 ctype_crc_alt
Definition
libfuncs.hpp:51
idasgn_header_t::ctype_name
char ctype_name[12]
Definition
libfuncs.hpp:49
idasgn_header_t::ctype_crc_3v
uint16 ctype_crc_3v
Definition
libfuncs.hpp:54
idasgn_header_t::version
uchar version
Definition
libfuncs.hpp:15
idasgn_header_t::libname_length
uchar libname_length
Definition
libfuncs.hpp:50
idasgn_header_t::number_of_modules
uint32 number_of_modules
Definition
libfuncs.hpp:52
idasgn_header_t::apptype
uint16 apptype
Definition
libfuncs.hpp:26
idasgn_header_t::ostype
uint16 ostype
Definition
libfuncs.hpp:19
idasgn_header_t::pattern_length
uint16 pattern_length
Definition
libfuncs.hpp:53
idasgn_header_t::fix_version
void fix_version(FILE *infp)
src
include
libfuncs.hpp