"Verschlüsselung" umdrehen

  • Hi
    hab hier ein kleines problem:

    Spoiler anzeigen
    [autoit]

    Func _HexEncode($bInput)
    Local $tInput = DllStructCreate("byte[" & BinaryLen($bInput) & "]")
    DllStructSetData($tInput, 1, $bInput)
    Local $a_iCall = DllCall("crypt32.dll", "int", "CryptBinaryToString", _
    "ptr", DllStructGetPtr($tInput), _
    "dword", DllStructGetSize($tInput), _
    "dword", 11, _
    "ptr", 0, _
    "dword*", 0)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Or Not $a_iCall[0] Then
    Return SetError(1, 0, "")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Local $iSize = $a_iCall[5]
    Local $tOut = DllStructCreate("char[" & $iSize & "]")

    [/autoit] [autoit][/autoit] [autoit]

    $a_iCall = DllCall("crypt32.dll", "int", "CryptBinaryToString", _
    "ptr", DllStructGetPtr($tInput), _
    "dword", DllStructGetSize($tInput), _
    "dword", 11, _
    "ptr", DllStructGetPtr($tOut), _
    "dword*", $iSize)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Or Not $a_iCall[0] Then
    Return SetError(2, 0, "")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return SetError(0, 0, DllStructGetData($tOut, 1))

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_HexEncode

    [/autoit]

    wie kann ich den ausgabe Text wieder Verschlüsseln???

    Lg Pceumel

    Hier das script aus dem entnommen: (Liest NTFS ein)

    Spoiler anzeigen
    [autoit]

    ;===============================================================================
    ;
    ; Description: MFT-Access, UDF under development
    ; reading & parsing the Master File Table on NTFS Filesystems
    ; Version: v0.0.0.3
    ; Last modified: 2009-May-02
    ; URL: http://www.autoitscript.com/forum/index.php?showtopic=94269
    ; Author(s): KaFu (http://www.funk.eu), trancexx
    ;
    ;===============================================================================
    ;
    #RequireAdmin
    #include <winapi.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $sDriveLetter = "c", $nBytes, $MFT_Offset, $bytes_to_read, $tBuffer, $hdd_handle, $hFile
    dim $__WINAPCONSTANT_INVALID_SET_FILE_POINTER

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite("Analyzing Drive " & $sDriveLetter & ":, Filesystem detected: " & DriveGetFileSystem($sDriveLetter & ":") & @crlf & @crlf)

    [/autoit] [autoit][/autoit] [autoit]

    if DriveGetFileSystem($sDriveLetter & ":") <> "NTFS" then exit

    [/autoit] [autoit][/autoit] [autoit]

    ; Read Boot-Sector
    ; http://www.autoitscript.com/forum/index...…29&view=findpos
    ; trancexx
    Global $hComIn = FileOpen("\\.\" & $sDriveLetter & ":", 16)
    Global $bRaw = FileRead($hComIn, 94); 84 bytes is enough
    ;~ ConsoleWrite($bRaw);_HexEncode($bRaw) & @CRLF)
    ConsoleWrite(_HexENcode($bRaw) & @CRLF)
    ;~ ConsoleWrite(_hextostring($bRaw) & @CRLF)
    FileClose($hComIn)

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinAPI_SetFilePointerEx($hFile, $iPos, $iMethod = 0)
    Local $aResult

    [/autoit] [autoit][/autoit] [autoit]

    $aResult = DllCall("kernel32.dll", "dword", "SetFilePointerEx", "hwnd", $hFile, "uint64", $iPos, "uint64*", 0, "dword", $iMethod)
    If @error Then Return SetError(1, 0, -1)
    If $aResult[0] = $__WINAPCONSTANT_INVALID_SET_FILE_POINTER Then Return SetError(2, 0, -1)
    Return $aResult[0]
    EndFunc ;==>_WinAPI_SetFilePointer

    [/autoit] [autoit][/autoit] [autoit]

    Func _HexEncode($bInput)
    Local $tInput = DllStructCreate("byte[" & BinaryLen($bInput) & "]")
    DllStructSetData($tInput, 1, $bInput)
    Local $a_iCall = DllCall("crypt32.dll", "int", "CryptBinaryToString", _
    "ptr", DllStructGetPtr($tInput), _
    "dword", DllStructGetSize($tInput), _
    "dword", 11, _
    "ptr", 0, _
    "dword*", 0)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Or Not $a_iCall[0] Then
    Return SetError(1, 0, "")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Local $iSize = $a_iCall[5]
    ;~ Local $tOut = DllStructCreate("char[" & $iSize & "]")

    [/autoit] [autoit][/autoit] [autoit]

    $a_iCall = DllCall("crypt32.dll", "int", "CryptBinaryToString", _
    "ptr", DllStructGetPtr($tInput), _
    "dword", DllStructGetSize($tInput), _
    "dword", 11, _
    "ptr", DllStructGetPtr($tOut), _
    "dword*", $iSize)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Or Not $a_iCall[0] Then
    Return SetError(2, 0, "")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return SetError(0, 0, DllStructGetData($tOut, 1))

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_HexEncode

    [/autoit]



    Edit Oscar: Beitrag wiederhergestellt! Was soll das löschen des Ursprungspostings?
    Edit: sry, dachte dass das thema weg wäre so :rofl:

    2 Mal editiert, zuletzt von pceumel (4. November 2010 um 19:47)

  • Das sieht aus, als wenn nur Binary in String umgewandelt wird, dann probier doch mal die Funktion Binary(). Ansonsten schau dir doch mal die Crypt.au3 an.
    Oder mach einfach den DllCall mit CryptStringToBinary.