home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Tools / ProcDump 1.6.2 / SCRIPT.TXT < prev    next >
Encoding:
Text File  |  1999-12-17  |  6.4 KB  |  276 lines

  1. Script Extension for ProcDump32 :
  2. ─────────────────────────────────
  3.  
  4.  Technically the goal of such script is to :
  5.  
  6.      ┌────────────────────────────────────────────────────────────────┐
  7.      │1) defeat ADT                                                   │
  8.      │2) -> Find Last instruction BEFORE jumping to ORIGINAL CODE <-  │
  9.      │3) Run step mode as later as possible to speed up tracing       │
  10.      └────────────────────────────────────────────────────────────────┘
  11.  
  12. A) Function Definitions :
  13. ─────────────────────────
  14.  
  15.  1) Look function.
  16.  
  17.   the Look function scan for an HEX string in the loader object. The Address,
  18.  where this block is found, is stored so that u can set a breakpoint at this
  19.  location. Wildcard usage is allowed for BYTE. Search result is handled 
  20.  internally and u may use the conditionnal jmp to handle urself result.
  21.  
  22.  Ex:
  23.  
  24.   Look 0F,85 will search for a JNE long jump. U may want to set a Breakpoint
  25.   via the BP command.
  26.  
  27.   Look EB,? will seacrh for a short jump.
  28.  
  29.  2) ADD function.
  30.  
  31.   Allows u to Add a value to the current Address in mem (ex: the one spotted
  32.  by the look command or by the POS command).
  33.  
  34.  3) DEC function.
  35.  
  36.   Guess ;)
  37.  
  38.  4) REPL function.
  39.  
  40.   This function apply a patch (HEX Sequence) at the current memory location
  41.  (ex: the one spotted by look command). This may allow u to kick an ADT ;).
  42.  
  43.  Ex:
  44.  
  45.   REPL 90,90 will apply a double NOP starting at current memory location.
  46.  
  47.  5) BP function.
  48.  
  49.   Set a breakpoint at current memory location.
  50.  
  51.  6) BPX function.
  52.  
  53.   Set a breakpoint at a given location. The location is depending on object
  54.  start.
  55.  
  56.  Ex: If loader object start at RVA 66000h, BPX 2672 will set a breakpoint at
  57.  RVA 68672.
  58.  
  59.  7) BPF function (Break On Flag).
  60.  
  61.   This function will check each time breakpoint occurs if flag u passed on is
  62.  set/unset. Breakpoint location is the current memory location.
  63.  
  64.  Unset│Set│ Meaning
  65.  ─────┼───┼────────────────
  66.   c   │ C │ Carry flag.
  67.   p   │ P │ Positiv Flag.
  68.   a   │ A │ Above Flag.
  69.   z   │ Z │ Zero Flag.
  70.   s   │ S │ Sign Flag.
  71.   d   │ D │ Direction Flag.
  72.   o   │ O │ Overflow Flag.
  73.  
  74.  U can only test ONE flag.
  75.  
  76.  8) BPC function
  77.  
  78.   Break at Local Eip until counter is reached.
  79.  
  80.         BPC 15    (Breakpoint 15h times at Local Eip).
  81.  
  82.  9) BPV function
  83.  
  84.   Break at Eip until value is reached in Registers.
  85.  
  86.         BPV EAX=5 (Breakpoint when EAX=5 at Local Eip).
  87.  
  88.  10) MOVE Function
  89.  
  90.   Set Current EIP. Add param value to current EIP. BE CAREFULL WITH THIS !!!!
  91.  NO CONTROL ARE DONE about the EIP. Try to use this instead of noping a loca-
  92.  tion, IF there was a CRC check u will defeat it ;).
  93.  
  94.   Ex: MOVE 14  will move current EIP to EIP+14h
  95.  
  96.  11) POS function.
  97.  
  98.   Set current memory location FOR ALL FUNCTIONS. The location is depending on
  99.  object start.
  100.  
  101.  12) STEP function.
  102.  
  103.   This set the step by step analyzis. This is used to finished the trace
  104.  generally. BEWARE: Step mode means each lines will be tested -> SLOW !!.
  105.  So SET step mode as later as possible.
  106.  
  107.  13) OBJR function.
  108.  
  109.   This set the base memory to start to scan. Affect LOOK command.
  110.  
  111.  14) BPREG
  112.  
  113.   Set a breakpoint at Register value.
  114.  
  115.  15) WALK
  116.  
  117.   Execute the next instruction and return control to ProcDump32.
  118.  
  119.  16) EIP
  120.  
  121.   Say that next EIP has to be used as Original EntryPoint.
  122.  
  123.   Note : After a breakpoint, the next EIP is the breakpoint address itself !
  124.  
  125.  17) Launch external file for helping.
  126.  
  127.   Launch an external file with specifics params. An ini file of ur choice is
  128.   created on the fly with specifics values (HEX). It contains :
  129.  
  130.   . Pid of the Process.
  131.   . All registers value including EIP.
  132.   . Local EIP value.
  133.  
  134.   Example :
  135.  
  136.    in script :
  137.  
  138.     ...
  139.     L5=HELP PDHelp.Exe Helper.ini
  140.     ...
  141.  
  142.     Command line of ur helper will contain <Path to helper.ini>\"helper.ini".
  143.  
  144.    in helper.ini :
  145.  
  146.     [REG]
  147.     Dr0=00000000
  148.     Dr1=00000000
  149.     Dr2=00000000
  150.     Dr3=00000000
  151.     Dr6=00000000
  152.     Dr7=00000000
  153.     SegGs=00000000
  154.     SegFs=00000FDF
  155.     SegEs=00000167
  156.     SegDs=00000167
  157.     Edi=00000000
  158.     Esi=8161D244
  159.     Ebx=00000000
  160.     Edx=8161D2A4
  161.     Ecx=8161D264
  162.     Eax=0043E9B4
  163.     Ebp=00456000
  164.     Eip=00456264
  165.     SegCs=0000015F
  166.     Flags=00000216
  167.     Esp=0068FE34
  168.     SegSs=00000167
  169.     Pid=FFC1E943
  170.     Local=00456264
  171.  
  172.   I think this is quite flexible ;).
  173.  
  174.   Note : Command Line is limited to 512 chars for both helper EXE & helper
  175.          INI path. This limitation is internal to ProcDump, It is however
  176.      possible that WINDOWS API is limited to a path of 256 chars.
  177.  
  178.  18) JMP, JZ, JN Command
  179.  
  180.   Allow u to move at a given script line. 
  181.  
  182.   for conditionnal jump, the flag from Look command will be used :
  183.  
  184.    If search was sucessfull, Z flag is set otherwise it is unset.
  185.  
  186.   Ex: 
  187.  
  188.    L1=JMP 5
  189.    L5=LOOK EB,?
  190.    L6=JZ 8
  191.    L7=QUIT
  192.    L8=....
  193.  
  194.  19) Quit command.
  195.  
  196.   Abort script interpretation, Ie if a look command failed or whatever.
  197.  
  198.  
  199. B) Options format in a script entry :
  200. ─────────────────────────────────────
  201.  
  202.  Options are stored in DWORD format and start with OPTL.
  203.  
  204.  OPTL1 =
  205.   DWORD : represent the Delay in ms for AutoDump.
  206.  
  207.  OPTL2 =
  208.   BYTE  : Auto EIP
  209.   BYTE  : Ignore Faults
  210.   BYTE  : FastMode Dump
  211.   BYTE  : ExternalPredump
  212.  
  213.  OPTL3 =
  214.   BYTE  : Optimize PE
  215.   BYTE  : Auto Compute Objects
  216.   BYTE  : Trace API
  217.   BYTE  : Auto Layer
  218.  
  219.  OPTL4 =
  220.   BYTE  : Raw Mode
  221.   BYTE  : Import Rebuild Type
  222.   BYTE  : Restore Header
  223.   BYTE  : Restore Relocs
  224.  
  225.  OPTL5 =
  226.   BYTE  : Reserved
  227.   BYTE  : Reserved
  228.   BYTE  : Check Header
  229.   BYTE  : Merge Code
  230.  
  231.  For more details... check ProcDump Options explanations.
  232.  
  233. C) How to set ur own protectors/packers definitions :
  234. ─────────────────────────────────────────────────────
  235.  
  236.  1) Update Index section :
  237.  ─────────────────────────
  238.  
  239.   Add a Pxx statement .... be carefull the xx value must follow the previous
  240.  protector one.
  241.  
  242.  Example :
  243.  
  244.  before
  245.  
  246.   [INDEX]
  247.   P1=Shrinker 3.3
  248.   P2=Wwpack32 Beta 9
  249.   P3=Wwpack32 1.0
  250.  
  251.  after
  252.  
  253.   [INDEX]
  254.   P1=Shrinker 3.3
  255.   P2=Wwpack32 Beta 9
  256.   P3=Wwpack32 1.0
  257.   P4=My Own definition
  258.  
  259.  2) Add ur definition :
  260.  ──────────────────────
  261.  
  262.   A definition is composed of lines statements which must be something like
  263.  Lxx.
  264.  
  265.  Ex:
  266.  
  267.   [My own definition]
  268.  
  269.   L1=Look 0F,85,DB,FF,FF
  270.   L2=BP
  271.   L3=STEP
  272.  
  273.  You can add too default options for this definition. Add the OPTLx in this
  274.  section as well to do that. If no default options are specified,  ProcDump
  275.  will use the actual ones.
  276.