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

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

?? moduleloader.pas

?? 用DELPHI寫的網(wǎng)卡啟動禁用程序
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{******************************************************************}
{                                                                  }
{       Project JEDI                                               }
{       OS independent Dynamic Loading Helpers                     }
{                                                                  }
{ The initial developer of the this code is                        }
{ Robert Marquardt <robert_marquardt@gmx.de)                       }
{                                                                  }
{ Copyright (C) 2000, 2001 Robert Marquardt.                       }
{                                                                  }
{ Obtained through:                                                }
{ Joint Endeavour of Delphi Innovators (Project JEDI)              }
{                                                                  }
{ You may retrieve the latest version of this file at the Project  }
{ JEDI home page, located at http://delphi-jedi.org                }
{                                                                  }
{ The contents of this file are used with permission, subject to   }
{ the Mozilla Public License Version 1.1 (the "License"); you may  }
{ not use this file except in compliance with the License. You may }
{ obtain a copy of the License at                                  }
{ http://www.mozilla.org/NPL/NPL-1_1Final.html                     }
{                                                                  }
{ Software distributed under the License is distributed on an      }
{ "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or   }
{ implied. See the License for the specific language governing     }
{ rights and limitations under the License.                        }
{                                                                  }
{******************************************************************}

{$I jvcl.inc}

unit ModuleLoader;

{$WEAKPACKAGEUNIT ON}

interface

{$IFDEF MSWINDOWS}

uses
  Windows;

type
  // Handle to a loaded DLL
  TModuleHandle = HINST;

{$ENDIF MSWINDOWS}

{$IFDEF LINUX}
uses
  Types, Libc;

type
  // Handle to a loaded .so
  TModuleHandle = Pointer;

{$ENDIF LINUX}

const
  // Value designating an unassigned TModuleHandle or a failed loading
  INVALID_MODULEHANDLE_VALUE = TModuleHandle(0);

function LoadModule(var Module: TModuleHandle; FileName: string): Boolean;
function LoadModuleEx(var Module: TModuleHandle; FileName: string; Flags: Cardinal): Boolean;
procedure UnloadModule(var Module: TModuleHandle);
function GetModuleSymbol(Module: TModuleHandle; SymbolName: string): Pointer;
function GetModuleSymbolEx(Module: TModuleHandle; SymbolName: string; var Accu: Boolean): Pointer;
function ReadModuleData(Module: TModuleHandle; SymbolName: string; var Buffer; Size: Cardinal): Boolean;
function WriteModuleData(Module: TModuleHandle; SymbolName: string; var Buffer; Size: Cardinal): Boolean;

// (p3)
// Simple DLL loading class. The idea is to use it to dynamically load
// a DLL at run-time using the GetProcedure method. Another (better) use is to derive a
// new class for each DLL you are interested in and explicitly call GetProcedure for
// each function in an overriden Load method. You would then add procedure/function
// aliases to the new class that maps down to the internally managed function pointers.
// This class is built from an idea I read about in Delphi Magazine a while ago but
// I forget who was the originator. If you know, let me know and I'll put it in the credits

// NB!!!
// * Prepared for Kylix but not tested
// * Is GetLastError implemented on Kylix? RaiseLastOSError implies it is...

type
  TModuleLoadMethod = (ltDontResolveDllReferences, ltLoadAsDataFile, ltAlteredSearchPath);
  TModuleLoadMethods = set of TModuleLoadMethod;

  TModuleLoader = class(TObject)
  private
    FHandle: TModuleHandle;
    FDLLName: string;
    function GetLoaded: Boolean;
  protected
    procedure Load(LoadMethods: TModuleLoadMethods); virtual;
    procedure Unload; virtual;
    procedure Error(ErrorCode: Cardinal); virtual;
  public
    // Check whether a DLL (and optionally a function) is available on the system
    // To only check the DLL, leave ProcName empty
    class function IsAvaliable(const ADLLName: string; const AProcName: string = ''): Boolean;
    constructor Create(const ADLLName: string; LoadMethods: TModuleLoadMethods = []);
    destructor Destroy; override;
    // Get a pointer to a function in the DLL. Should be called as GetProcedure('Name',@FuncPointer);
    // Returns True if the function was found. Note that a call to GetProcAddress is only executed if AProc = nil
    function GetProcedure(const AName: string; var AProc: Pointer): Boolean;
    // Returns a symbol exported from the DLL and puts it in Buffer.
    // Make sure AName is actually a symbol and not a function or this will crash horribly!
    function GetExportedSymbol(const AName: string; var Buffer; Size: Integer): Boolean;
    // Changes a symbol exported from the DLL into the value in Buffer.
    // The change is not persistent (it will get lost when the DLL is unloaded)
    // Make sure AName is actually a symbol and not a function or this will crash horribly!
    function SetExportedSymbol(const AName: string; var Buffer; Size: Integer): Boolean;

    property Loaded: Boolean read GetLoaded;
    property DLLName: string read FDLLName;
    property Handle: TModuleHandle read FHandle;
  end;

implementation

{$IFDEF MSWINDOWS}
// load the DLL file FileName
// the rules for FileName are those of LoadLibrary
// Returns: True = success, False = failure to load
// Assigns: the handle of the loaded DLL to Module
// Warning: if Module has any other value than INVALID_MODULEHANDLE_VALUE
// on entry the function will do nothing but returning success.

function LoadModule(var Module: TModuleHandle; FileName: string): Boolean;
begin
  if Module = INVALID_MODULEHANDLE_VALUE then
    Module := LoadLibrary(PChar(FileName));
  Result := Module <> INVALID_MODULEHANDLE_VALUE;
end;

// load the DLL file FileName
// LoadLibraryEx is used to get better control of the loading
// for the allowed values for flags see LoadLibraryEx documentation.

function LoadModuleEx(var Module: TModuleHandle; FileName: string; Flags: Cardinal): Boolean;
begin
  if Module = INVALID_MODULEHANDLE_VALUE then
    Module := LoadLibraryEx(PChar(FileName), 0, Flags);
  Result := Module <> INVALID_MODULEHANDLE_VALUE;
end;

// unload a DLL loaded with LoadModule or LoadModuleEx
// The procedure will not try to unload a handle with
// value INVALID_MODULEHANDLE_VALUE and assigns this value
// to Module after unload.

procedure UnloadModule(var Module: TModuleHandle);
begin
  if Module <> INVALID_MODULEHANDLE_VALUE then
    FreeLibrary(Module);
  Module := INVALID_MODULEHANDLE_VALUE;
end;

// returns the pointer to the symbol named SymbolName
// if it is exported from the DLL Module
// nil is returned if the symbol is not available

function GetModuleSymbol(Module: TModuleHandle; SymbolName: string): Pointer;
begin
  Result := nil;
  if Module <> INVALID_MODULEHANDLE_VALUE then
    Result := GetProcAddress(Module, PChar(SymbolName));
end;

// returns the pointer to the symbol named SymbolName
// if it is exported from the DLL Module
// nil is returned if the symbol is not available.
// as an extra the Boolean variable Accu is updated
// by anding in the success of the function.
// This is very handy for rendering a global result
// when accessing a long list of symbols.

function GetModuleSymbolEx(Module: TModuleHandle; SymbolName: string; var Accu: Boolean): Pointer;
begin
  Result := nil;
  if Module <> INVALID_MODULEHANDLE_VALUE then
    Result := GetProcAddress(Module, PChar(SymbolName));
  Accu := Accu and (Result <> nil);
end;

// get the value of variables exported from a DLL Module
// Delphi cannot access variables in a DLL directly, so
// this function allows to copy the data from the DLL.
// Beware! You are accessing the DLL memory image directly.
// Be sure to access a variable not a function and be sure
// to read the correct amount of data.

function ReadModuleData(Module: TModuleHandle; SymbolName: string; var Buffer; Size: Cardinal): Boolean;
var
  Sym: Pointer;
begin
  Result := True;
  Sym := GetModuleSymbolEx(Module, SymbolName, Result);
  if Result then
    Move(Sym^, Buffer, Size);
end;

// set the value of variables exported from a DLL Module
// Delphi cannot access variables in a DLL directly, so
// this function allows to copy the data to the DLL!
// BEWARE! You are accessing the DLL memory image directly.
// Be sure to access a variable not a function and be sure
// to write the correct amount of data.
// The changes are not persistent. They get lost when the
// DLL is unloaded.

function WriteModuleData(Module: TModuleHandle; SymbolName: string; var Buffer; Size: Cardinal): Boolean;
var
  Sym: Pointer;
begin
  Result := True;
  Sym := GetModuleSymbolEx(Module, SymbolName, Result);
  if Result then
    Move(Buffer, Sym^, Size);
end;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一二三四区| 亚洲第一电影网| 成人午夜伦理影院| 国产精品福利电影一区二区三区四区| 黑人精品欧美一区二区蜜桃 | 色综合天天综合在线视频| 日韩毛片视频在线看| 在线这里只有精品| 午夜久久久久久| 日韩精品一区二区在线观看| 久久99精品久久久久久国产越南| 久久久久久99精品| 99久久精品费精品国产一区二区| 一区二区视频免费在线观看| 欧美日韩国产中文| 国产永久精品大片wwwapp| 中文字幕乱码久久午夜不卡| 99精品欧美一区二区蜜桃免费 | 午夜精品久久久久久久蜜桃app| 91麻豆精品国产91久久久久久| 麻豆成人91精品二区三区| 久久久www免费人成精品| 成人av在线资源| 五月天激情小说综合| 久久久精品中文字幕麻豆发布| av激情综合网| 日本欧美一区二区| 中文字幕精品三区| 欧美精品一级二级三级| 国产一区二区伦理片| 亚洲欧美乱综合| 日韩免费看的电影| 91久久一区二区| 国产一区二区三区日韩| 亚洲乱码一区二区三区在线观看| 4hu四虎永久在线影院成人| 国产91丝袜在线观看| 日韩中文字幕1| 最新国产の精品合集bt伙计| 欧美tickle裸体挠脚心vk| 91麻豆精东视频| 精品一区二区免费| 亚洲国产aⅴ天堂久久| 亚洲国产成人午夜在线一区| 91精品午夜视频| 91在线视频播放| 国产成人啪免费观看软件| 日韩av不卡在线观看| 亚洲美女电影在线| 日本一区二区在线不卡| 日韩欧美中文字幕精品| 在线观看一区日韩| 成人av在线电影| 国产综合色在线| 奇米一区二区三区av| 亚洲一区二区三区四区在线| 中文字幕在线不卡视频| 久久久综合九色合综国产精品| 欧美人狂配大交3d怪物一区| 91久久精品一区二区三区| 成人福利视频网站| 国产河南妇女毛片精品久久久| 日韩电影在线看| 香蕉久久夜色精品国产使用方法 | 亚洲一区二区三区美女| 日本一区二区动态图| 2023国产精品自拍| 欧美成人猛片aaaaaaa| 91精品麻豆日日躁夜夜躁| 欧美日韩美少妇| 欧美日韩国产影片| 欧美日精品一区视频| 在线免费观看日本一区| 91浏览器在线视频| 色又黄又爽网站www久久| zzijzzij亚洲日本少妇熟睡| 成人激情午夜影院| 不卡视频在线看| 99精品久久久久久| 在线免费观看日本一区| 欧美怡红院视频| 欧美色国产精品| 欧美日韩在线播放三区| 欧美裸体bbwbbwbbw| 69p69国产精品| 日韩午夜在线观看视频| 久久人人爽爽爽人久久久| 久久蜜桃av一区二区天堂| 国产日韩欧美精品一区| 中文字幕一区二区日韩精品绯色| 亚洲特黄一级片| 亚洲一本大道在线| 日本欧美加勒比视频| 国产老肥熟一区二区三区| 成人中文字幕在线| 91麻豆免费观看| 欧美日韩国产精品成人| 欧美成人性战久久| 国产精品女人毛片| 亚洲一区在线观看免费| 久久国产免费看| 成人av资源下载| 欧美午夜精品一区二区三区| 欧美高清视频不卡网| 91精品免费观看| 精品国产百合女同互慰| 2021国产精品久久精品| 国产亚洲综合色| 一区二区国产视频| 日韩精品国产欧美| 国内精品伊人久久久久av影院 | 精品国产乱码久久久久久闺蜜| 国产三级欧美三级日产三级99| 日本一区二区三区在线观看| 国产精品久久二区二区| 一区二区三区四区在线播放| 亚洲v中文字幕| 国产一区二区三区电影在线观看| 91丨porny丨蝌蚪视频| 欧美婷婷六月丁香综合色| 欧美三级在线播放| 欧美大片顶级少妇| 精品日韩一区二区三区| 国产精品女同一区二区三区| 亚洲综合在线免费观看| 麻豆久久一区二区| 国产精品嫩草影院com| 亚洲精品一卡二卡| 国产一区二区看久久| 91在线视频免费91| 久久先锋资源网| 亚洲欧洲国产日韩| 肉色丝袜一区二区| k8久久久一区二区三区| 欧美日韩三级一区| 日韩限制级电影在线观看| 亚洲综合偷拍欧美一区色| 经典三级一区二区| 在线观看亚洲a| 国产拍揄自揄精品视频麻豆| 亚洲女同一区二区| 成人午夜私人影院| 日韩欧美另类在线| 一区二区三区精品久久久| 国产精品一区在线| 国产91精品入口| 久久久久九九视频| 日韩不卡手机在线v区| 99久久精品免费看国产免费软件| 欧美日韩精品欧美日韩精品一综合| 久久久www成人免费无遮挡大片| 亚洲主播在线播放| av日韩在线网站| 久久久久久97三级| 日韩激情视频网站| 这里只有精品99re| 亚洲精品欧美专区| www.在线成人| 国产三级精品三级在线专区| 激情欧美一区二区| 777奇米成人网| 亚洲综合一区二区| 99天天综合性| 久久久噜噜噜久噜久久综合| 国产一区二区三区av电影| 91精品中文字幕一区二区三区| 亚洲另类在线视频| 成人高清视频在线| 欧美mv日韩mv| 久久不见久久见免费视频1| 91精品国产乱| 日韩精品一级中文字幕精品视频免费观看 | 一区二区成人在线| 国产伦精品一区二区三区免费 | 亚洲午夜一二三区视频| 91丨porny丨中文| 一区免费观看视频| 国产成人在线观看免费网站| 精品国产免费人成在线观看| 秋霞午夜av一区二区三区| 欧美日韩国产在线播放网站| 亚洲国产精品一区二区www| 欧美三级视频在线| 亚洲成人福利片| 欧美视频在线观看一区| 亚洲国产中文字幕在线视频综合| 一本到高清视频免费精品| 午夜影院久久久| 欧美二区三区的天堂| 日本系列欧美系列| 欧美一级免费大片| 亚洲国产一二三| 日韩一级大片在线观看| 久久疯狂做爰流白浆xx| 日韩三级在线免费观看| 久草精品在线观看| 欧美成人女星排行榜| av中文字幕一区| 一个色综合网站| 欧美一区二区三区精品|