이 라이브러리는 더 이상 Windows 11 버전 24H2에서 작동하지 않습니다. 새로운 보안 개선 사항으로 인해 기능이 없어집니다. 아직 수정을 찾지 못했습니다!

MemoryDLL 장치는 Win64 환경에서 메모리에서 직접 동적 링크 라이브러리 (DLL)를로드하기위한 고급 기능을 제공합니다. 파일 시스템에서 DLL을로드하는 전통적인 메소드와 달리 MemoryDLL을 사용하면 바이트 어레이 또는 메모리 스트림에서 DLL을로드하고 기능 주소를 검색 한 후 모든 메모리를 내릴 수 있습니다. 이 라이브러리는 파일 시스템에 의존하지 않고 DLL을 관리 해야하는 Delphi/Freepascal 개발자에게 이상적입니다.
MemoryDll은 자리 표시 자 DLL 및 후크 기반로드를 사용하여 기존 파일 기반 DLL로드를 우회하여 메모리 인 DLL로드 및 리디렉션을 활성화합니다.
advapi32res.dll )을로드하려는 시도를 모니터링하여 특정 DLL을로드하기 위해 호출을 리디렉션합니다. 이 DLL은 후크가 메모리 내 DLL에 대한 리디렉션을 가로 채고 처리하는 트리거 역할을합니다. 호환성 ? : MemoryDLL 장치는 표준 DLL 인터페이스와 호환되므로 기존 응용 프로그램과 쉽게 통합 할 수 있습니다. 메모리 내 리디렉션 방법은 코드 주입과 같은 보안 위험을 줄이며 DLL 관리를위한 안전한 대안을 제공합니다.
메모리 이미지에서 모듈을로드하여 Windows API LoadLibrary 기능의 동작을 모방합니다. PE 형식을 구문 분석하고 필요한 재배치를 수행하며 수입을 해결하며 모듈을 초기화합니다.
Data: Pointer - PE 형식을 준수하는 메모리 이미지에 대한 포인터.0 나타 THandle .MemoryDLL을 프로젝트에 성공적으로 통합하려면 다음을 수행하십시오.
최신 버전을 다운로드 하시겠습니까?
패키지를 압축 해제하십시오
프로젝트에 MemoryDll을 추가하십시오
uses 섹션에 MemoryDll을 추가하십시오. 이 포함을 통해 MemoryDll 장치를 응용 프로그램에서 사용할 수 있습니다. 컴파일 오류를 피하기 위해 프로젝트 설정에서 MemoryDll 소스 파일의 경로가 올바르게 구성되어 있는지 확인하십시오.Windows API 호환성과 완벽한 통합
MemoryLoadLibrary 제공하여 쉽게 통합 할 수 있습니다. 로드되면 FreeLibrary 및 GetProcAddress 와 같은 표준 Windows API 호출은 마치 파일 시스템에서로드 된 것처럼 메모리 내 DLL을 관리하는 데 사용할 수 있습니다. 이 설계는 기존 코드의 최소한의 변경을 보장하여 Windows API 컨벤션과의 호환성을 유지하면서 효율적인 메모리 DLL 처리를 가능하게합니다.통합을 테스트하십시오
MemoryDll을 인스턴스화하려면 장치 구현 섹션 끝에 다음 코드를 포함하십시오. 이 코드는 DLL을 임베디드 리소스로로드하려고 시도합니다.
uses
Windows,
MemoryDLL;
...
implementation
{
This code is an example of using MemoryDLL to load an embedded a DLL directly
from an embedded resource in memory, ensuring that no filesystem access is
required. It includes methods for loading, initializing, and unloading the
DLL. The DLL is loaded from a resource with a GUID name, providing a measure
of security by obfuscating the resource’s identity.
Variables:
- DLLHandle: THandle
- A handle to the loaded DLL. Initialized to 0, indicating the DLL has
not been loaded. It is updated with the handle returned from
LoadLibrary when the DLL is successfullyloaded from memory.
Functions:
- LoadDLL: Boolean
- Loads the DLL from an embedded resource and initializes it by
retrieving necessary exported functions. Returns True if the DLL is
loaded successfully, otherwise False.
- b6eb28fd6ebe48359ef93aef774b78d1: string
- A GUID-named helper function that returns the resource name for the DLL.
This GUID-like name helps avoid easy detection of the resource.
- UnloadDLL: procedure
- Unloads the DLL by freeing the library associated with DLLHandle. Resets
DLLHandle to 0 to indicate the DLL is unloaded.
Initialization:
- The LoadDLL function is called during initialization, and the program will
terminate with code 1 if the DLL fails to load.
Finalization:
- The UnloadDLL procedure is called upon finalization, ensuring the DLL is
unloaded before program termination.
}
var
DLLHandle: THandle = 0 ; // Global handle to the loaded DLL, 0 when not loaded.
{
LoadDLL
--------
Attempts to load a DLL directly from a resource embedded within the executable
file. This DLL is expected to be stored as an RCDATA resource under a specific
GUID-like name.
Returns:
Boolean - True if the DLL is successfully loaded, False otherwise.
}
function LoadDLL (): Boolean;
var
LResStream: TResourceStream; // Stream to access the DLL data stored in the
resource.
{
b6eb28fd6ebe48359ef93aef774b78d1
---------------------------------
Returns the name of the embedded DLL resource. Uses a GUID-like name for
obfuscation.
Returns:
string - The name of the resource containing the DLL data.
}
function b6eb28fd6ebe48359ef93aef774b78d1 (): string;
const
// GUID-like resource name for the embedded DLL.
CValue = ' b87deef5bbfd43c3a07379e26f4dec9b ' ;
begin
Result := CValue;
end ;
begin
Result := False;
// Check if the DLL is already loaded.
if DLLHandle <> 0 then Exit;
// Ensure the DLL resource exists.
if not Boolean((FindResource(HInstance,
PChar(b6eb28fd6ebe48359ef93aef774b78d1()), RT_RCDATA) <> 0 )) then Exit;
// Create a stream for the DLL resource data.
LResStream := TResourceStream.Create(HInstance,
b6eb28fd6ebe48359ef93aef774b78d1(), RT_RCDATA);
try
// Attempt to load the DLL from the resource stream.
DLLHandle := MemoryLoadLibrary(LResStream.Memory);
if DLLHandle = 0 then Exit; // Loading failed.
// Retrieve and initialize any necessary function exports from the DLL.
GetExports(DLLHandle);
Result := True; // Successful load and initialization.
finally
LResStream.Free(); // Release the resource stream.
end ;
end ;
{
UnloadDLL
---------
Frees the loaded DLL, releasing any resources associated with DLLHandle,
and resets DLLHandle to 0.
}
procedure UnloadDLL ();
begin
if DLLHandle <> 0 then
begin
FreeLibrary(DLLHandle); // Unload the DLL.
DLLHandle := 0 ; // Reset DLLHandle to indicate the DLL is no longer loaded.
end ;
end ;
initialization
// Attempt to load the DLL upon program startup. Halt execution with error
// code 1 if it fails.
if not LoadDLL() then
begin
Halt( 1 );
end ;
finalization
// Ensure the DLL is unloaded upon program termination.
UnloadDLL();
이 장치는 A-Normal-User의 원래 MemoryDll-DllRedirect 프로젝트를 기반으로합니다. 우리는이 장치가 구축하는 기본 작업에 감사드립니다.
이 프로젝트는 BSD-3-Clause 라이센스 에 따라 라이센스가 부여되며, 특정 조건이 충족되면 수정 유무에 관계없이 재분배 및 소스 및 이진 형태의 재분배 및 사용할 수 있습니다. 그것은 허용과 기여자의 권리를 보호하는 것 사이의 균형을 유지합니다.
MemoryDll 에 대한 기여가 적극 권장됩니다. 자유롭게 문제를 제출하거나 새로운 기능을 제안하거나 기능과 견고성을 확장하기위한 풀 요청을 작성하십시오.

델파이에서 ❤️로 제작되었습니다