Advertisement
Guest User

GetDLLEntryPoint Example

a guest
Jun 23rd, 2013
1,169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Structure ModuleInfo
  2.   lpBaseOfDll.l
  3.   SizeOfImage.l
  4.   EntryPoint.l
  5. EndStructure
  6.  
  7. Procedure GetDLLEntryPoint(sDLLNameHandle.s)
  8.   Protected lReturn.l
  9.   Dim ModuleInfo.ModuleInfo(1)
  10.   OpenLibrary(0,"PSAPI.DLL")
  11.   CallFunction(0,"GetModuleInformation",GetCurrentProcess_(),GetModuleHandle_(sDLLNameHandle),@ModuleInfo(),SizeOf(ModuleInfo))
  12.   CloseLibrary(0)
  13.   lReturn = ModuleInfo(0)\EntryPoint
  14.   FreeArray(ModuleInfo())
  15.   ProcedureReturn lReturn
  16. EndProcedure
  17.  
  18. ProcedureDLL AttachProcess(Instance)
  19.   OpenConsole()
  20.   lEntryPoint.l = GetDLLEntryPoint("d3d9.dll")
  21.   PrintN("d3d9.dll EntryPoint : "+Hex(lEntryPoint))
  22.   Input()
  23.   CloseConsole()
  24. EndProcedure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement