All pastes #820551 Raw Edit

Something

public text v1 · immutable
·published 2007-12-17 17:03 UTC
rendered paste body
#include <idc.idc>
#define MakeName(ea,name)            MakeNameEx(ea,name,SN_CHECK|SN_NOWARN)
static main()
{
  auto x,y,s,ss,se,f;
  x = here - Dword(here)*16;
  ss = SegStart(x);
  se = SegEnd(x);
  f = fopen("log.txt" , "w");
  while (1)
  {
    s = GetString(Dword(x+4), -1, ASCSTR_C);
    if (x>=here)
      break;
    y = Dword(x+8);
    fprintf(f, "%a: %s\n", y,s);
    Message("%a: %s\n", y,s);
    MakeDword(x);
    MakeDword(x+4);
    MakeDword(x+8);
    MakeDword(x+12);
    OpOff(x+4, 0, 0);
    OpOff(x+8, 0, 0);
    x = x+16;
    MakeStr(Dword(x+4), BADADDR);
    MakeName(y, s);
    if (y == BADADDR || y<ss || y>se) 
      continue;
    if (Dword(x-4)==0x500)
    {
      MakeCode(y);
      AutoMark(y,AU_PROC);
    }
  }
  fclose(f);
  Message("%a: end\n", x);
}