⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ida51.patch

📁 The sources of IDAPython, a plugin for IDA for using python for scripting in IDA, instead of IDC.
💻 PATCH
📖 第 1 页 / 共 2 页
字号:
 
 
+#ifndef SWIG
 // Display a dialog box and wait for the user to input multiline text
 //      size    - maximum size of text in bytes
 //      answer  - output buffer. if you specify NULL then the answer
@@ -2719,6 +2740,7 @@   va_end(va);
   return result;
 }
+#endif // SWIG
 
 
 //---------------------------------------------------------------------------
@@ -2794,6 +2816,7 @@ idaman const char *ida_export strarray(const strarray_t *array, size_t array_size, int code);
 
 
+#ifndef SWIG
 // Convert whitespace to tabulations
 // This functin will stop the conversion as soon as a string or character constant
 // is encountered
@@ -2986,6 +3009,7 @@ // match a string with a regular expression
 // returns: 0-no match, 1-match, -1-error
 idaman int ida_export regex_match(const char *str, const char *pattern, bool sense_case);
+#endif // SWIG
 
 
 #pragma pack(pop)
diff -ur idasdk-versions/5.1/include/lines.hpp swigsdk-versions/5.1/include/lines.hpp--- idasdk-versions/5.1/include/lines.hpp	2006-03-17 17:41:22.000000000 +0200+++ swigsdk-versions/5.1/include/lines.hpp	2007-09-30 06:56:51.000000000 +0300@@ -614,12 +614,11 @@         ml_getnam_t *getnam,
         ml_genxrf_t *genxrf,
         ml_saver_t *saver,
-        int flags
+        int flags);
 #define MAKELINE_NONE           0x00
 #define MAKELINE_BINPREF        0x01
 #define MAKELINE_VOID           0x02
 #define MAKELINE_STACK          0x04
-                        );
 
 idaman bool ida_export save_line_in_array(const char *line);      // a standard line saver()
 idaman void ida_export init_lines_array(char *lnar[],int maxsize);// initialization function for it
diff -ur idasdk-versions/5.1/include/moves.hpp swigsdk-versions/5.1/include/moves.hpp--- idasdk-versions/5.1/include/moves.hpp	2006-03-17 17:41:22.000000000 +0200+++ swigsdk-versions/5.1/include/moves.hpp	2007-09-30 06:56:51.000000000 +0300@@ -26,6 +26,8 @@     { return !(*this == r); }
 };
 
+
+#ifndef SWIG
 // Helper functions. Should not be called directly!
 class curloc;
 class location_t;
@@ -49,13 +51,16 @@ 
 DEFINE_CURLOC_HELPERS(idaman)
 DEFINE_LOCATION_HELPERS(idaman)
+#endif // SWIG
 
 #define CURLOC_SISTACK_ITEMS 4
 
 class curloc : public sistack_t
 {
   void push(void);
+#ifndef SWIG
   DEFINE_CURLOC_HELPERS(friend)
+#endif // SWIG
   void unhide_if_necessary(ea_t ea);
   void hide_if_necessary(void);
 protected:
@@ -120,7 +125,9 @@ class location_t : public curloc
 {
   typedef curloc inherited;
+#ifndef SWIG
   DEFINE_LOCATION_HELPERS(friend)
+#endif // SWIG
 public:
   graph_location_info_t gli;
   location_t(void) {}
diff -ur idasdk-versions/5.1/include/nalt.hpp swigsdk-versions/5.1/include/nalt.hpp--- idasdk-versions/5.1/include/nalt.hpp	2007-01-29 22:06:46.000000000 +0200+++ swigsdk-versions/5.1/include/nalt.hpp	2008-07-22 20:11:23.000000000 +0300@@ -53,6 +53,7 @@                             //   supval(ea) -> function name
                             //   altval(ord) -> import ea
 
+#ifndef SWIG
 //--------------------------------------------------------------------------
 
 // Macro definitions used in this header file (internal)
@@ -231,6 +232,7 @@ // position of cursor in the window with cross-references to the address
 // Used by the user-interface.
 NALT_EA(get_xrefpos, set_xrefpos, del_xrefpos, NALT_XREFPOS)
+#endif // SWIG
 
 // Additional flags for the location.
 // All 32-bits of the main flags (see bytes.hpp) are used up.
@@ -285,6 +287,7 @@ #define AFL_USERTI      0x02000000L     // the type information is definitive
                                         // (comes from the user or type library)
 
+#ifndef SWIG
 // The following macro is used to define 3 functions to work with a bit:
 //      int  test(ea_t ea);    - test if the bit is set
 //      void set(ea_t ea);     - set bit
@@ -324,6 +327,7 @@ IMPL__IS_AFLAG_FUNCS(AFL_FIXEDSPD, fixed_spd)
 IMPL__IS_AFLAG_FUNCS(AFL_ALIGNFLOW,align_flow)
 IMPL__IS_AFLAG_FUNCS(AFL_USERTI,   userti)
+#endif // SWIG
 
 inline void set_visible_item(ea_t ea, bool visible)
 {
@@ -341,11 +345,14 @@ 
 // source line numbers (they are sometimes present in object files)
 // Thes functions may be used if necessary.
+#ifndef SWIG
 NALT_EA(get_linnum0,set_linnum0, del_linnum0, NALT_LINNUM)
+#endif // SWIG
 idaman void   ida_export set_source_linnum(ea_t ea, uval_t lnnum);
 idaman uval_t ida_export get_source_linnum(ea_t ea);      // returns BADADDR if no lnnum
 idaman void   ida_export del_source_linnum(ea_t ea);
 
+#ifndef SWIG
 // absolute segment base address
 // These functions may be used if necessary.
 NALT_EA(get_absbase,set_absbase, del_absbase, NALT_ABSBASE)
@@ -366,6 +373,7 @@ // type of string
 // Don't use, see: get_typeinfo()
 NALT_ULONG(get_str_type,set_str_type,del_str_type,NALT_STRTYPE)
+#endif // SWIG
 
 inline char idaapi get_str_type_code(uval_t strtype) { return char(strtype); }
 
@@ -402,16 +410,19 @@ }
 
 
+#ifndef SWIG
 // alignment value (should be power of 2)
 // These functions may be used if necessary.
 NALT_ULONG(get_alignment,set_alignment,del_alignment,NALT_ALIGN)
 
 // instruction/data background color
 NALT_ULONG(_get_item_color,_set_item_color,_del_item_color,NALT_COLOR)
+#endif // SWIG
 idaman void      ida_export set_item_color(ea_t ea, bgcolor_t color);
 idaman bgcolor_t ida_export get_item_color(ea_t ea);      // returns DEFCOLOR if no color
 idaman void      ida_export del_item_color(ea_t ea);
 
+#ifndef SWIG
 //----------------------------------------------------------------------
 NSUP_STRING(nalt_cmt,NSUP_CMT)          // regular comment       (low level, don't use)
 NSUP_STRING(nalt_rptcmt,NSUP_REPCMT)    // repeatable comment    (low level, don't use)
@@ -559,6 +570,7 @@ 
 // Address which holds the switch info. Used at the jump targets.
 NALT_EA(get_switch_parent,set_switch_parent,del_switch_parent, NALT_SWITCH)
+#endif // SWIG
 
 
 //--------------------------------------------------------------------------
@@ -671,6 +683,7 @@ idaman void ida_export write_struc_path(netnode node, int idx, const tid_t *path, int plen, adiff_t delta);
 idaman int  ida_export read_struc_path(netnode node, int idx, tid_t *path, adiff_t *delta);  // returns plen
 
+#ifndef SWIG
 #define DEFINE_PATH_FUNCS(name, code)                                \
 inline int  N_PASTE(get_,name)(ea_t ea, tid_t *path, adiff_t *delta) \
  { return read_struc_path(netnode(ea), code, path, delta); }         \
@@ -738,6 +751,7 @@ #define RIDX_ALT_CRC32          uval_t(-5) // input file crc32
 #define RIDX_ALT_IMAGEBASE      uval_t(-6) // image base
 #define RIDX_ALT_IDSNODE        uval_t(-7) // ids modnode id (for import_module)
+#endif // SWIG
 
 //--------------------------------------------------------------------------
 // Get full path of the input file
@@ -784,11 +798,13 @@     return get_input_file_path(buf, bufsize);
 }
 
+#ifndef SWIG
 #ifndef NO_OBSOLETE_FUNCS
 #define SWI_SHIFT1      0x80    // use formula (element*2 + elbase)
                                 // to find jump targets (obsolete)
 NSUP_STRUCT(switch_info,NSUP_SWITCH)
 #endif
+#endif // SWIG
 
 #ifndef BYTES_SOURCE    // undefined bit masks so no one can use them directly
 #undef AFL_LINNUM
diff -ur idasdk-versions/5.1/include/pro.h swigsdk-versions/5.1/include/pro.h--- idasdk-versions/5.1/include/pro.h	2007-02-17 21:04:34.000000000 +0200+++ swigsdk-versions/5.1/include/pro.h	2007-09-30 06:56:51.000000000 +0300@@ -63,6 +63,7 @@ #define __EA64__
 #endif
 
+#ifndef SWIG
 #ifdef __VC__
 #define ENUM_SIZE(t) : t
 #else
@@ -138,6 +139,7 @@ #define __KYLIX__
 #endif
 
+#endif // SWIG
 /*==================================================*/
 #ifndef MAXSTR
 #define MAXSTR 1024
@@ -178,7 +180,12 @@ 
 /*==================================================*/
 
-#if defined(__IDP__) && defined(__NT__) // for modules
+#if defined(SWIG)                       // for SWIG
+#define idaapi
+#define idaman
+#define ida_export
+#define ida_export_data
+#elif defined(__IDP__) && defined(__NT__) // for modules
 #define idaapi          __stdcall
 #define idaman          EXTERNC
 #define ida_export      idaapi
@@ -237,7 +244,9 @@ typedef unsigned long  ulong;
 #endif
 
+#ifndef SWIG
 #include <llong.hpp>
+#endif // SWIG
 
 typedef          char   int8;
 typedef signed   char   sint8;
@@ -295,6 +304,7 @@ typedef adiff_t sval_t;   // signed value used by the processor
                           // for 32-bit ea_t, long
                           // for 64-bit ea_t, longlong
+#ifndef SWIG
 #define BADADDR ea_t(-1)  // this value is used for 'bad address'
 
 // Windows64 declarations
@@ -618,7 +628,9 @@ idaman bool  ida_export qisdir(const char *file);
 
 /*==================================================*/
+#endif // SWIG
 idaman void ida_export qexit(int code);
+#ifndef SWIG
 idaman void ida_export qatexit(void (idaapi *func)(void));
 
 /*==================================================*/
@@ -1286,6 +1298,7 @@ #define cwstr(dst, src, dstsize) qstrncpy(dst, src, dstsize)
 #define wcstr(dst, src, dstsize) qstrncpy(dst, src, dstsize)
 #endif
+#endif // SWIG
 
 // Old Visual C++ compilers were not defining the following:
 #ifdef __NT__
diff -ur idasdk-versions/5.1/include/ua.hpp swigsdk-versions/5.1/include/ua.hpp--- idasdk-versions/5.1/include/ua.hpp	2006-10-24 23:19:54.000000000 +0300+++ swigsdk-versions/5.1/include/ua.hpp	2007-09-30 06:56:51.000000000 +0300@@ -42,10 +42,12 @@ //      in 'cmd' structure. They should not access to bytes of instruction
 //      and decode it again - this should be done in the analysis step.
 
+#ifndef SWIG
 #include <kernwin.hpp>  // for btoa()
 #include <lines.hpp>    // for color_t
 #include <xref.hpp>     // add_cref()
 #include <llong.hpp>    // longlong
+#endif // SWIG
 
 //--------------------------------------------------------------------------
 //      T Y P E   O F   O P E R A N D
@@ -223,13 +225,17 @@ 
 // The following unions keep other information about the operand
 
+#ifndef SWIG
   union
   {
+#endif // SWIG
     ushort reg;                 // number of register (o_reg)
     ushort phrase;              // number of register phrase (o_phrase,o_displ)
                                 // you yourself define numbers of phrases
                                 // as you like
+#ifndef SWIG
   };
+#endif // SWIG
 
   bool is_reg(int r) const { return type == o_reg && reg == r; }
 
@@ -238,7 +244,9 @@ 
 // VALUE
 
+#ifndef SWIG
   union {
+#endif // SWIG
     uval_t value;               // value of operand (o_imm)
                                 // outer displacement (o_displ+OF_OUTER_DISP)
 
@@ -246,14 +254,18 @@         ushort low;             // your convenience only
         ushort high;
     } value_shorts;
+#ifndef SWIG
   };
+#endif // SWIG
 
   bool is_imm(uval_t v) const { return type == o_imm && value == v; }
 
 
 // VIRTUAL ADDRESS (OFFSET WITHIN THE SEGMENT)
 
+#ifndef SWIG
   union {
+#endif // SWIG
     ea_t addr;                  // virtual address pointed or used by the operand
                                 // (o_mem,o_displ,o_far,o_near)
 
@@ -261,18 +273,25 @@         ushort low;             // your convenience only
         ushort high;
     } addr_shorts;
+
+#ifndef SWIG
   };
+#endif // SWIG
 
 
 // IDP SPECIFIC INFORMATION
 
+#ifndef SWIG
   union {
+#endif // SWIG
     ea_t specval;               // This field may be used as you want.
     struct {                    // this structure is defined for your convenience only
         ushort low;             // IBM PC: segment register number (o_mem,o_far,o_near)
         ushort high;            // IBM PC: segment selector value  (o_mem,o_far,o_near)
     } specval_shorts;
+#ifndef SWIG
   };
+#endif // SWIG
 
 // The following fields are used only in idp modules
 // You may use them as you want to store additional information about
@@ -336,15 +355,19 @@ // Additinal information about the instruction.
 // You may use these field as you want.
 
+#ifndef SWIG
   union
   {
+#endif // SWIG
     ushort auxpref;             // processor dependent field
     struct
     {
       uchar low;
       uchar high;
     } auxpref_chars;
+#ifndef SWIG
   };
+#endif // SWIG
   char segpref;                 // processor dependent field
   char insnpref;                // processor dependent field
 
@@ -374,6 +397,7 @@ 
 // This structure is used to pass values of bytes to helper functions.
 
+#ifndef SWIG
 union value_u
 {
   uchar v_char;
@@ -393,6 +417,7 @@ // returns: number of immediate values (0..2*UA_MAXOP)
 
 idaman size_t ida_export get_operand_immvals(ea_t ea, int n, uval_t *v);
+#endif // SWIG
 
 
 //--------------------------------------------------------------------------
@@ -405,6 +430,7 @@ idaman insn_t ida_export_data cmd;      // current instruction
 
 
+#ifndef SWIG
 // Undocumented variable. It is not used by the kernel.
 // Its value may be specified in IDA.CFG:
 //      LOOKBACK = <number>
@@ -810,6 +836,7 @@ // Returns: the reference target address (the same as calc_reference_target)
 
 idaman ea_t ida_export ua_add_off_drefs(const op_t &x, dref_t type);
+#endif // SWIG
 
 
 // Get size and flags for op_t.dtyp field.
@@ -871,6 +898,7 @@ idaman const char *ida_export ua_mnem(ea_t ea, char *buf, size_t bufsize);
 
 
+#ifndef SWIG
 //--------------------------------------------------------------------------
 //      Helper functions for the processor emulator/analyzer
 //--------------------------------------------------------------------------
@@ -942,6 +970,7 @@                                   // Also converts to code, uses fixups, increases segments etc
                                   // This function is only for the kernel
                                   // Use ua_code() instead
+#endif // SWIG
 
 #ifndef NO_OBSOLETE_FUNCS
 idaman void ida_export ua_dodata(ea_t ea, int dtype);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -