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

📄 immplugin.pas

📁 This source code. simple tools for huawei CDMA platform function : read code write code read sp
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  D_BODY            = 'I';            // Body of procedure or scope
  D_ENTRY           = 'J';            // Loop entry point
  D_LEAF            = 'K';            // Intermediate leaf on a tree
  D_END             = 'E';            // End of procedure or scope
  D_SINGLE          = 'S';            // Single-line scope
  D_ENDBEG          = 'T';            // End and begin of stack scope
  D_POINT           = '.';            // Point
  D_JMPUP           = 'U';            // Jump upstairs
  D_JMPOUT          = '<';            // Jump to same location or out of module
  D_JMPDN           = 'D';            // Jump downstairs
  D_PATHUP          = 'u';            // Jump path upstairs (highlighted)
  D_GRAYUP          = 'v';            // Jump path upstairs (grayed)
  D_PATH            = 'i';            // Jump path through text (highlighted)
  D_GRAYPATH        = 'j';            // Jump path through text (grayed)
  D_PATHDN          = 'd';            // Jump path downstairs (highlighted)
  D_GRAYDN          = 'e';            // Jump path downstairs (grayed)
  D_PATHUPEND       = 'r';            // End of path upstairs (highlighted)
  D_GRAYUPEND       = 's';            // End of path upstairs (grayed)
  D_PATHDNEND       = 'f';            // End of path downstairs (highlighted)
  D_GRAYDNEND       = 'g';            // End of path downstairs (grayed)
  D_SWTOP           = 't';            // Start of switch
  D_SWBODY          = 'b';            // Switch body
  D_CASE            = 'c';            // Intermediate switch case
  D_LASTCASE        = 'l';            // Last switch case

  // Please note: Although types here contain mostly unique bit assignments, it's
  // not really necessary. Same bits, except for reserved general types, can be
  // freely shared between different types of sorted data.

  // General item types:
  TY_NEW            = $00000001;      // Item is new
  TY_CONFIRMED      = $00000002;      // Item still exists
  TY_MAIN           = $00000004;      // Main item (thread or module)
  TY_INVALID        = $00000008;      // Invalid type (item does not exist)
  TY_SELECTED       = $80000000;      // Reserved for multiple selection

  // Module-specific types:
  TY_REPORTED       = $00000010;      // Stop on module was reported

  // Reference-specific types:
  TY_REFERENCE      = $00000020;      // Item is a real reference
  TY_ORIGIN         = $00000040;      // Item is a search origin

  // Breakpoint-specific types:
  TY_STOPAN         = $00000080;      // Stop animation if TY_ONESHOT
  TY_SET            = $00000100;      // Code INT3 is in memory
  TY_ACTIVE         = $00000200;      // Permanent breakpoint
  TY_DISABLED       = $00000400;      // Permanent disabled breakpoint
  TY_ONESHOT        = $00000800;      // Temporary stop
  TY_TEMP           = $00001000;      // Temporary breakpoint
  TY_KEEPCODE       = $00002000;      // Set and keep command code
  TY_KEEPCOND       = $00004000;      // Keep condition unchanged (0: remove)
  TY_NOUPDATE       = $00008000;      // Don't redraw breakpoint window
  TY_RTRACE         = $00010000;      // Pseudotype of run trace breakpoint

  // Namelist-specific types:
  TY_EXPORT         = $00010000;      // Exported name
  TY_IMPORT         = $00020000;      // Imported name
  TY_LIBRARY        = $00040000;      // Name extracted from object file
  TY_LABEL          = $00080000;      // User-defined name
  TY_ANYNAME        = $000F0000;      // Any of the namelist flags above
  TY_KNOWN          = $00100000;      // Name of known function

  // Memory-specific types:
  TY_DEFHEAP        = $00020000;      // Contains default heap
  TY_HEAP           = $00040000;      // Contains non-default heap
  TY_SFX            = $00080000;      // Contains self-extractor
  TY_CODE           = $00100000;      // Contains image of code section
  TY_DATA           = $00200000;      // Contains image of data section
  TY_IMPDATA        = $00400000;      // Memory block includes import data
  TY_EXPDATA        = $00800000;      // Memory block includes export data
  TY_RSRC           = $01000000;      // Memory block includes resources
  TY_RELOC          = $02000000;      // Memory block includes relocation data
  TY_STACK          = $04000000;      // Contains stack of some thread
  TY_THREAD         = $08000000;      // Contains data block of some thread
  TY_HEADER         = $10000000;      // COFF header
  TY_ANYMEM         = $1FFE0000;      // Any of the memory flags above
  TY_GUARDED        = $20000000;      // NT only: guarded memory block

  // Procedure data-specific types:
  TY_PURE           = $00004000;      // No side effects except in stack
  TY_PASCAL         = $00010000;      // Procedure ends with RET nnn
  TY_C              = $00020000;      // ADD ESP,nnn after call to procedure
  TY_NOTENTRY       = $00100000;      // Not necessarily entry point

  // Switch data-specific types.
  TY_CHARSW         = $00100000;      // ASCII switch
  TY_WMSW           = $00200000;      // Window message switch
  TY_EXCEPTSW       = $00400000;      // Exception switch

  // Stack walk data-specific types.
  TY_RELIABLE       = $01000000;      // Reliable call
  TY_GUESSED        = $02000000;      // Not a real entry, just guessed
  TY_BELONGS        = $04000000;      // Not a real entry, just belongs to proc

  // Call tree-specific types.
  TY_RECURSIVE      = $00000100;      // Routine calls self
  TY_TERMINAL       = $00000200;      // Leaf function, doesn't call others
  TY_SYSTEM         = $00000400;      // Function resides in system DLL
  TY_DIRECT         = $00000800;      // Called directly
  TY_NODATA         = $00001000;      // Not analyzed or outside procedure
  TY_DUMMY          = $00002000;      // Consists of single RET command
  TY_NOSIDE         = $00004000;      // No side effects except in stack

type
  t_scheme = packed record            // Color scheme
    name: PChar;                      // Name of the scheme
    textcolor: Integer;               // Colour used to draw text
    hitextcolor: Integer;             // Colour used to draw highlited text
    lowcolor: Integer;                // Colour used to draw auxiliary text
    bkcolor: Integer;                 // Colour used to draw backgrounds
    selbkcolor: Integer;              // Colour used for selecting background
    linecolor: Integer;               // Colour used for separating lines
    auxcolor: Integer;                // Colour used for auxiliary objects
    condbkcolor: Integer;             // Colour used for background of cond brk
  end;

  t_schemeopt = packed record         // Color scheme, alternative form
    name: PChar;                      // Name of the scheme
    color: array[0..7] of Integer;    // Colours used as in t_scheme
  end;

  p_bar = ^t_bar;
  t_bar = packed record               // Number of active columns
    nbar: Integer;                    // Font used for bar segments
    font: Integer;                    // Actual widths of columns, pixels
    dx: array[0..NBAR-1] of Integer;  // Default widths of columns, chars
    defdx:array[0..NBAR-1] of Integer;// Column names (may be NULL)
    name: array[0..NBAR-1] of PChar;  // Combination of BAR_xxx bits
    mode: array[0..NBAR-1] of Char;   // One of CAPT_xxx, set to CAPT_FREE
    captured: Integer;                // Info about how mouse is captured
    active: Integer;                  // Previous mouse coordinate
    prevx: Integer;
  end;

  p_sortheader = ^t_sortheader;
  t_sortheader = packed record        // Header of sorted data field
    addr: ULONG;                      // Base address of the entry
    size: ULONG;                      // Size address of the entry
    type_ul: ULONG;                   // Entry type, TY_xxx
  end;

  SORTFUNC = function(const p1, p2: p_sortheader; sort: Integer): Integer; cdecl;
  DRAWFUNC = function(s: PChar; mask: PChar; select: PInteger;
                      ps: p_sortheader; column: Integer): Integer; cdecl;
  DESTFUNC = procedure(pe: p_sortheader); cdecl;

const
  AUTOARRANGE: SORTFUNC = SORTFUNC(1);  // Autoarrangeable sorted data

type
  p_sorted = ^t_sorted;                 // Descriptor of sorted table
  t_sorted = packed record              // Name of table, as appears in error
    name: array[0..MAX_PATH-1] of Char; // Actual number of entries
    n: Integer;                         // Maximal number of entries
    nmax: Integer;                      // Index of selected entry or -1
    selected: Integer;                  // Base address of selected entry
    seladdr: ULONG;                     // Size of single entry
    itemsize: Integer;                  // Unique version of table
    version: ULONG;                     // Entries, sorted by address
    data: Pointer;                      // Function which sorts data or NULL
    sortfunc: SORTFUNC;                 // Destructor function or NULL
    destfunc: DESTFUNC;                 // Sorting criterium (column)
    sort: Integer;                      // Whether indexes are sorted
    sorted: Integer;                    // Indexes, sorted by criterium
    index: PInteger;                    // Suppress multiple overflow errors
    suppresserr: Integer;
  end;

  p_table = ^t_table;
  t_table = packed record               // Window with sorted data and bar
    hw: HWND;                           // Handle of window or NULL
    data: T_SORTED;                     // Sorted data
    bar: T_BAR;                         // Description of bar
    showbar: Integer;                   // Bar: 1-displayed, 0-hidden, -1-absent
    hscroll: SmallInt;                  // Horiz. scroll: 1-displayed, 0-hidden
    colsel: SmallInt;                   // Column in TABLE_COLSEL window
    mode: Integer;                      // Combination of bits TABLE_xxx
    font: Integer;                      // Font used by window
    scheme: SmallInt;                   // Colour scheme used by window
    hilite: SmallInt;                   // Syntax highlighting used by window
    offset: Integer;                    // First displayed row
    xshift: Integer;                    // Shift in X direction, pixels
    drawfunc: DRAWFUNC;                 // Function which decodes table fields
  end;


Var
  Createsorteddata             : function  (sd: p_sorted; name: PChar; itemsize: Integer; nmax: Integer; sortfn: SORTFUNC; destfn: DESTFUNC): Integer; cdecl;
  Destroysorteddata            : procedure (sd: p_sorted); cdecl;
  Addsorteddata                : function  (sd: p_sorted; item: Pointer): Pointer; cdecl;
  Deletesorteddata             : procedure (sd: p_sorted; addr: ULONG); cdecl;
  Deletesorteddatarange        : procedure (sd: p_sorted; addr0: ULONG; addr1: ULONG); cdecl;
  Deletenonconfirmedsorteddata : function  (sd: p_sorted): Integer; cdecl;
  Findsorteddata               : function  (sd: p_sorted; addr: ULONG): Pointer; cdecl;
  Findsorteddatarange          : function  (sd: p_sorted; addr0: ULONG; addr1: ULONG): Pointer; cdecl;
  Findsorteddataindex          : function  (sd: p_sorted; addr0: ULONG; addr1: ULONG): Integer; cdecl;
  Sortsorteddata               : function  (sd: p_sorted; sort: Integer): Integer; cdecl;
  Getsortedbyselection         : function  (sd: p_sorted; index: Integer): Pointer; cdecl;
  Defaultbar                   : procedure (pb: p_bar) cdecl;
  Tablefunction                : function  (pt: p_table; hw: HWND; msg: Word; wp: WPARAM; lp: LPARAM): Integer; cdecl;
  Painttable                   : procedure (hw: HWND; pt: p_table; getline: DRAWFUNC); cdecl;
  Gettableselectionxy          : function  (pt: p_table; column: Integer; px: PInteger; py: PInteger): Integer; cdecl;
  Selectandscroll              : procedure (pt: p_table; index: Integer; mode: Integer); cdecl;


////////////////////////////////////////////////////////////////////////////////
///////////////////////////////// NAME FUNCTIONS ///////////////////////////////

// Types of names used in name functions. Note that higher-priority types have
// smaller identifiers!

const
  NM_NONAME         = $00;              // Undefined name
  NM_ANYNAME        = $FF;              // Name of any type

  // Names saved in the data file of module they appear.
  NM_PLUGCMD        = $30;              // Plugin commands to execute at break
  NM_LABEL          = $31;              // User-defined label
  NM_EXPORT         = $32;              // Exported (global) name
  NM_IMPORT         = $33;              // Imported name
  NM_LIBRARY        = $34;              // Name from library or object file
  NM_CONST          = $35;              // User-defined constant
  NM_COMMENT        = $36;              // User-defined comment
  NM_LIBCOMM        = $37;              // Comment from library or object file
  NM_BREAK          = $38;              // Condition related with breakpoint
  NM_ARG            = $39;              // Arguments decoded by analyzer
  NM_ANALYSE        = $3A;              // Comment added by analyzer
  NM_BREAKEXPR      = $3B;              // Expression related with breakpoint
  NM_BREAKEXPL      = $3C;              // Explanation related with breakpoint
  NM_ASSUME         = $3D;              // Assume function with known arguments
  NM_STRUCT         = $3E;              // Code structure decoded by analyzer
  NM_CASE           = $3F;              // Case description decoded by analyzer

⌨️ 快捷键说明

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