#include #include #include #pragma hdrstop #include "disasm.h" int Decodeaddress(tchar *s,ulong addr) { if (addr<1024 || addr>50000) return 0; return sprintf(s,"LABEL_%x",addr); }; int main(int argc,tchar* argv[]) { int m,n,len,cmdlen,pos,ncmd; uchar *cmd; tchar *pmsg,s[512]; ulong t; t_disasm da; FILE *f,*g; Preparedisasm(); f=fopen("disasm.exe","rb"); fseek(f,0,SEEK_END); len=ftell(f); fseek(f,0,SEEK_SET); cmd=(uchar *)malloc(len); fread(cmd,len,1,f); fclose(f); // First loop: determine length of the command, no text. printf("Determine command length and get information:\n"); pos=0; ncmd=0; t=GetTickCount(); while (pos0) { for (n=0; n<30; n++) s[n]=T(' '); for (m=0; m