Hallo an alle! Schöne Weihnachten!!!
Beiträge von funkey
-
-
Es gibt auch DLL's, die z.B. über eine Registrierungsfunktion verfügen, wo man also eine Seriennummer übergeben muss (könnte ich mir auch bei dieser DLL vorstellen). Damit das funktioniert, muss immer die DLL zuerst geöffnet werden, und dann mit dem Handle weitergearbeitet werden. Das ist also immer die sicherere Variante.
-
https://www.ravensburger.de/sh…englisch-32904/index.html
Damit kann jeder in die englische Sprache einsteigen
-
DBX und DBF sind ja glaube ich fast kompatibel. Du könntest mal meine DBF-UDF probieren, aber leider sind alle meine Links in AutoIt.de nicht mehr da
. Vielleicht finde ich die UDF noch irgendwo in meinem Chaos.
Weiß jemand, ob man die Links in den Beiträgen bzw. alle Uploads wieder herstellen kann?
Gruß funkey
-
Ich kann das leider nicht testen, aber so hätte ich das versucht:
AutoItGlobal Const $tagDHCPDS_SERVER = "DWORD Version;ptr ServerName;DWORD ServerAddress;DWORD Flags;DWORD State;ptr DsLocation;DWORD DsLocType;"Local $aRet = DllCall("Dhcpsapi.dll", "DWORD", "DhcpEnumServers", "DWORD", 0, "ptr", 0, "ptr*", 0, "ptr", 0, "ptr", 0) -
Etwas davon ist hier schon vorhanden: http://www.autoitscript.com/fo…hcpgetclientinfo-wrapper/
Vielleicht hilft dir das schon.
-
Da kann nicht mal ein Obfuscator mithalten, aber ich werde versuchen mich da morgen durchzuwühlen.
Edit: Der Fehler muss aber von 'LogAitDave_V3.0.exe' kommen und das ist keine AutoIt Datei und auch der Quellcode davon ist nicht dabei!?
-
LibNodave kenn ich
Aber das Include-File und die Funktionen die du aufrufst habe ich noch nie gesehen. Ohne diese Datei(en) wird dir keiner hier helfen können. -
Hab mal die UDF überarbeitet. Die Funktionen brauchten noch die 'cdecl' Aufrufkonvention. Wahrscheinlich hatte ich damals zum testen eine andere DLL oder so. Das Beispiel sollte nun funktionieren.
BTW: Ich kann keine rar-files mehr anhängen, sondern nur noch zip. Ist kein Problem, wollte es nur anmerken.
-
Bei CreateResourceDLL.au3
muss ich noch oben ein Global setzen vor der Nutzung: Global $ghGDIPDll
Nein nicht einfach eine neue globale Variable erzeugen, sondern $ghGDIPDll in $__g_hGDIPDll umbenennen für die aktuelle AutoIt-Version.Frage mal. Kann man so auch Zahlen und / oder Worte in eine DLL "packen" und auch wieder auslesen?
Wenn "Ja", wie, bitte.
Mann kann alles in eine DLL packen und es sind auch einige Beispiele dazu enthalten in der aktuellen AutoIt-Version. Am besten Mal die Beispiele zu den Funktionen in der WinAPIRes.au3 anschauen. -
In deinem Fall geht das so:
#include <WinAPI.au3>
#include <WinAPIRes.au3>
#include <APIResConstants.au3>Global $hModul = _WinAPI_LoadLibraryEx("Resourcen_neu.dll", $LOAD_LIBRARY_AS_DATAFILE)
Global $hRes1 = _WinAPI_FindResource($hModul, $RT_RCDATA, "DATEN_1")
Global $iSizeRes1 = _WinAPI_SizeOfResource($hModul, $hRes1)
Global $hData1 = _WinAPI_LoadResource($hModul, $hRes1)
Global $pData1 = _WinAPI_LockResource($hData1)
Global $tData1 = DllStructCreate("char[" & $iSizeRes1 & "]", $pData1)
ConsoleWrite(DllStructGetData($tData1, 1) & @CRLF)Global $hRes2 = _WinAPI_FindResource($hModul, $RT_RCDATA, "DATEN_2")
Global $iSizeRes2 = _WinAPI_SizeOfResource($hModul, $hRes2)
Global $hData2 = _WinAPI_LoadResource($hModul, $hRes2)
Global $pData2 = _WinAPI_LockResource($hData2)
Global $tData2 = DllStructCreate("char[" & $iSizeRes2 & "]", $pData2)
ConsoleWrite(DllStructGetData($tData2, 1) & @CRLF)_WinAPI_FreeLibrary($hModul)
-
Schau dir mal das Komandozeilen-Tool ExifTool an. Das müsste das können und kann über AutoIt angesteuert werden.
-
Global Const $WM_POWERBROADCAST = 0x0218
Global Const $PBT_POWERSETTINGCHANGE = 0x8013Global Const $WM_SYSCOMMAND = 0x0112
Global Const $SC_MONITORPOWER = 0xF170
Global Const $MONITOR_ON = -1
Global Const $MONITOR_OFF = 2
Global Const $MONITOR_STANDBY = 1Global Const $tagGUID = "struct; ulong Data1;ushort Data2;ushort Data3;byte Data4[8]; endstruct"
Global Const $tagPOWERBROADCAST_SETTING = $tagGUID & ";DWORD DataLength;DWORD Data;"Global Const $DEVICE_NOTIFY_WINDOW_HANDLE = 0
Global Const $DEVICE_NOTIFY_SERVICE_HANDLE = 1Global Const $GUID_CONSOLE_DISPLAY_STATE = "{6fe69556-704a-47a0-8f24-c28d936fda47}" ; Win8
Global Const $GUID_MONITOR_POWER_ON = "{02731015-4510-4526-99e6-e5a17ebd1aea}" ; Vista and Win7Global $hGui = GUICreate("Gui for registering Windows Message", 600, 200)
GUIRegisterMsg($WM_POWERBROADCAST, "_PowerSettingNotification")
Global $nBtnSleep = GUICtrlCreateButton("Hey monitors, please sleep!", 50, 50, 500, 100)
GUICtrlSetFont(-1, 25)Global $hNotify
If @OSBuild < 9000 Then
$hNotify = _RegisterPowerSettingNotification($hGui, $GUID_MONITOR_POWER_ON)
Else
$hNotify = _RegisterPowerSettingNotification($hGui, $GUID_CONSOLE_DISPLAY_STATE)
EndIfGUISetState()
Global $iMsg
Do
$iMsg = GUIGetMsg()
If $iMsg = $nBtnSleep Then DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hGui, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', $MONITOR_OFF)
Until $iMsg = -3_UnregisterPowerSettingNotification($hNotify)
Func _PowerSettingNotification($hWndGUI, $MsgID, $wParam, $lParam)
Local $tSetting, $iSetting
If $wParam = $PBT_POWERSETTINGCHANGE Then
$tSetting = DllStructCreate($tagPOWERBROADCAST_SETTING, $lParam)
$iSetting = DllStructGetData($tSetting, "Data")
Switch $iSetting
Case 2 ;The display is dimmed --> Win8 and above
ConsoleWrite("The display is dimmed now" & @CRLF)
Case 1 ;The monitor in on
ConsoleWrite("The display is on now" & @CRLF)
Case 0 ;The monitor in off
ConsoleWrite("The display is off now" & @CRLF)
EndSwitch
EndIf
EndFuncFunc _RegisterPowerSettingNotification($hGui, $GUID)
Local $tGuid = DllStructCreate($tagGUID)
DllCall('ole32.dll', 'uint', 'CLSIDFromString', 'wstr', $GUID, 'struct*', $tGUID)
Local $aRet = DllCall("user32.dll", "handle", "RegisterPowerSettingNotification", "handle", $hGui, "struct*", $tGUID, "DWORD", $DEVICE_NOTIFY_WINDOW_HANDLE)
If @error Or $aRet[0] = 0 Then Return SetError(1, @error, 0)
Return $aRet[0]
EndFuncFunc _UnregisterPowerSettingNotification($hNotify)
Local $aRet = DllCall("user32.dll", "BOOL", "UnregisterPowerSettingNotification", "handle", $hNotify)
If @error Or $aRet[0] = 0 Then Return SetError(1, @error, 0)
Return $aRet[0]
EndFuncEdit: Beispiel verschönert
-
Schau dir mal das von ProgAndy an: http://www.autoitscript.com/fo…icon-extract/#entry564395
-
Nichts zu danken, hab's wieder deinstalliert. Du hast Glück, wenn es bei dir mit AutoIt alles funktioniert, wie es soll. Hoffe, das wird mal besser.
-
Hab mal die Demo-Version installiert, danach gesucht wie ich den COM-Server registrieren kann, dann getestet, dann zu folgendem Ergebnis gekommen:
Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc")Global $oKissSoft = ObjCreate("KISSsoftCOM.KISSsoft")
If @error Then
MsgBox(0 + 48, "ERROR", "Failed to open KISSsoft!")
Exit
EndIf;$oKissSoft.SetSilentMode( True )
$oKissSoft.GetModule("Z012", True)Global $sIni = $oKissSoft.GetININame()
ConsoleWrite("> GetININame: " & $sIni & @CRLF)Global $sVar = $oKissSoft.GetVar("var")
ConsoleWrite("> Var: " & $sVar & @CRLF)$oKissSoft.ReleaseModule
; User's COM error function. Will be called if COM error occurs
Func _ErrFunc($oError)
; Do anything here.
ConsoleWrite("err.number is: " & @TAB & "0x" & Hex($oError.number,& @CRLF & _
"err.windescription:" & @TAB & $oError.windescription & @CRLF & _
"err.description is: " & @TAB & $oError.description & @CRLF & _
"err.source is: " & @TAB & $oError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
"err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
"err.retcode is: " & @TAB & $oError.retcode & @CRLF & @CRLF)
EndFunc ;==>_ErrFunc
Bei mir bringt das zwar Fehlermeldungen, aber bei dir dürfte es funktionieren.Edit:
Hier noch die COM-Schnittstelle, wie sie im PowerBasic COM-Browser dargestellt wird. Da sieht man auch wie die Funktionen in AutoIt aufgerufen werden müssenCodeMethod GetParams <1> (ByRef x1 As Double, ByRef y1 As Double, ByRef x2 As Double, ByRef y2 As Double, ByRef xc As Double, _Method GetParams2 <2> (ByRef x1 As Double, ByRef y1 As Double, ByRef x2 As Double, ByRef y2 As Double, ByRef x3 As _Method GetParams <1> (ByRef x1 As Double, ByRef y1 As Double, ByRef x2 As Double, ByRef y2 As Double)Method GetParams <1> (ByRef x1 As Double, ByRef y1 As Double, ByRef x2 As Double, ByRef y2 As Double)Method GetParams <1> (ByRef x1 As Double, ByRef y1 As Double, ByRef x2 As Double, ByRef y2 As Double, ByRef ordnung As _Method GetCylParams <2> (Byval i As Long, Byval outer As Integer, ByRef dl As Double, ByRef dr As Double, ByRef b As _Method GetParameter <2> (Byval i As Long, ByRef value As WString, ByRef text As WString, ByRef unit As WString, ByRef _Method GetParameter <1> (ByRef runout As Long, ByRef bcI As Double, ByRef rcI As Double, ByRef brtotI As Double, ByRef _Method GenerateCylindricalGear(Byval doublehelical As Integer, Byval z As Double, Byval b As Double, Byval bs As Double, _Byval da As Double, Byval di As Double, Byval pz As Double, Byval isLeft As Integer, Byval datafromfile As _WString, Byval dateibuffer As WString, Byval exprToCAD As IKSoftParameter, Byval filename As WString, Byval _Method GenerateRack(Byval doublehelical As Integer, Byval Hz As Double, Byval z As Double, Byval leff As Double, Byval _beff As Double, Byval pt As Double, Byval Hf As Double, Byval beta As Double, Byval isLeft As Integer, Byval bs _As Double, Byval datafromfile As WString, Byval dateibuffer As WString, Byval exprToCAD As IKSoftParameter, _Byval filename As WString, Byval runout As IKSoftRunoutParameter, Byval curve As IKSoftCurve) As LongMethod GenerateWorm(Byval z As Double, Byval b As Double, Byval da As Double, Byval di As Double, Byval pz As Double, _Byval isLeft As Integer, Byval datafromfile As WString, Byval dateibuffer As WString, Byval exprToCAD As _IKSoftParameter, Byval filename As WString, Byval runout As IKSoftRunoutParameter, Byval curve As IKSoftCurve) As LongMethod GenerateBevelGear(Byval z As Double, Byval b As Double, Byval dm As Double, Byval dam As Double, Byval dfm As _Double, Byval dfe As Double, Byval dfi As Double, Byval delta As Double, Byval di As Double, Byval y1 As Double, _Byval y2 As Double, Byval datafromfile As WString, Byval dateibuffer As WString, Byval exprToCAD As _Method GenerateShaft(Byval dateibuffer As WString, Byval exprToCAD As IKSoftParameter, Byval filename As WString, Byval _Method ReportWithParameters <23> (Byval infile As WString, Byval outfile As WString, Byval PB_show As Long, Byval art As _ -
Hast du es mit einem normalen AutoIt- String auch versucht?
Um welche Software handelt es sich. Könnte ich die auch installieren zum testen? Ansonsten ist guter Rat teuer. Ich weiß nur, dass noch lange nicht alles was COM betrifft mit AutoIt auch funktioniert, leider! Hab mich auch schon des öfteren geärgert. -
Versuchs mal mit SysAllocString.
Hier die Funktionen in AutoIt gewrappt: http://www.autoitscript.com/fo…byref-method/#entry955338 -
Hab eine UDF daraus gemacht und im ersten Post angehängt!
-
Hallo,
mit den Funktionen _CryptProtectData() und _CryptUnprotectData() kann man Daten sicher verschlüsseln, so dass im Normalfall nur der angemeldete User und nur der gleiche Computer die Daten wieder entschlüsseln kann. Man kann ein Passwort als zusätzliche Sicherheit setzen, wird aber nicht unbedingt benötigt.Auf MSDN gibt hier weitere Informationen:
* CryptProtectData: http://msdn.microsoft.com/en-u…ry/aa380261(v=vs.85).aspx
* CryptUnprotectData: http://msdn.microsoft.com/en-u…ry/aa380882(v=vs.85).aspxViel Spaß damit!
#include <WinAPI.au3>
;When this flag is set, it associates the data encrypted with the current computer instead of with an individual user.
;Any user on the computer on which CryptProtectData is called can use CryptUnprotectData to decrypt the data.
Global Const $CRYPTPROTECT_LOCAL_MACHINE = 0x4;This flag is used for remote situations where presenting a user interface (UI) is not an option. When this flag is set
;and a UI is specified for either the protect or unprotect operation, the operation fails and GetLastError returns the ERROR_PASSWORD_RESTRICTION code.
Global Const $CRYPTPROTECT_UI_FORBIDDEN = 0x1;This flag generates an audit on protect and unprotect operations.
Global Const $CRYPTPROTECT_LOCAL_AUDIT = 0x10Global Const $CRYPTPROTECT_VERIFY_PROTECTION = 0x40
;This flag is used to provide the prompt for the protect phase.
Global Const $CRYPTPROTECT_PROMPT_ON_PROTECT = 0x2;This flag can be combined with CRYPTPROTECT_PROMPT_ON_PROTECT to enforce the UI (user interface) policy of the caller.
;When CryptUnprotectData is called, the dwPromptFlags specified in the CryptProtectData call are enforced.
Global Const $CRYPTPROTECT_PROMPT_ON_UNPROTECT = 0x1Global Const $ERROR_INVALID_DATA = 13
Global Const $tagDATA_BLOB = "DWORD cbData;ptr pbData;"
Global Const $tagCRYPTPROTECT_PROMPTSTRUCT = "DWORD cbSize;DWORD dwPromptFlags;HWND hwndApp;ptr szPrompt;"Global $hDLL_CryptProtect = DllOpen("crypt32.dll")
Global $sString2Hide = "This is a test string to protect!"
Global $bData, $sData, $sDesc = ""
$bData = _CryptProtectData($sString2Hide, "Some information")
ConsoleWrite("Error protecting: " & @error & " - " & @extended & @LF)
ConsoleWrite("Protected data: " & $bData & @LF)$sData = _CryptUnprotectData($bData, $sDesc)
ConsoleWrite("Error unprotecting: " & @error & " - " & @extended & @LF)
ConsoleWrite("Unprotected string: " & $sData & @LF)
ConsoleWrite("Unprotected description: " & $sDesc & @LF)ConsoleWrite(@LF & @LF)
$bData = _CryptProtectData($sString2Hide, "Some other information", "pass")
ConsoleWrite("Error protecting: " & @error & " - " & @extended & @LF)
ConsoleWrite("Protected data: " & $bData & @LF)$sData = _CryptUnprotectData($bData, $sDesc, "")
ConsoleWrite("Error unprotecting: " & @error & " - " & @extended & @LF)
ConsoleWrite("Unprotected string: " & $sData & @LF)
ConsoleWrite("Unprotected description: " & $sDesc & @LF)ConsoleWrite(@LF & @LF)
$bData = _CryptProtectData($sString2Hide, "Some other information", "pwd")
ConsoleWrite("Error protecting: " & @error & " - " & @extended & @LF)
ConsoleWrite("Protected data: " & $bData & @LF)$sData = _CryptUnprotectData($bData, $sDesc, "pwd")
ConsoleWrite("Error unprotecting: " & @error & " - " & @extended & @LF)
ConsoleWrite("Unprotected string: " & $sData & @LF)
ConsoleWrite("Unprotected description: " & $sDesc & @LF)ConsoleWrite(@LF & @LF)
Global $sPromptString = "Data protection will be done"
Global $tPromptString = DllStructCreate("wchar szPrompt[256]")
DllStructSetData($tPromptString, "szPrompt", $sPromptString)Global $tPrompt = DllStructCreate($tagCRYPTPROTECT_PROMPTSTRUCT)
DllStructSetData($tPrompt, "cbSize", DllStructGetSize($tPrompt))
DllStructSetData($tPrompt, "dwPromptFlags", BitOR($CRYPTPROTECT_PROMPT_ON_PROTECT, $CRYPTPROTECT_PROMPT_ON_UNPROTECT))
DllStructSetData($tPrompt, "szPrompt", DllStructGetPtr($tPromptString))$bData = _CryptProtectData($sString2Hide, "Protection example with Gui", "pwd", 0, DllStructGetPtr($tPrompt))
ConsoleWrite("Error protecting: " & @error & " - " & @extended & @LF)
ConsoleWrite("Protected data: " & $bData & @LF)$sPromptString = "Data unprotection will be done"
DllStructSetData($tPromptString, "szPrompt", $sPromptString)$sData = _CryptUnprotectData($bData, $sDesc, "pwd", 0, DllStructGetPtr($tPrompt))
ConsoleWrite("Error unprotecting: " & @error & " - " & @extended & @LF)
ConsoleWrite("Unprotected string: " & $sData & @LF)
ConsoleWrite("Unprotected description: " & $sDesc & @LF)DllClose($hDLL_CryptProtect)
;http://msdn.microsoft.com/en-u…ry/aa380261(v=vs.85).aspx
Func _CryptProtectData($sString, $sDesc = "", $sPwd = "", $iFlag = 0, $pPrompt = 0)
;funkey 2014.08.11th
Local $aRet, $iError, $tEntropy, $tDesc, $pEntropy = 0, $pDesc = 0
Local $tDataIn = _DataToBlob($sString)
If $sPwd <> "" Then
$tEntropy = _DataToBlob($sPwd)
$pEntropy = DllStructGetPtr($tEntropy)
EndIfIf $sDesc <> "" Then
$tDesc = DllStructCreate("wchar desc[" & StringLen($sDesc) + 1 & "]")
DllStructSetData($tDesc, "desc", $sDesc)
$pDesc = DllStructGetPtr($tDesc)
EndIfLocal $tDataBuf = DllStructCreate($tagDATA_BLOB)
$aRet = DllCall($hDLL_CryptProtect, "BOOL", "CryptProtectData", "struct*", $tDataIn, "ptr", $pDesc, "ptr", $pEntropy, "ptr", 0, "ptr", $pPrompt, "DWORD", $iFlag, "struct*", $tDataBuf)
$iError = @error_WinAPI_LocalFree(DllStructGetData($tDataIn, "pbData"))
If $sPwd <> "" Then _WinAPI_LocalFree(DllStructGetData($tEntropy, "pbData"))
If $iError Then Return SetError(1, 0, "")
If $aRet[0] = 0 Then Return SetError(2, _WinAPI_GetLastError(), "")Local $tDataOut = DllStructCreate("byte data[" & DllStructGetData($tDataBuf, "cbData") & "]", DllStructGetData($tDataBuf, "pbData"))
Local $bData = DllStructGetData($tDataOut, "data")_WinAPI_LocalFree(DllStructGetData($tDataBuf, "pbData"))
Return $bData
EndFunc ;==>_CryptProtectData;http://msdn.microsoft.com/en-u…ry/aa380882(v=vs.85).aspx
Func _CryptUnprotectData($bData, ByRef $sDesc, $sPwd = "", $iFlag = 0, $pPrompt = 0)
;funkey 2014.08.11th
Local $aRet, $iError, $tEntropy, $pEntropy = 0
Local $tDataIn = _DataToBlob($bData)
$sDesc = ""If $sPwd <> "" Then
$tEntropy = _DataToBlob($sPwd)
$pEntropy = DllStructGetPtr($tEntropy)
EndIfLocal $tDataBuf = DllStructCreate($tagDATA_BLOB)
Local $tDesc = DllStructCreate("ptr desc")
Local $pDesc = DllStructGetPtr($tDesc)$aRet = DllCall($hDLL_CryptProtect, "BOOL", "CryptUnprotectData", "struct*", $tDataIn, "ptr*", $pDesc, "ptr", $pEntropy, "ptr", 0, "ptr", $pPrompt, "DWORD", $iFlag, "struct*", $tDataBuf)
$iError = @error_WinAPI_LocalFree(DllStructGetData($tDataIn, "pbData"))
If $sPwd <> "" Then _WinAPI_LocalFree(DllStructGetData($tEntropy, "pbData"))
If $iError Then Return SetError(1, 0, "")
If $aRet[0] = 0 Then Return SetError(2, _WinAPI_GetLastError(), "")Local $tDataOut = DllStructCreate("char data[" & DllStructGetData($tDataBuf, "cbData") & "]", DllStructGetData($tDataBuf, "pbData"))
Local $sData = DllStructGetData($tDataOut, "data")Local $aLen = DllCall("msvcrt.dll", "UINT:cdecl", "wcslen", "ptr", $aRet[2])
Local $tDesc = DllStructCreate("wchar desc[" & $aLen[0] + 1 & "]", $aRet[2])
$sDesc = DllStructGetData($tDesc, "desc")_WinAPI_LocalFree($aRet[2])
_WinAPI_LocalFree(DllStructGetData($tDataBuf, "pbData"))Return $sData
EndFunc ;==>_CryptUnprotectData;Creates a DATA_BLOB structure where the function stores the decrypted data.
;When you have finished using the DATA_BLOB structure, free its pbData member by calling the _WinAPI_LocalFree function.
Func _DataToBlob($data)
;funkey 2014.08.11th
Local $iLen, $tDataIn, $tData, $aMem
Local Const $LMEM_ZEROINIT = 0x40
Select
Case IsString($data)
$iLen = StringLen($data)
Case IsBinary($data)
$iLen = BinaryLen($data)
Case Else
Return SetError(1, 0, 0)
EndSelect$tDataIn = DllStructCreate($tagDATA_BLOB)
$aMem = DllCall("Kernel32.dll", "handle", "LocalAlloc", "UINT", $LMEM_ZEROINIT, "UINT", $iLen)
$tData = DllStructCreate("byte[" & $iLen & "]", $aMem[0])DllStructSetData($tData, 1, $data)
DllStructSetData($tDataIn, "cbData", $iLen)
DllStructSetData($tDataIn, "pbData", DllStructGetPtr($tData))Return $tDataIn
EndFunc ;==>_DataToBlob