Yes. Whats odd, is it works without the Load_Library_Require_Signed_Target and I cant see or find any more info on this flag, like how it actually works.
There is a possibility it might only work with GroupPolicy because GPO’s can block apps if the program certificate rule doesnt match whats stored in the GPO, and I’m on win11 Home which has no GPO’s. Other than that I cant find anything slightly related.
This is the code:
ISEQ:LoadLibraryEx:Dont_Resolve_Dll_References Equate(00000001h) !Static Imports not loaded if EXE
ISEQ:LoadLibraryEx:Load_Ignore_Code_Authz_Level Equate(00000010h) !bypass applocker or group policy rules, use for setup programs. Must be running as TrustedInstaller or LocalSystem and is security risk!
ISEQ:LoadLibraryEx:Load_Library_As_DataFile Equate(00000002h)
ISEQ:LoadLibraryEx:Load_Library_As_DataFile_Exclusive Equate(00000040h)
ISEQ:LoadLibraryEx:Load_Library_As_Image_Resource Equate(00000020h)
ISEQ:LoadLibraryEx:Load_Library_Search_Application Equate(00000200h)
ISEQ:LoadLibraryEx:Load_Library_Search_Default_Dirs Equate(00001000h)
ISEQ:LoadLibraryEx:Load_Library_Search_Dll_Load_Dll Equate(00000100h)
ISEQ:LoadLibraryEx:Load_Library_Search_System32 Equate(00000800h)
ISEQ:LoadLibraryEx:Load_Library_Search_User_Dirs Equate(00000400h)
ISEQ:LoadLibraryEx:Load_With_Altered_Search_path Equate(00000008h) ! if used, absolute path in the filename is used and uses altered search stategy. if relative path, behaviour is "undefined"
ISEQ:LoadLibraryEx:Load_Library_Require_Signed_Target Equate(00000080h) ! Dlls need to be signed
ISEQ:LoadLibraryEx:Load_Library_Safe_Current_Dirs Equate(00002000h) ! use dlls in current directory, provided current directory is in the Safe load list, what ever that is!
! No flag used makes LoadLibraryExA work like LoadLibraryA if loading a dll and doesnt call DLLMain
Module('WinApi') ! LoadLibrarysEx & FreeLibrarysEx
ISWA_LoadLibraryExA( <CONST *Cstring>, Long = 0, Long ), HModule, Pascal, Raw, Name( 'LoadLibraryExA' )
!ISWA_LoadLibraryExA( Long, Long = 0, Long ), HModule, Pascal, Name( 'LoadLibraryExA' )
ISWA_CallWindowProcA(Long,Ulong,Ulong,Ulong,Long),Long,Pascal,Name('CallWindowProcA')
ISWA_GetProcAddress(Long,Long),Long,Raw,Pascal,Name('GetProcAddress')
ISWA_FreeLibrary(Long),Bool,Raw,Pascal,Name('FreeLibrary')
End
Loc:LoadLibrarySearchFlags = ISEQ:LoadLibraryEx:Load_Library_Search_System32 !+ |
!ISEQ:LoadLibraryEx:Load_Library_Require_Signed_Target
LoadLibraryEx Procedure(String pDllFilename, String pProcedureName )
Code
LLQ:DLLFilename = pDllFilename
LLQ:LoadLibraryHandle = ISWA_LoadLibraryExA( LLQ:DLLFilename, 0, Loc:LoadLibrarySearchFlags )
!LLQ:LoadLibraryHandle = ISWA_LoadLibraryExA( Address(LLQ:DLLFilename), 0, Loc:LoadLibrarySearchFlags )
IF LLQ:LoadLibraryHandle
LLQ:ProcedureName = pProcedureName
LLQ:ProcedureAddress = ISWA_GetProcAddress( LLQ:LoadLibraryHandle, Address( LLQ:ProcedureName ) )
IF LLQ:ProcedureAddress = 0
LLQ:ProcedureName = pProcedureName & ' Error : '
LLQ:ProcedureAddress = ISWA_GetLastError()
End
Else
LLQ:DLLFilename = pDllFilename & ' Error : '
LLQ:LoadLibraryHandle = ISWA_GetLastError()
End
Add( GLO:LoadLibraryQ )