亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pefileclass.pas

?? SrcDecompiler is about creating a Delphi program decompiler. The program is written for Delphi 4 or
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
unit PEFileClass;

interface

uses
  Classes, PEFile, Windows, SysUtils, TypInfo, dcDecompThread,
  {$IFOPT D+} dcdebug, dialogs, {$ENDIF}
  Vars, dcUnits, dcDecomps, Procs, dcNTInfoTypes, dcThrVar, dcDFMs;

type
  EDecompilerError = class(Exception);

  TProjectType = (ptProgram, ptDLL, ptPackage);

  { TPEFileClass }

  TPEFileClass = class(TPEFile)
  private
    FProjectType: TProjectType;
    FUsePackages: Boolean;
    FImportStart: PChar;
    FImportSize: Integer;
    FDecompThread: TdcDecompThread;
    function NotRecurFindTypeByName(const Name: string): TDecompItem;
    function NotRecurFindDecompItemByRef(AAddress: PChar): TDecompItem;
  public
    InitTable: PackageInfo;
    HasFFMTObj: Boolean;

    StringInfos: TStringInfos;
    Classes: TClassInfos;
    Interfaces: TInterfaces;
    TypeInfos: TTypeInfoInfos;
    NoTInfoTypes: TNoTInfoTypes;
    Procs: TProcs;
    Units: TUnits;
    Miscs: TMiscs;
    VarInfos: TVarInfos;
    EntryPointProc: TProc;
    Decomps: TDecompList;
    DFMs: TdcDFMs;
    constructor CreateDecomp(FileName: string; DecompThread: TdcDecompThread); virtual;
    destructor Destroy; override;
    procedure LoadPackages;

    function FindDecompItemByRef(AAddress: PChar): TDecompItem;
    function FindDecompItemByBlock(Address: PChar): TDecompItem;
    function FindDecompItemAfter(AAddress: PChar): TDecompItem;
    function FindTypeByName(const Name: string): TDecompItem;

    function FindSystemProc(const Name: string): TProc;

    property ProjectType: TProjectType read FProjectType;
    property UsePackages: Boolean read FUsePackages;
    property ImportStart: PChar read FImportStart;
    property ImportSize: Integer read FImportSize;
    property DecompThread: TdcDecompThread read FDecompThread;
  end;

function ListPointerToSort(Item1, Item2: Pointer): Integer;
function ListSimpleSort(Item1, Item2: Pointer): Integer;

function EnhQuotedStr(Str: string): string;

function IsIdentifier(Address: PChar): Boolean;

function IsPackage(const FileName: string): Boolean;

var
  PEFiles: array of TPEFileClass;

implementation

uses
  ObjFileConsts, DisAsm, VMTUtils, ProcDecomp, peExports,
  TypeInfoUtils, NameMangling;

{ TPEFileClass }

function ListPointerToSort(Item1, Item2: Pointer): Integer;
begin
  Result := PPChar(Item1)^ - PPChar(Item2)^;
end;

function ListSimpleSort(Item1, Item2: Pointer): Integer;
begin
  Result := Integer(Item1) - Integer(Item2);
end;

function DecompItemSort(Item1, Item2: Pointer): Integer;
begin
  Result := TDecompItem(Item1).Address - TDecompItem(Item2).Address;
end;

constructor TPEFileClass.CreateDecomp(FileName: string; DecompThread: TdcDecompThread);

  procedure LoadInitTable;
  var
    AAddress: PChar;
    I: Integer;
  resourcestring
    SErrorFindPckgInfoTable = 'Error finding the package info table';
    SErrorInInitTable = 'Error in init table';
  begin
    if ProjectType = ptPackage then
    begin
      // InitTable is pointed in the proc @PackageName@@GetPackageInfoTable$qqrv
      I := PEExports.FindCaseInSens('@' + ProjectName + '@@GetPackageInfoTable$qqrv');
      if I = -1 then
        raise EDecompilerError.Create(SErrorFindPckgInfoTable);
      InitTable := PPointer(PEExports[I].Address + 1)^;
    end
    else
    begin
      { InitTable is directly before the EntryPoint, search for the first non-fixups address
        which is not nil }
      AAddress := EntryPoint -4;
      while (PDWord(AAddress)^ = 0) or (Fixups.FindFixup(AAddress) <> -1) do
        Dec(AAddress, 4);
      InitTable := Pointer(AAddress);
    end;
    // There must be minimal 3 unit (system, SysInit, Project).
    if InitTable^.UnitCount < 3 then
      raise EDecompilerError.Create(SErrorInInitTable);
    // Create a block for the init table.
    with TDecompItem.Create(miscs) do
    begin
      Address := PChar(InitTable);
      RefAddress := PChar(InitTable);
      Size := InitTable^.UnitCount * 8 + 8;
      Comments.Add('InitTable');
    end;
  end;

  procedure RemoveProcsInAnother;
  var
    I, J: Integer;
  resourcestring
    SProcMayNotAppend = 'Proc may not append. %p';
  begin
    for I := Procs.Count -1 downto 0 do
    begin
      if Procs[I].Size <> 0 then
        for J := I +1 to Procs.Count -1 do
        begin
          if Procs[J].Address > Procs[I].Address + Procs[I].Size then
            Break;
          if Procs[J].Size <> 0 then
          begin
            if (Procs[J].Address >= Procs[I].Address) and
               (Procs[J].Address + Procs[J].Size <= Procs[I].Address + Procs[I].Size) then
            begin
              {$IFOPT D+}SendDebug(Format('Proc inside another proc %p *',
                 [Pointer(Procs[J].Address)]));{$ENDIF}
              if (Procs[J].AppendBefore = atMayNot) or (Procs[J].AppendAfter = atMayNot) then
              begin
                if Procs[I].AppendAfter = atMayNot then
                  raise EDecompilerError.CreateFmt(SProcMayNotAppend, [Pointer(Procs[J].Address)]);
                Procs[I].Size := Procs[J].Address - Procs[I].Address;
                Procs[I].ProcSize := Procs[I].Size;
                Procs[I].Comments.Add(Format('Proc truncated at %p', [Pointer(Procs[J].Address)]));
              end
              else
              begin
                Procs[I].Comments.Add(Format('Had a proc inside at %p', [Pointer(Procs[J].Address)]));
                Procs[J].Free;
              end;
              break;
            end;
          end;
        end;
    end;
  end;

  procedure AppendProcs;
  var
    Proc: TProc;
    I, J, K: Integer;
    Nothing: Boolean;
    DC: TDecompItem;
  label
    Next;
  resourcestring
    STryAppendNot4ByteProc = 'Not 4 byte aligend proc at %p can''t be appended';
  begin
    RemoveProcsInAnother;
    // Search all the not 4 byte aligned procs (not the ones in the sytem obj files).
    repeat
      Nothing := True;
    for I := Procs.Count -1 downto 1 do
    begin
      if (Procs[I].Size <> 0) and
         ((Procs[I].AUnit = nil) or (TUnit(Procs[I].AUnit).UnitType <> utSystem)) then
      begin
        // Search the first proc before the proc.
        J := I;
        repeat
          Dec(J);
          if J < 0 then
            goto Next;
        until Procs[J].Size <> 0;
        Proc := Procs[J];

        if (Integer(Procs[I].Address) mod 4 <> 0) and (Procs[I].AppendBefore <> atMayNot) then
        begin
          if Proc <> nil then
          begin
            {$IFOPT D+}
            if Procs[I].Address <> Proc.Address + Proc.Size then
              SendDebug(Format('Not filling between Proc %p %p, %p',
                [Pointer(Proc.Address), Pointer(Proc.Address + Proc.Size),
                      Pointer(Procs[I].Address)]));
            {$ENDIF}
            // Append the proc to the found proc.
            {$IFOPT D+} SendDebug(Format('Proc Append at %p and %p',
               [Pointer(Proc.Address), Pointer(Procs[I].Address)]));{$ENDIF}
            Proc.Append(Procs[I]);
            Nothing := False;
          end
          else
            raise EDecompilerError.CreateFmt(STryAppendNot4ByteProc, [Pointer(Procs[I].Address)]);
        end
        else
          if (Proc <> nil) and (Procs[I].Address = Proc.Address + Proc.Size) and
             ((Proc.AppendAfter = atMust) or (Procs[I].AppendBefore = atMust)) then
          begin
            if Proc.Size = 0 then
              goto Next;
            // Append the proc to the found proc.
            Proc.Comments.Add('Proc appended because one of the procs must');
            Proc.Append(Procs[I]);
            {$IFOPT D+}SendDebug(Format('Special Proc appended %p %p',
              [Pointer(Proc.Address), Pointer(Proc.Address + Proc.Size)]));{$ENDIF}
            Nothing := False;
          end;
        // Append the pchar before if it must append before.
        if Nothing and (Procs[I].AppendBefore = atMust) then
        begin
          DC := FindDecompItemByBlock(Procs[I].Address -1);
          if (DC <> nil) and (DC is TStringInfo) and
             (TStringInfo(DC).StringType = stPAnsiChar) then
          begin
            J := Procs[I].Address + Procs[I].Size - DC.Address;
            K := Procs[I].Address + Procs[I].ProcSize - DC.Address;
            Procs[I].Address := DC.Address;
            Procs[I].Size := J;
            Procs[I].ProcSize := K;
            DC.Free;
            Nothing := False;
          end;
        end;
      end;
      Next:
    end;
    until Nothing;
    DecompThread.CheckTerminated;
  end;

  procedure AlignProcs;
  var
    I: Integer;
  begin
    for I := 0 to Procs.Count -1 do
      if (Procs[I].AppendAfter <> atMust) and (Procs[I].Size mod 4 <> 0) then
        Procs[I].Size := Align4(Procs[I].Size);
  end;

  procedure CheckSystemCode;
  var
    LowestAddress: PChar;
    MaxAddress: PChar;
    I, J: Integer;
    CodeItems: TList;
    {$IFOPT D+}
    LastDC: TDecompItem;
    {$ENDIF}
  label
    Next;
  begin
    CodeItems := TList.Create;
    // Add all code items to the CodeItems list.
    CodeItems.Capacity := Classes.Count + TypeInfos.Count + Procs.Count + StringInfos.Count;
    for I := 0 to Classes.Count -1 do
      CodeItems.Add(Classes[I]);
    for I := 0 to TypeInfos.Count -1 do
      CodeItems.Add(TypeInfos[I]);
    for I := 0 to Procs.Count -1 do
      if (Procs[I].Size <> 0) and (Procs[I].Address <> nil) then
        CodeItems.Add(Procs[I]);
    for I := 0 to StringInfos.Count -1 do
      CodeItems.Add(StringInfos[I]);
    for I := 0 to Miscs.Count -1 do
      if Miscs[I].Address <> nil then
        CodeItems.Add(Miscs[I]);

    // Remove all the codeitem in the System unit to find overlapping code items and gaps.
    MaxAddress := Code;
    {$IFOPT D+}
    LastDC := nil;
    {$ENDIF}
    while (CodeItems.Count <> 0) and (MaxAddress <= Units.SystemUnit.FInit.Address) do
    begin
      LowestAddress := PChar(High(Integer));
      J := -1;
      for I := 0 to CodeItems.Count -1 do
      begin
        if TDecompItem(CodeItems[I]).Address < MaxAddress then
        begin
          {$IFOPT D+}
           raise EDecompilerError.CreateFmt('Overlapping code items %p %p %s' ,
             [Pointer(MaxAddress), Pointer(TDecompItem(CodeItems[I]).Address), LastDC.ClassName]);
          {$ELSE}
          raise EDecompilerError.CreateFmt('Overlapping code items %p %p' ,
             [Pointer(MaxAddress), Pointer(TDecompItem(CodeItems[I]).Address)]);
          {$ENDIF}
        end;
        if TDecompItem(CodeItems[I]).Address < LowestAddress then
        begin
          LowestAddress := TDecompItem(CodeItems[I]).Address;
          J := I;
        end;
      end;

     {$IFOPT D+}
       if LowestAddress <> MaxAddress then
         SendDebug(Format('System Gap between items %p %p',
          [Pointer(MaxAddress), Pointer(LowestAddress)]));
     {$ENDIF}
     Assert(J <> -1, 'J = -1');
      // Save the end address of the lowest code item as max address.
      MaxAddress := LowestAddress + TDecompItem(CodeItems[J]).Size;
      {$IFOPT D+}
      LastDC := TDecompItem(codeItems[J]);
      {$ENDIF}
      CodeItems.Delete(J);
    end;
    CodeItems.Free;
  end;

  procedure CheckCode;
  var
    MaxAddress: PChar;
    I: Integer;
    CodeItems: TList;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区在线看| 精品国产一区a| 亚洲欧美偷拍三级| 91婷婷韩国欧美一区二区| 国产精品青草综合久久久久99| 成人深夜在线观看| 亚洲三级理论片| 在线不卡中文字幕| 精品一区二区三区av| 久久久亚洲综合| 一本久久精品一区二区| 亚洲国产精品一区二区www | 亚洲资源在线观看| 91精品中文字幕一区二区三区| 免费在线观看不卡| 国产日韩欧美综合一区| 色婷婷av一区二区| 免费高清成人在线| 国产女同性恋一区二区| 色噜噜久久综合| 免费成人在线观看视频| 欧美—级在线免费片| 欧美最猛性xxxxx直播| 麻豆成人久久精品二区三区小说| 国产精品午夜在线观看| 欧美色综合网站| 国产高清成人在线| 亚洲网友自拍偷拍| 国产日韩三级在线| 欧美日韩久久久| 成熟亚洲日本毛茸茸凸凹| 亚洲一级二级在线| 中文字幕巨乱亚洲| 欧美精品一二三| www.性欧美| 蜜桃视频在线观看一区| 国产精品久久久久久久久久久免费看| 欧美日韩国产综合久久| 国产乱码精品一区二区三区av| 亚洲欧美日韩成人高清在线一区| 日韩欧美中文字幕制服| 99re视频这里只有精品| 久久电影国产免费久久电影| 综合久久国产九一剧情麻豆| 日韩精品一区二区在线| 在线观看不卡一区| 成人自拍视频在线| 蜜臀久久99精品久久久久久9| 亚洲欧洲韩国日本视频 | 欧美电影免费观看高清完整版在线| 风间由美一区二区av101| 免费看日韩a级影片| 亚洲欧美另类久久久精品2019| 久久―日本道色综合久久| 欧美高清dvd| 91国偷自产一区二区三区成为亚洲经典 | 日韩在线一二三区| 亚洲女同女同女同女同女同69| 久久美女艺术照精彩视频福利播放| 欧美精品免费视频| 色综合欧美在线视频区| 成人黄页毛片网站| 国产一区二区三区四区五区入口 | 欧美亚一区二区| 99在线热播精品免费| 丁香一区二区三区| 国产一区二区导航在线播放| 精品夜夜嗨av一区二区三区| 日韩av电影天堂| 香蕉乱码成人久久天堂爱免费| 亚洲视频一二区| ...xxx性欧美| 国产精品美女久久久久高潮| 日本一区二区久久| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产三级精品视频| 久久综合狠狠综合久久综合88| 亚洲精品一区二区三区四区高清| 欧美一区二区三区视频免费播放| 欧美色图在线观看| 欧美精品一二三四| 欧美一区二区在线免费观看| 欧美一区二区不卡视频| 欧美一区二区三区色| 日韩欧美一级在线播放| 欧美tk—视频vk| 久久精品一区二区三区不卡| 国产午夜精品一区二区| 国产精品久久三区| 有坂深雪av一区二区精品| 亚洲综合丁香婷婷六月香| 亚洲成av人片一区二区三区| 日日夜夜免费精品| 麻豆精品久久久| 精品系列免费在线观看| 成人国产电影网| 在线中文字幕一区二区| 欧美日本在线播放| 久久综合久久综合亚洲| 国产精品久久久久永久免费观看 | 麻豆精品久久久| 粉嫩在线一区二区三区视频| 色综合久久九月婷婷色综合| 欧美久久一区二区| 欧美xfplay| 国产精品不卡在线| 午夜精品久久久久久久99樱桃| 免费成人av在线播放| 国产999精品久久久久久绿帽| 91在线观看美女| 7777精品伊人久久久大香线蕉经典版下载| 欧美一区二区免费| 国产精品网站在线观看| 性做久久久久久久免费看| 国产精品性做久久久久久| 色婷婷香蕉在线一区二区| 日韩欧美国产综合| 国产精品久久777777| 日本91福利区| 成av人片一区二区| 日韩一区二区在线免费观看| 国产精品成人在线观看| 麻豆国产一区二区| 色综合一区二区| 26uuu亚洲综合色| 亚洲午夜羞羞片| 国产伦理精品不卡| 在线播放视频一区| 日韩一区中文字幕| 激情欧美日韩一区二区| 欧美性生活影院| 日本一区二区视频在线观看| 亚洲成人福利片| 不卡一区二区中文字幕| 亚洲精品一区二区三区在线观看| 亚洲精品va在线观看| 国产精一品亚洲二区在线视频| 欧美日韩国产精品成人| 亚洲素人一区二区| 国产精品66部| 日韩一区二区三区四区五区六区| 亚洲欧美偷拍另类a∨色屁股| 国产一区福利在线| 91精品国产手机| 亚洲成人福利片| 日本乱码高清不卡字幕| 中文字幕第一区第二区| 国产最新精品免费| 欧美一区二区三区系列电影| 洋洋成人永久网站入口| 91网站最新网址| 国产精品久久久久久久久果冻传媒| 国产在线视频一区二区三区| 欧美精品一卡二卡| 亚洲成人综合视频| 欧美亚洲国产bt| 亚洲午夜视频在线观看| 色综合欧美在线视频区| 日韩美女久久久| 成人国产精品免费| 国产精品欧美一区喷水| 国产成人精品www牛牛影视| 精品国产乱码久久| 九一九一国产精品| 欧美大度的电影原声| 久久99精品久久久| 精品国产乱码久久久久久久| 久久国产福利国产秒拍| 日韩亚洲欧美在线| 久久99精品久久久久久国产越南| 日韩欧美电影一区| 蜜臀av国产精品久久久久| 欧美videos大乳护士334| 美女视频黄 久久| 精品电影一区二区三区| 国产美女av一区二区三区| 久久久精品免费观看| 成人h版在线观看| 亚洲日本va在线观看| 色吧成人激情小说| 午夜精品久久久久久久蜜桃app| 欧美浪妇xxxx高跟鞋交| 日本中文字幕一区| 欧美精品一区二区三区很污很色的 | 国产免费成人在线视频| av一区二区久久| 亚洲免费在线观看视频| 欧美视频一区在线| 男女男精品视频网| 欧美tk—视频vk| jizzjizzjizz欧美| 洋洋成人永久网站入口| 日韩丝袜情趣美女图片| 国产在线日韩欧美| 亚洲丝袜精品丝袜在线| 欧美日韩国产综合久久| 国产高清不卡一区二区| 亚洲免费在线视频一区 二区| 在线电影一区二区三区| 国产福利视频一区二区三区|