| |
|
|
 Stefan Schnell | allô Community, anbei un kleines Programme, dass es einfacher faire soll, Include-Fichiers pour Profan aus DLL-Fichiers trop erstellen: [...] 
avec diesem Programme peux une beliebige DLL ouvert volonté et ensuite wird aus cette une Include-Dossier pour Profan, im gleichen Verzeichnis, generiert. Einziges Manko, le nombre qui übergebenen paramètre peut pas ermittelt volonté et doit daher de main nachgetragen volonté, mais um Tipparbeit trop sparen déjà la fois un Anfang. Salut Stefan |
|
|
| |
|
|
|
 | qui Nombre de Params pourrait on peut-être avec einer art Brute-Force-Angriff feststellen. 
Salve. |
|
|
| |
|
|
|
 Stefan Schnell | allô Community, anbei une verbesserte Version, qui près de Include- aussi En-tête-Fichiers aus DLL-Fichiers erzeugen peux. Salut Stefan
P.S. Dank dem Code de Andreas volonté maintenant aussi qui paramètre ermittelt  |
|
|
| |
|
|
|
 Stefan Schnell | allô David, allô Community, la hâte Du car une concept comment wir cela dans Angriff prendre peut? (Im wahrsten Sinne des Wortes)
juste encore une autre Frage hinterher: Soweit je es verstanden habe, peux sur den (E)SP [=Stackpointer] oui le nombre notwendigen Bytes einer Funktion dans einer DLL ermittelt volonté. Hat là quelqu'un une Ansatz comment cela trop realisieren ist? suis pour Hinweise et Tips reconnaissant.
Salut Stefan |
|
|
| |
|
|
|
 | Na là kommwa qui l'affaire déjà bisl näher,- peut-être hilft uns un freeware-disassembler sur Consolenbasis cela Problem trop fixn. 
Salve. |
|
|
| |
|
|
|
 Andreas Miethe
 | [quote-part:65là66e5a3=Stefan vite]allô David, allô Community, la hâte Du car une concept comment wir cela dans Angriff prendre peut? (Im wahrsten Sinne des Wortes)
Salut Stefan[/quote-part:65là66e5a3] allô Stefan,
encore pas trouvé sur meiner page ?? [...]  |
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 20.10.2004 ▲ |
|
|
|
|
 Stefan Schnell | allô Andreas, non, encore pas gesehen ou bien est... mais toll... 
peux Du la fois den Code-Snippet, pour qui Ermittlung qui Nombre de paramètre, ici publizieren ou bien une source appeler? intéressé mich comment cela gemacht wird. 
merci et Salut Stefan |
|
|
| |
|
|
|
 Andreas Miethe
 | [quote-part:046234beca=Stefan vite]allô Andreas, non, encore pas gesehen ou bien est... mais toll... 
peux Du la fois den Code-Snippet, pour qui Ermittlung qui Nombre de paramètre, ici publizieren ou bien une source appeler? intéressé mich comment cela gemacht wird. 
merci et Salut Stefan[/quote-part:046234beca] peux je volontiers faire. c'est Pure-Basic Code, je n'en sais rien, si Du avec cela quelque chose anfangen peux.
kompletter Code :
!DisplayErrors.l = 1
Procedure.l hex2dec(h$)
h$=UCase(h$)
For r=1 To Len(h$)
d<<4 : a$=Milieu(h$,r,1)
Si Asc(a$)>60
d+Asc(a$)-55
D'autre
d+Asc(a$)-48
EndIf
Next
ProcedureReturn d
EndProcedure
Procedure GetNumberOfParam(Pointer)
Repeat
Pointer=DisASMCommand(Pointer)
ASM_Code.s=UCase(GetDisASMString())
Until FindString(ASM_Code.s,"RET",1)
Bytes=hex2dec(Right(ASM_Code.s,Len(ASM_Code.s)-4))
Si Bytes%4 Or Bytes>200:Bytes=-1:EndIf
Si Bytes>=0:Bytes=Bytes>>2:EndIf
ProcedureReturn Bytes
EndProcedure
Procedure BadName(nom.s)
Result=0
Si FindString(UCase(nom.s),"DLLENTRYPOINT",1):Result=-1:EndIf
Si FindString(UCase(nom.s),"DLLCANUNLOADNOW",1):Result=-1:EndIf
Si FindString(UCase(nom.s),"DLLGETCLASSOBJECT",1):Result=-1:EndIf
Si FindString(UCase(nom.s),"DLLREGISTERSERVER",1):Result=-1:EndIf
Si FindString(UCase(nom.s),"DLLUNREGISTERSERVER",1):Result=-1:EndIf
Si UCase(nom.s)="ATTACHPROCESS":Result=-1:EndIf
Si UCase(nom.s)="DETACHPROCESS":Result=-1:EndIf
Si UCase(nom.s)="ATTACHTHREAD":Result=-1:EndIf
Si UCase(nom.s)="DETACHTHREAD":Result=-1:EndIf
Si UCase(nom.s)="DLLINITIALIZE":Result=-1:EndIf
Si Len(nom.s)>100:Result=-1:EndIf
Si À gauche(nom.s,1)="?":Result=-1:EndIf
Si UCase(nom.s)="DUMMY":Result=-1:EndIf
ProcedureReturn Result
EndProcedure
DLL.s=ProgramParameter() ;<- executable erstellen et simple Dll droppen.
Si DLL = »
MessageRequester("Include_Generator","Die gewünschte Dll per Drag&Drop sur INC_Gen.Exe tirer!",64)
Fin
EndIf
Pbl.s=DLL
Point=FindString(Pbl,".",1)
Pbl=À gauche(Pbl,Point-1)+".Inc"
DllName.s = GetFilePart(Dll)
FullPath.s = Space(#MAX_PATH)
GetModuleFileName_(0,FullPath,#MAX_PATH)
;MessageRequester(Fullpath,GetPathPart(Fullpath),0)
FullPath = GetPathPart(Fullpath)
Inst=OpenLibrary(1,DLL.s)
Si Inst=0
MessageRequester("Fehler","Die DLL "+DLL+" konnte pas ouvert volonté.")
Fin
EndIf
Si CreateFile(0,FullPath+ReplaceString(GetFilePart(DLL),GetExtensionPart(DLL),"Inc"))=0
MessageRequester("Fehler","Die Dossier "+Pbl+" konnte pas erstellt volonté.")
Fin
EndIf
WriteStringN("############################################")
WriteStringN("generiert de Include-Generator pour XProfan")
WriteStringN("############################################")
WriteStringN("Original-PB-Code de Stefan Möbius")
WriteStringN("bearbeitet pour XProfan de Andreas Miethe")
WriteStringN("############################################")
WriteStringN(FormatDate("%dd.%mm.%yyyy", Date()) )
WriteStringN("############################################")
WriteStringN(»)
Si ExamineLibraryFunctions(1)
Tandis que NextLibraryFunction()<>0
nom.s=LibraryFunctionName()
Addr=GetProcAddress_(Inst,nom)
Param=GetNumberOfParam(Addr)
BadName=BadName(nom)
Si DisplayErrors
Si Param=-1
Text$="Falsche Parameteranzahl chez qui Funktion "+nom+" ."+Chr(13)
Text$=Text$+"Möchten vous le nombre qui paramètre manuel eingeben ?"
Si MessageRequester("Fehler",Text$,#MB_YESNO)=#IDYES
Param=Val(InputRequester(LibraryFunctionName()+»,"Parameteranzahl","0"))
EndIf
EndIf
Si BadName
Text$="Es wird pas empfohlen, qui Funktion "+nom.s+" trop exportieren."+Chr(13)
Text$=Text$+"Soll vous toutefois exportiert volonté ?"
Si MessageRequester("Frage",Text$,#MB_YESNO)=#IDYES:BadName=0:EndIf
EndIf
EndIf
Si BadName=0 And Param>=0
WriteStringN("DEF "+ nom+"("+Str(Param)+") ! "+Chr(34)+Dllname+Chr(34)+»+Chr(34)+nom+Chr(34))
; WriteStringN(nom+" "+Str(Param))
Qté+1
EndIf
AnzGes+1
Wend
D'autre
MessageRequester("Fehler","Die DLL "+DLL+" konnte pas überprüft volonté.")
Fin
EndIf
CloseLibrary(1)
CloseFile(1)
MessageRequester("Information:",Pbl+" wurde erfolgreich erstellt."+Chr(13)+Str(Qté)+"/"+Str(AnzGes)+" Funktionen exportiert.",#MB_ICONINFORMATION)
RunProgram("Notepad.exe", FullPath+ReplaceString(GetFilePart(Dll),GetExtensionPart(Dll),"Inc"), », 0)
Fin
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 20.10.2004 ▲ |
|
|
|
|
 | Sag je doch,- disassembling. 
vois je cela faux Andreas,- ou bien ermittelt qui Proc seulement Longints ?
Salve,- iF |
|
|
| |
|
|
|
 Stefan Schnell | allô Andreas, 3,14159267 la fois Dank pour cela Listing, c'est wirklich très intéressant et wird mir sicherlich einiges zum sur) donner. 
allô David, >vois je cela faux Andreas,- ou bien ermittelt qui Proc seulement Longints ?
Hmm, folgende DLL habe je plan ausprobiert:
comment tu vois volonté verschiedene Variablentypen (Byte et Long) transfert. Andreas Programme generiert daraus folgendes Listing:
et c'est oui richtig so.
cela disassemblierte Listing sieht so aus:
Test2x4
=========
:100013A7 53 push ebx
:100013A8 51 push ecx
:100013A9 55 push ebp
:100013AA 56 push esi
:100013AB 57 push edi
:100013AC 89E6 mov esi, esp
:100013AE 83EC04 sub esp, 00000004
:100013B1 89E0 mov eax, esp
:100013B3 89C2 mov edx, eax
:100013B5 83C204 add edx, 00000004
---------
:100013B8 C70000000000 mov dword[eax], 00000000
:100013BE 83C004 add eax, 00000004
:100013C1 39D0 cmp eax, edx
:100013C3 75F3 jne 100013B8
:100013C5 8B4618 mov eax, dword[esi+18]
:100013C8 880424 mov byte[esp+esp], al
:100013CB 8B461C mov eax, dword[esi+1C]
:100013CE 88442401 mov byte[esp+01], al
:100013D2 31C0 xor eax, eax
:100013D4 83C404 add esp, 00000004
:100013D7 5F pop edi
:100013D8 5E pop esi
:100013D9 5D pop ebp
:100013DA 59 pop ecx
:100013DB 5B pop ebx
:100013DC C20800 ret 0008
cela überrascht mich maintenant quelque chose, là sich qui Parameterermittlung sur cela RET bezieht et ici, trotz zweier Byte-Variablen, qui numéro 8 transfert wird, verstehe je pas. Genauso sieht es nämlich chez qui Procédure Test8 aus:
Test8
=========
:10001414 53 push ebx
:10001415 51 push ecx
:10001416 55 push ebp
:10001417 56 push esi
:10001418 57 push edi
:10001419 89E6 mov esi, esp
:1000141B 83EC08 sub esp, 00000008
:1000141E 89E0 mov eax, esp
:10001420 89C2 mov edx, eax
:10001422 83C208 add edx, 00000008
---------
:10001425 C70000000000 mov dword[eax], 00000000
:1000142B 83C004 add eax, 00000004
:1000142E 39D0 cmp eax, edx
:10001430 75F3 jne 10001425
:10001432 8B4618 mov eax, dword[esi+18]
:10001435 890424 mov dword[esp+esp], eax
:10001438 8B461C mov eax, dword[esi+1C]
:1000143B 89442404 mov dword[esp+04], eax
:1000143F 31C0 xor eax, eax
:10001441 83C408 add esp, 00000008
:10001444 5F pop edi
:10001445 5E pop esi
:10001446 5D pop ebp
:10001447 59 pop ecx
:10001448 5B pop ebx
:10001449 C20800 ret 0008
Werden peut-être chez DLL, égal quel Variablentyp angegeben wird, toujours LongInts transfert? ensuite ist Davids Annahme korrekt. qui peux meinen Geist erhellen? merci et Salut Stefan |
|
|
| |
|
|
|
 Andreas Miethe
 | allô Stefan,
j'ai mir maintenant déjà so quelques Dlls angesehen ( Dependency Walker ) et chez einigen peux on es pas mal erkennen. Pro paramètre wird toujours 4 dazugezaehlt, égal um quoi pour une paramètre es sich handelt. |
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 21.10.2004 ▲ |
|
|
|
|
 | Jepp,- peux je bestätigen.
Salve. |
|
|
| |
|
|