WEB开发网
开发学院网络安全黑客技术 PE文件格式(3) 阅读

PE文件格式(3)

 2007-01-14 20:15:00 来源:WEB开发网   
核心提示: #defineSTD_OUTPUT_HANDLE-11UL#definehello"hello,world"__declspec(dllimport)unsignedlong__stdcallGetStdHandle(unsignedlonghdl);__declspe
  #defineSTD_OUTPUT_HANDLE-11UL
  #definehello"hello,world "
  __declspec(dllimport)unsignedlong__stdcall
  GetStdHandle(unsignedlonghdl);
  __declspec(dllimport)unsignedlong__stdcall
  WriteConsoleA(unsignedlonghConsoleOutput,
          constvoid*buffer,
          unsignedlongchrs,
          unsignedlong*written,
          unsignedlongunused
          );
  staticunsignedlongwritten;
  voidstartup(void)
  {
    WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE),hello,sizeof(hello)-1,&written,0);
    return;
  }

汇编语言

  startup:
        ;参数WriteConsole(),逆向
  6A00          push   0x00000000
  68????????      push   offset_written
  6A0D          push   0x0000000d
  68????????      push   offsethello
        ;参数GetStdHandle()
  6AF5          push   0xfffffff5
  2EFF15????????   call   dwordptrcs:__imp__GetStdHandle@4
        ;resultislastparameterforWriteConsole()
  50            push   eax
  2EFF15????????   call   dwordptrcs:__imp__WriteConsoleA@20
  C3            ret   
  hello:
  68656C6C6F2C20776F726C640A "hello,world "
  _written:
  00000000

下面是链接器:

上一页  1 2 3 4 5 6 7 8 9  下一页

Tags:PE 文件 格式

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接