<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      秋·風

        博客園 :: 首頁 :: 博問 :: 閃存 :: 新隨筆 :: 聯系 :: 訂閱 訂閱 :: 管理 ::
      lazarus編寫龍芯的lazarus安裝工具需要確定當前系統的ABI版本,以下方法可以讀取linux執行文件elf的machine和flags信息:
          不同架構在e_machine和e_flags字段有不同值:
      
          架構          e_machine    e_flags
          x86           3            通常為0
          x86_64        62           通常為0
          ARM           40           ABI、浮點類型等
          AArch64       183          通常為0
          MIPS          8            ABI版本、字節序、架構級別等
          PowerPC       20           通常為0
          RISC-V        243          浮點ABI、擴展指令集等
          Loongarch64   258          ABI版本
              

      function GetABIVersion(const FileName: string): string;返回ABI的值

      function GetABIVersion(const FileName: string): string;
      type
        TElf32_Ehdr = packed record
          e_ident: array[0..15] of Byte;
          e_type: Word;
          e_machine: Word;
          e_version: Cardinal;
          e_entry: Cardinal;
          e_phoff: Cardinal;
          e_shoff: Cardinal;
          e_flags: Cardinal;  // 目標標志字段
          e_ehsize: Word;
          e_phentsize: Word;
          e_phnum: Word;
          e_shentsize: Word;
          e_shnum: Word;
          e_shstrndx: Word;
        end;
      
        TElf64_Ehdr = packed record
          e_ident: array[0..15] of Byte;
          e_type: Word;
          e_machine: Word;
          e_version: Cardinal;
          e_entry: UInt64;
          e_phoff: UInt64;
          e_shoff: UInt64;
          e_flags: Cardinal;  // 目標標志字段
          e_ehsize: Word;
          e_phentsize: Word;
          e_phnum: Word;
          e_shentsize: Word;
          e_shnum: Word;
          e_shstrndx: Word;
        end;
      var
        Fs: TFileStream;
        Ident: array[0..15] of Byte;
        Elf32: TElf32_Ehdr;
        Elf64: TElf64_Ehdr;
        Flags: Cardinal;
        i:Int64;
        cpuname:String;
        abi:String;
      begin
        Result := 'Unknown';
        Fs := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
        try
          // 讀取 ELF 標識
          Fs.ReadBuffer(Ident, SizeOf(Ident));
      
          // 驗證 ELF 魔數
          if (Ident[0] <> $7F) or (Ident[1] <> Byte('E')) or
             (Ident[2] <> Byte('L')) or (Ident[3] <> Byte('F')) then
          begin
            Exit; // 非 ELF 文件
          end;
      
          // 讀取完整的文件頭
          Fs.Position := 0;
          case Ident[4] of // EI_CLASS
            1: begin // ELFCLASS32
              Fs.ReadBuffer(Elf32, SizeOf(Elf32));
              Flags := Elf32.e_flags;
            end;
            2: begin // ELFCLASS64
              Fs.ReadBuffer(Elf64, SizeOf(Elf64));
              Flags := Elf64.e_flags;
            end;
            else Exit;
          end;
          cpuname:= IntToStr(Elf64.e_machine);
          if Elf64.e_machine=3 then
            cpuname:='x86';
          if Elf64.e_machine=62 then
            cpuname:='x86_64';
          if Elf64.e_machine=40 then
            cpuname:='arm';
          if Elf64.e_machine=183 then
            cpuname:='aarch64';
          if Elf64.e_machine=8 then
            cpuname:='mips';
          if Elf64.e_machine=20 then
            cpuname:='PowerPC';
          if Elf64.e_machine=243 then
            cpuname:='risc-v';
          if Elf64.e_machine=258 then
            cpuname:='loongarch64';
          abi:='';
          if Flags=3 then
            abi:='abi 1.0';
          if Flags=$43 then
            abi:='abi 2.0';
          Result:=abi;
        finally
          Fs.Free;
        end;
      end;

      使用方法:

      ShowMessage(GetABIVersion('/bin/ls'));

       

      posted on 2025-06-28 15:14  秋·風  閱讀(97)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 国产不卡免费一区二区| 成年黄页网站大全免费无码| 狠狠色噜噜狠狠狠狠777米奇| 丰满人妻熟妇乱又精品视| 欧美一区二区三区欧美日韩亚洲 | 旬阳县| 久久久久无码中| 视频一区视频二区视频三| 国产av一区二区三区无码野战 | 亚洲精品无码成人aaa片| 成人午夜福利视频一区二区| 亚洲AV色香蕉一区二区蜜桃小说| 国产精品无码素人福利不卡| 亚洲综合一区国产精品| 贵溪市| 曰韩高清砖码一二区视频| 在线精品视频一区二区三四| 亚洲日本国产精品一区| Y111111国产精品久久久| 加勒比色综合久久久久久久久| 88国产精品视频一区二区三区| 免费无码黄十八禁网站| 中文字幕国产精品自拍| 国产综合久久99久久| 亚洲精品入口一区二区乱| 亚洲国产精品一区二区久久| 亚洲av不卡电影在线网址最新| 国产欧美日韩高清在线不卡 | 亚洲综合日韩av在线| 亚洲成人av一区免费看| 米泉市| av日韩在线一区二区三区| 欲香欲色天天天综合和网| 国产精品无码a∨麻豆| 噜妇插内射精品| 国产成年码av片在线观看 | 人妻精品久久无码区| 亚洲国产一区二区三区亚瑟| 国产综合久久久久久鬼色| 国产精品无码av不卡| 国产一区在线播放av|