conver.au3 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #include <ButtonConstants.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <WindowsConstants.au3>
  4. #Region ### START Koda GUI section ### Form=
  5. $Form1 = GUICreate("Form1", 623, 236, 192, 114)
  6. $Button1 = GUICtrlCreateButton("Button1", 96, 76, 425, 57)
  7. GUISetState(@SW_SHOW)
  8. #EndRegion ### END Koda GUI section ###
  9. While 1
  10. $nMsg = GUIGetMsg()
  11. Switch $nMsg
  12. Case $GUI_EVENT_CLOSE
  13. Exit
  14. EndSwitch
  15. WEnd
  16. func storefile($filepath_t)
  17. local $arrays[0]
  18. _FileReadToArray($filepath_t)
  19. EndFunc
  20. func m($src,$filepath_t)
  21. local $hhw
  22. local $arr[0]
  23. _FileReadToArray($src,$arr)
  24. ConsoleWrite($arr)
  25. $scc=_FileCreate($filepath_t)
  26. $hhw=FileOpen($filepath_t,128)
  27. ConsoleWrite($scc)
  28. _ArrayDelete($arr,0)
  29. _ArrayDelete($arr,1)
  30. _FileWriteFromArray($filepath_t,$arr)
  31. FileClose($hhw)
  32. EndFunc
  33. Func rc4($sKey, $sStr)
  34. Local $s[256], $j = 0, $x, $res, $y, $i
  35. Local $uBound
  36. For $i = 0 To 255
  37. $s[$i] = $i
  38. Next
  39. For $i = 0 To 255
  40. $j = Mod(($j + $s[$i] + Asc(StringMid($sKey, Mod($i, StringLen($sKey))+1, 1))), 256)
  41. $x = $s[$i]
  42. $s[$i] = $s[$j]
  43. $s[$j] = $x
  44. Next
  45. $i = 0
  46. $j = 0
  47. For $y = 0 To StringLen($sStr)-1
  48. $i = Mod(($i + 1), 256)
  49. $j = Mod(($j + $s[$i]), 256)
  50. $x = $s[$i]
  51. $s[$i] = $s[$j]
  52. $s[$j] = $x
  53. $res &= Chr(BitXOR(Asc(StringMid($sStr, $y+1, 1)), ($s[Mod(($s[$i] + $s[$j]), 256)])))
  54. Next
  55. Return $res
  56. EndFunc