DLL Analyzer
Verfasst: 25.04.2005 22:52
Ich habe während den letzten 2 Tagen u.a. auch einen DLL analyzer zusammengeproggt... Hier ist das ergebnis, allerdings nur als Source... Werde bei Gelegenheit eventuell noch eine fertige EXE auf meinen Webspace uppen und den Link posten, mal sehen...
Und noch eine Frage: Welchen praktischen Wert hat eigentlich die "LibraryID"?
//EDIT: Und vielen Dank an Rings, der mich heute im englischen Chat dazu bewegt hat, den Text in der Progressbar mit DrawText() umzusetzen... Ich hätte sonst noch jahrelang nach einem API-Befehl gesucht...
Und noch eine Frage: Welchen praktischen Wert hat eigentlich die "LibraryID"?
Code: Alles auswählen
DesktopPath$ = Space (#MAX_PATH+1)
SHGetSpecialFolderLocation_ (0,0, @*itemid)
SHGetPathFromIDList_ (*itemid, @DesktopPath$)
If "\" <> Right(DesktopPath$,1)
DesktopPath$ + "\"
EndIf
LibraryPath$ = OpenFileRequester("Please select the DLL file you want to examine!",DesktopPath$,"DLL |*.dll | *.*|All files",-1)
Library$ = GetFilePart(LibraryPath$)
If OpenLibrary(0,LibraryPath$)
hwnd = OpenWindow(0,0,0,300,410,#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered,"hardfalcon's DLL analyzer")
If CreateGadgetList(hwnd)
LibraryFunctions = CountLibraryFunctions(0)
TextGadget(0,5,5,290,20,"Analyzing " + Library$ + "...",#PB_Text_Border)
ProgressBarGadget(1,5,30,290,20,0,LibraryFunctions,#PB_ProgressBar_Smooth)
TextGadget(2,5,55,290,20,"DLL ID: " + Str(LibraryID(0)),#PB_Text_Border)
TextGadget(3,5,80,290,20,"MD5 hash: " + MD5FileFingerprint(LibraryPath$),#PB_Text_Border)
ListIconGadget(4,5,105,290,300,"Function name",177,#PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect | #PB_ListIcon_HeaderDragDrop)
AddGadgetColumn(4,1,"Function address",93)
Else
CloseLibrary(0)
End
EndIf
If ExamineLibraryFunctions(0)
LibraryFunctionsString$ = Str(LibraryFunctions)
LoadFont(0,"Tahoma",8)
StartDrawing(WindowOutput())
DrawingFont(UseFont(0))
FrontColor(255,255,255)
DrawingMode(1)
While NextLibraryFunction()
Counter + 1
CounterString$ = Str(Counter)
SetGadgetText(0,"Analyzing " + Library$ + "...")
Select Counter
Case LibraryFunctions
ProgressBarString$ = LibraryFunctionsString$ + " functions found"
Default
ProgressBarString$ = "Function " + CounterString$ + " of " + LibraryFunctionsString$
EndSelect
Locate(150 - (TextLength(ProgressBarString$)/2),33)
DrawText(ProgressBarString$)
SetGadgetState(1,Counter)
AddGadgetItem(4,-1,LibraryFunctionName() + Chr(10) + Hex(LibraryFunctionAddress()))
Wend
StopDrawing()
SetGadgetText(0,"Analyzing of " + GetFilePart(LibraryPath$) + " finished.")
Repeat
Delay(1)
Until #PB_Event_CloseWindow = WindowEvent()
EndIf
CloseLibrary(0)
EndIf