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

📄 x86il.c

📁 可以将机器码计算为汇编指令并且算出指令长度的C头文件。在编写Ring0或Ring3的Inline Hook时不可缺少的东西。
💻 C
字号:
#include <stdlib.h>
#include <stdio.h>

#include "X86IL.h"

void main(int argc, char **argv) {
  int Bits;
  unsigned char AnaI[32];
  int nPfx;
  int iModRM;
  int ISize;
  int ILength;
  int i;
  unsigned char *Start;
  unsigned int fisize, j = 0;
  FILE *fi;

  if(argc > 2) {
    Bits = 32 -strtoul(argv[1], NULL, 0);
    fi = fopen(argv[2], "rb");
    if(fi) {
      fseek(fi, 0, SEEK_END);
      fisize = ftell(fi);
      fseek(fi, 0, SEEK_SET);
      Start = (unsigned char *)malloc(fisize +32);
      fread(Start, 1, fisize, fi);
      fclose(fi);
      while(j < fisize) {
        ILength = X86IL(Bits, Start +j, AnaI, &nPfx, &iModRM, &ISize);
        i = (iModRM ? iModRM +(AnaI[iModRM-1] == 0xF ? 1 : 0) : ILength -ISize) -nPfx;
        printf("\n%.8X  %i %i %i %i %i ", j, ILength, nPfx, i, iModRM ? ILength -nPfx -i -ISize : 0, ISize);
        for(i = 0; i < ILength; i++) {
          printf(" %.2X", AnaI[i]);
        }
        j += ILength;
      }
    }
  }
  else {
    printf("X86IL <16|32|64> <FileName>");
  }
}

⌨️ 快捷键说明

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