Advertisement
Guest User

test

a guest
Jan 29th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define BEA_ENGINE_STATIC  /* specify the usage of a static version of BeaEngine */
  4. #define BEA_USE_STDCALL    /* specify the usage of a stdcall version of BeaEngine */
  5. #include "BeaEngine.h"
  6. int main(int argc, char* argv [])
  7. {
  8.      
  9.     /* ============================= Init datas */
  10.     DISASM MyDisasm;
  11.     int len, i = 0;
  12.     int Error = 0;
  13.      
  14.     /* ===================== display the version and revision used */
  15.         (void) printf("Version : %s\n", BeaEngineVersion());
  16.         (void) printf("Revision : %s\n", BeaEngineRevision());
  17.     /* ============================= Init the Disasm structure (important !)*/
  18.     (void) memset (&MyDisasm, 0, sizeof(DISASM));
  19.  
  20.     /* ============================= Init EIP */
  21.     MyDisasm.EIP = (UIntPtr) &main;
  22.  
  23.     /* ============================= Loop for Disasm */
  24.     while ((!Error) && (i<20)){
  25.         len = Disasm(&MyDisasm);
  26.         if (len != UNKNOWN_OPCODE) {
  27.             (void) puts(MyDisasm.CompleteInstr);
  28.             MyDisasm.EIP = MyDisasm.EIP + (UIntPtr)len;
  29.             i++;
  30.         }
  31.         else {
  32.             Error = 1;
  33.         }
  34.     };
  35.     return 0;
  36.      
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement