Advertisement
dsiver144

Untitled

Apr 23rd, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1.  
  2. module DSIVER144
  3.  
  4. module CG_Password
  5.  
  6. UNIQUE_ID = "Z01"
  7. GetComputerName = Win32API.new("Kernel32.dll", "GetComputerName" , "pl", "")
  8. FILE_PATH = "C:\\Passcode.bin"
  9. def self.dump_file(key, code)
  10. name = "\0" * 265
  11. GetComputerName.call(name)
  12. p name
  13. if !FileTest.exist?(FILE_PATH)
  14. p "Can't find!"
  15. code_hash = {}
  16. code_hash[key] = code.to_s
  17. File.open(FILE_PATH, "w") do |f|
  18. Marshal.dump(code_hash, f)
  19. p "Created File!"
  20. end
  21. else
  22. File.open(FILE_PATH, "r") do |f|
  23. code_hash = Marshal.load(f)
  24. end
  25. code_hash[key] = code.to_s
  26. File.open(FILE_PATH, "w") do |f|
  27. Marshal.dump(code_hash, f)
  28. p "Saved File!"
  29. end
  30. p code_hash
  31. end
  32. end
  33.  
  34. end
  35.  
  36. end
  37.  
  38. class Game_System
  39.  
  40. end
  41.  
  42. #~ DSIVER144::CG_Password.dump_file("AAAA")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement