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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vars.pas

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

interface

uses
  Classes, Procs, PEFile, dcDecomps, dcUnits, dcTypeIntf;

type
  TVarConst  = set of (vtVar, vtConst);
  TDecompType = (dtNormal, dtResString);

  { TVar }

  TVar = class(TDecompItem)
  private
    FInitValue: Pointer;
    FVarConst: TVarConst;
    FDecomps: TList;
    FDecompTypes: TList;
    FOffsets: TList;
    FName: string;
    FRefVar: Boolean;
    FVarSize: Integer;
    FContainType: Boolean;
    FType: IdcType;
    FAppendBefore: TAppendType;
    FAppendAfter: TAppendType;
    procedure SetInitValue(Value: Pointer);
    function GetDecompCount: Integer;
    function GetDecompItem(Index: Integer): TDecompItem;
    function GetDecompType(Index: Integer): TDecompType;
    function GetOffset(Index: Integer): Integer;
    function GetDeclaration: string;
    procedure SetVarSize(Value: Integer);
    procedure SetAppendBefore(Value: TAppendType);
    procedure SetAppendAfter(Value: TAppendType);
  protected
    procedure SetSize(Value: Integer); override;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure AddDecomp(Decomp: TDecompItem; Offset: Integer; DecompType: TDecompType);
    function IsRefAddress(AAddress: PChar): Boolean; override;

    property InitValue: Pointer read FInitValue write SetInitValue;
    property VarConst: TVarConst read FVarConst write FVarConst;
    property DecompCount: Integer read GetDecompCount;
    property DecompItems[Index: Integer]: TDecompItem read GetDecompItem;
    property DecompItemTypes[Index: Integer]: TDecompType read GetDecompType;
    property OffSet[Index: Integer]: Integer read GetOffset;
    property Name: string read FName write FName;
    property ContainType: Boolean read FContainType write FContainType;
    property VarDecl: string read GetDeclaration;
    property VarSize: Integer read FVarSize write SetVarSize;
    property AType: IdcType read FType;
    property AppendBefore: TAppendType read FAppendBefore write SetAppendBefore;
    property AppendAfter: TAppendType read FAppendAfter write SetAppendAfter;
    // If RefVar is true a reference to the value of the var must be replaced by
    // a reference to the address and there shouldn't by a ref direct to the var
    // and the size must be 4, exactly on the decompitem.
    property RefVar: Boolean read FRefVar write FRefVar;
  end;

  { TVarInfos }

  TVarInfos = class(TDecompCollection)
  private
    function GetItem(Index: Integer): TVar;
    procedure SetItem(Index: Integer; Value: TVar);
  public
    procedure LoadVars;
    procedure LoadFixups;
    procedure LoadInitVars;
    procedure DeterUnits;
    procedure GenerateNames;
    function IndexOfName(Name: string): Integer;
    function IndexOfAddress(AAddress: PChar): Integer;
    procedure LoadVar(Address: PChar; Name: string; AUnit: TUnit);
    property Items[Index: Integer]: TVar read GetItem write SetItem; default;
  end;

implementation

uses
  {$IFOPT D+}dcDebug, Dialogs,{$ENDIF}
  PEFileClass, SysUtils, SysVars, NameMangling;

type
  PWord = ^Word;
  PCardinal = ^Cardinal;

{ TVar }

constructor TVar.Create(Collection: TCollection);
begin
  inherited Create(Collection);
  FVarConst := [vtVar, vtConst];
  FContainType := True;
  FType := CreateType;
end;

destructor TVar.Destroy;
begin
  FreeMem(FInitValue);
  FDecomps.Free;
  FDecompTypes.Free;
  FOffsets.Free;
  inherited Destroy;
end;

procedure TVar.SetInitValue(Value: Pointer);
begin
  Move(Value^, FInitValue^, VarSize);
end;

function TVar.GetDecompCount: Integer;
begin
  if FDecomps = nil then
    Result := 0
  else
    Result := FDecomps.Count;
end;

function TVar.GetDecompItem(Index: Integer): TDecompItem;
begin
  if FDecomps = nil then
    raise EDecompilerError.Create('Var has no decomps');
  Result := TDecompItem(FDecomps[Index]);
end;

function TVar.GetDecompType(Index: Integer): TDecompType;
begin
  if FDecompTypes = nil then
    raise EDecompilerError.Create('Var has no decomps');
  Result := TDecompType(FDecompTypes[Index]);
end;

function TVar.GetOffset(Index: Integer): Integer;
begin
  if FOffsets = nil then
    raise EDecompilerError.Create('Var has no decomps');
  Result := Integer(FOffsets[Index]);
end;

procedure TVar.SetSize(Value: Integer);
begin
  inherited SetSize(Value);
  VarSize := Value;
end;

procedure TVar.AddDecomp(Decomp: TDecompItem; Offset: Integer; DecompType: TDecompType);
begin
  if FDecomps = nil then
  begin
    FDecomps := TList.Create;
    FOffsets := TList.Create;
    FDecompTypes := TList.Create;
  end;
  FDecomps.Add(Decomp);
  FDecompTypes.Add(Pointer(DecompType));
  AddReq(Decomp, nil);
  FOffsets.Add(Pointer(Offset));
end;

function TVar.GetDeclaration: string;

  function GetIntValue(Address: PChar; Size: Integer): Cardinal;
  begin
    case Size of
      1: Result := PByte(Address)^;
      2: Result := PWord(Address)^;
      4: Result := PCardinal(Address)^;
      else
        raise EDecompilerError.CreateFmt('Unknown integer value %d', [Size]);
    end;
  end;

  function GetTypeName: string;
  const
    TypeName: array[1..4] of string = ('Byte', 'Word', '', 'Cardinal');

    function GetArrayName(ArraySize: Integer = 4): string;
    var
      I: Integer;
    begin
      if Size mod ArraySize = 0 then
      begin
        Result := Format('array[0..%d] of %s', [Size div ArraySize -1, TypeName[ArraySize]]);
        if Address < PEFileClass.BSS then
        begin
          Result := Format('%s = (%u', [Result, GetIntValue(InitValue, ArraySize)]);
          for I := 1 to VarSize div ArraySize -1 do
            Result := Format('%s, %u', [Result, GetIntValue(PChar(InitValue) + I * ArraySize, ArraySize)]);
          Result := Result + ')';
        end;
      end
      else
        Result := GetArrayName(ArraySize div 2);
    end;

  type
    TXType = (xtByte, xtWord, xtCardinal, xtString, xtPointer, xtArray);
    // if XType is xtArray then the XType after it is the the xType of the array and
    // the Value after that is the number of elements.
  var
    Types: TList;

    procedure AddVarTypes(ASize: Integer);
    var
      I: Integer;
   begin
      if ASize mod 4 = 0 then
        for I := 0 to ASize div 4 -1 do
          Types.Add(Pointer(xtCardinal))
      else if ASize mod 2 = 0 then
        for I := 0 to ASize div 2 -1 do
          Types.Add(Pointer(xtWord))
      else
        for I := 0 to ASize -1 do
          Types.Add(Pointer(xtByte))
    end;

    function GetXTypeSize(Index: Integer): Integer;
    const
      XTypeSize: array[TXType] of Integer =
        (1, 2, 4, 4, 4, 33);
    begin
      if Types[Index] = Pointer(xtArray) then
        Result := Integer(Types[Index +1]) * GetXTypeSize(Index + 1)
      else
        Result := XTypeSize[TXType(Types[Index])];
    end;

    function GetXTypeName(Index: Integer): string;
    const
      XTypeName: array[TXType] of string =
        ('Byte', 'Word', 'Cardinal', 'string', 'Pointer', 'Error');
    begin
      if Types[Index] = Pointer(xtArray) then
        Result := Format('array[0..%d] of %s', [Integer(Types[Index + 2])-1,
          GetXTypeName(Index + 1)])
      else
        Result := XTypeName[TXType(Types[Index])];
    end;

    function GetXTypeInitName(Index: Integer; Offset: Integer): string;
    var
      I: Integer;
    begin
      case TXType(Types[Index]) of
        xtByte: Result := IntToStr(PByte(PChar(InitValue) + Offset)^);
        xtWord: Result := IntToStr(PWord(PChar(InitValue) + Offset)^);
        xtCardinal: Result := IntToStr(PWord(PChar(InitValue) + Offset)^);
        xtPointer:
          begin
            for I := 0 to DecompCount -1 do
              if Self.Offset[I] = Offset then
              begin
                if DecompItems[I] is TProc then
                  Result := '@' + TProc(DecompItems[I]).Name
                else if DecompItems[I] is TVar then
                  Result := '@' + TVar(DecompItems[I]).Name
                else if DecompItems[I] is TStringInfo then
                  Result := '@' + TStringInfo(DecompItems[I]).Name
                else if DecompItems[I] is TClassInfo then
                  Result := TClassInfo(DecompItems[I]).AClass.ClassName
                else
                  raise EDecompilerError.CreateFmt('Undefined const, %s', [DecompItems[I].ClassName]);
              end;
          end;
        xtString:
          begin
            for I := 0 to DecompCount -1 do
              if Self.Offset[I] = Offset then
              begin
                Result := EnhQuotedStr((DecompItems[I] as TStringInfo).Value);
                Break;
              end;
          end;
        xtArray:
          begin
            Result := '(';
            for I := 0 to Integer(Types[Index + 2]) -1 do
              Result := Result + GetXTypeInitName(Index + 1, Offset + I * GetXTypeSize(Index +1)) + ', ';
            SetLength(Result, Length(Result) -1);
            Result[Length(Result)] := ')';
          end;
      end;
    end;

  var
    I, J: Integer;
  begin
    if DecompCount = 0 then
    begin
      // If there are known decomp items referenced use a array of a byte, Word or dword.
      if Address < PEFileClass.BSS then
        Result := '%s = %u'
      else
        Result := '%s';
      if VarSize in [1, 2, 4] then
        Result := Format(Result, [TypeName[VarSize], GetIntValue(InitValue, VarSize)])
      else
        Result := GetArrayName;
    end
    else
    begin
      Types := TList.Create;
      try
        // Create a list of the var Types.
        I := 0;
        J := 0;
        while J <> VarSize do
        begin
          if I >= DecompCount then
          begin
            // No decomp item after J
            AddVarTypes(VarSize - J);
            J := Size;
          end
          else if Offset[I] <> J then
          begin
            // No decomp item untile Offset[I]
            AddVarTypes(Offset[I] - J);
            J := OffSet[I];
          end
          else
          begin
            // Decomp item at J.
            if DecompItemTypes[I] = dtResString then
              Types.Add(Pointer(xtString))
            else
            begin
              if (DecompItems[I] is TStringInfo) and
                 (TStringInfo(DecompItems[I]).StringType in [stAnsiString]) then
                Types.Add(Pointer(xtString))
              else
                Types.Add(Pointer(xtPointer));
            end;
            Inc(J, 4);
            Inc(I);
          end;
        end;

        // Replace a row of Types with xtArray
        I := 0;
        while I < Types.Count -2 do
        begin
          if Types[I] = Types[I+1] then
          begin
            J := I+2;
            while (J < Types.Count) and (Types[J] = Types[I])  do
              Inc(J);
            Types[I] := Pointer(xtArray);
            Types.Insert(I + 2, Pointer(J - I));
            I := I + 3;
            while (I < Types.Count) and (Types[I] = Types[I-2]) do
              Types.Delete(I);
          end
          else
            Inc(I);
        end;

        // Create a record using the Types.
        if (Types.Count = 1) or
           ((Types.Count = 3) and (Types[0] = Pointer(xtArray))) then
          Result := GetXTypeName(0) + ' = ' + GetXTypeInitName(0, 0)
        else
        begin
          I := 0;
          Result := 'record';
          while I < Types.Count do
          begin

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品成人网| 7777精品伊人久久久大香线蕉的| 26uuu精品一区二区| 精品一区二区国语对白| 久久色.com| 色综合中文字幕| 亚洲国产综合色| 欧美一区二区高清| 国产精品1区2区3区| 亚洲欧美精品午睡沙发| 欧美高清视频在线高清观看mv色露露十八 | 无吗不卡中文字幕| 日韩一区二区麻豆国产| 国产a视频精品免费观看| 综合电影一区二区三区 | 欧美va亚洲va香蕉在线| 大尺度一区二区| 亚洲国产一区二区三区青草影视 | 日韩欧美在线影院| 国产.精品.日韩.另类.中文.在线.播放| 国产精品久久久久国产精品日日| 欧美性做爰猛烈叫床潮| 九九精品一区二区| 亚洲人成伊人成综合网小说| 91麻豆精品国产91久久久久| 成人在线视频一区二区| 亚洲国产乱码最新视频| 国产日本亚洲高清| 欧美老女人在线| 成人ar影院免费观看视频| 视频一区视频二区中文| 国产欧美一区二区在线观看| 欧美性欧美巨大黑白大战| 国产一区二三区好的| 亚洲精品久久嫩草网站秘色| 26uuu成人网一区二区三区| 欧美亚洲国产怡红院影院| 国模套图日韩精品一区二区| 亚洲福利视频一区| 国产精品毛片大码女人| 欧美草草影院在线视频| 91麻豆精东视频| 国产成人啪午夜精品网站男同| 亚洲在线视频网站| 国产精品美女久久久久高潮| 欧美mv日韩mv| 欧美精品久久久久久久久老牛影院| 成人av电影免费观看| 亚洲午夜激情av| 综合电影一区二区三区| 国产午夜亚洲精品不卡| 精品嫩草影院久久| 欧美日韩第一区日日骚| 欧洲亚洲精品在线| youjizz久久| 国产高清视频一区| 国产一区二区三区av电影| 日本不卡视频一二三区| 亚洲成a人片在线观看中文| 亚洲黄色小视频| 自拍偷拍欧美精品| 国产精品毛片无遮挡高清| 久久久不卡影院| 26uuu精品一区二区三区四区在线| 欧美一区二区视频在线观看2022| 欧美无人高清视频在线观看| 色狠狠av一区二区三区| 色伊人久久综合中文字幕| 成人免费三级在线| www.欧美亚洲| 色一情一伦一子一伦一区| voyeur盗摄精品| 99久久精品费精品国产一区二区| 高清av一区二区| 成人国产在线观看| 99精品黄色片免费大全| 91在线无精精品入口| 一本一道综合狠狠老| 91丨国产丨九色丨pron| 97久久精品人人澡人人爽| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 日韩电影在线一区二区| 婷婷中文字幕综合| 奇米色777欧美一区二区| 美洲天堂一区二卡三卡四卡视频 | 91一区一区三区| 91丨porny丨中文| 欧美三级电影在线观看| 欧美日韩国产天堂| 日韩精品一区二区三区四区 | 成人精品免费看| 99精品1区2区| 精品婷婷伊人一区三区三| 欧美一区二区三区免费| 精品国产乱码久久久久久影片| 久久精品网站免费观看| 亚洲色图丝袜美腿| 日韩av中文在线观看| 国产精品亚洲一区二区三区妖精 | 亚洲天堂免费在线观看视频| 亚洲欧美日韩电影| 日本va欧美va瓶| 国产成人av福利| 一本色道久久综合精品竹菊| 9191成人精品久久| 久久久久久影视| 亚洲男人的天堂在线观看| 婷婷综合在线观看| 成人福利视频在线| 欧美老肥妇做.爰bbww| 国产亚洲女人久久久久毛片| 亚洲日本乱码在线观看| 蜜桃精品视频在线| 91蜜桃免费观看视频| 欧美一级高清片| 亚洲乱码国产乱码精品精98午夜| 日韩精品1区2区3区| va亚洲va日韩不卡在线观看| 91精品国产综合久久精品图片| 国产日韩v精品一区二区| 日韩专区欧美专区| 不卡的av电影| 欧美videossexotv100| 一区二区三区中文字幕| 国产成人在线看| 欧美一区二视频| 亚洲美女少妇撒尿| 国产盗摄一区二区三区| 51精品秘密在线观看| 亚洲欧美日韩在线不卡| 国产在线一区二区| 91精品中文字幕一区二区三区| 国产精品麻豆欧美日韩ww| 久久国产夜色精品鲁鲁99| 在线观看欧美日本| 国产精品美女久久久久久久| 黄色成人免费在线| 欧美老女人在线| 一区二区久久久久久| 成人午夜大片免费观看| 精品国产亚洲一区二区三区在线观看| 亚洲一二三四区不卡| 暴力调教一区二区三区| 国产偷国产偷精品高清尤物| 老司机午夜精品| 欧美精品在线视频| 亚洲国产aⅴ成人精品无吗| www.日韩精品| 国产精品国产三级国产aⅴ入口| 国产美女主播视频一区| 欧美一级视频精品观看| 日韩成人一级片| 69堂精品视频| 亚洲va国产天堂va久久en| 色乱码一区二区三区88| 亚洲少妇屁股交4| 99re热这里只有精品免费视频| 国产午夜久久久久| 国产精品自拍三区| 国产亚洲人成网站| 国产精品一色哟哟哟| 精品久久久网站| 久久精品国产精品亚洲红杏| 日韩视频中午一区| 久草精品在线观看| 欧美精品一区二区三区视频| 久久国内精品自在自线400部| 91精品国产综合久久福利软件| 日韩在线播放一区二区| 欧美高清性hdvideosex| 免费在线观看一区二区三区| 日韩免费高清视频| 国产在线精品视频| 亚洲国产高清在线| 一本一道综合狠狠老| 亚洲靠逼com| 欧美日韩国产高清一区二区三区| 日本视频中文字幕一区二区三区| 在线成人免费观看| 精品无人码麻豆乱码1区2区 | 看片网站欧美日韩| 久久蜜桃香蕉精品一区二区三区| 国产91色综合久久免费分享| 中文字幕在线不卡| 欧美日韩成人在线一区| 久久国产尿小便嘘嘘尿| 国产欧美一区二区三区在线老狼| 顶级嫩模精品视频在线看| 亚洲你懂的在线视频| 8v天堂国产在线一区二区| 久久99久久久欧美国产| 国产精品视频yy9299一区| 色婷婷激情综合| 久久 天天综合| 国产精品国产精品国产专区不片| 欧洲一区二区三区免费视频| 另类小说综合欧美亚洲| 中文字幕中文乱码欧美一区二区 | 精品99一区二区三区| av电影一区二区|