Ace 스크립트

 

- 스크립트

 

  1. # *****************************************************************************
  2. #
  3. # OC AUDIO ENCRYPTION
  4. # Author: Ocedic
  5. # Site: http://ocedic.wordpress.com/
  6. # Version: 1.0
  7. # Last Updated: 7/17/13
  8. #
  9. # Updates:
  10. # 1.0  - First release
  11. #
  12. # *****************************************************************************
  13.  
  14. $imported = {} if $imported.nil?
  15. $imported["OC-AudioEncryption"] = true
  16.  
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # This script will encrypt your audio files and decrypt them during play.
  21. # Some important notes:
  22. #
  23. # * MP3s cannot be encrypted
  24. # * This encryption is very rudimentary and easy to circumvent
  25. #
  26. # Essentially, this script is designed to protect your audio files from your
  27. # regular Average Joe user. The fact is even if a 100% unbreakable
  28. # encryption script existed, people could simply record the audio from your
  29. # game and extract it that way.
  30. #==============================================================================
  31. # ▼ Instructions
  32. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  33. # First, it's recommended that you change the default CIPHER_KEY and
  34. # ENCRYPTED_FILE values in the configuration settings before you proceed.
  35. #
  36. # Run the script with ENCRYPT_AT_STARTUP set to true. This will create an
  37. # encrypted version of all audio files in your music folder.
  38. #
  39. # Set ENCRYPT_AT_STARTUP to false and move your original audio files to a new
  40. # location.
  41. #==============================================================================
  42. # ▼ Compatibility
  43. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  44. # This script may not be compatible with scripts that change the way audio is
  45. # played. If an incompatibility occurs, try placing this script above other
  46. # scripts.
  47. #==============================================================================
  48. # ▼ Terms of Use
  49. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  50. # Can be freely used and modified in non-commercial projects. Proper attribution
  51. # must be given to Ocedic, and this header must be preserved.
  52. # For commercial terms, see here: https://ocedic.wordpress.com/terms-of-use/
  53. #==============================================================================
  54.  
  55. #==============================================================================
  56. # ■ Configuration
  57. #------------------------------------------------------------------------------
  58. #  Change customizable settings here
  59. #==============================================================================
  60. module OC
  61.   module ENCRYPT
  62.    
  63. #==============================================================================
  64. # * Encrypt at Startup *
  65. #------------------------------------------------------------------------------
  66. #   This boolean value controls whether or not files are encrypted when the
  67. #   game is booted. If true, the script will iterate through all audio files
  68. #   in "Audio/BGM/" and encrypt them. When you have done this once, it's
  69. #   recommended that you move the original audio files to a secure backup
  70. #   directory and set this value to false.
  71. #==============================================================================  
  72.     ENCRYPT_AT_STARTUP = true
  73.    
  74. #==============================================================================
  75. # * Cipher Key *
  76. #------------------------------------------------------------------------------
  77. #   This key will be used to encrypt and decrypt audio files. Note that
  78. #   changing this string after you have encrypted your files will cause they to
  79. #   be incorrectly decrypted. It's advised that you choose a string at the
  80. #   beginning and stick with it!
  81. #==============================================================================    
  82.     CIPHER_KEY = "DONKEY"
  83.    
  84. #==============================================================================
  85. # * Encrypted Extension *
  86. #------------------------------------------------------------------------------
  87. #   The extension of the encrypted audio files.
  88. #------------------------------------------------------------------------------
  89. # * Encrypted File *
  90. #------------------------------------------------------------------------------
  91. #   The name and path of unencrypted audio files. It's recommended that you
  92. #   change this filepath to a more obtuse directory.
  93. #==============================================================================
  94.     ENCRYPTED_EXT = ".dog"
  95.     ENCRYPTED_FILE = "System/RGSSAudio"
  96.    
  97.   end #ENCRYPT
  98. end #OC
  99.  
  100. #==============================================================================
  101. # ■ SceneManager
  102. #==============================================================================
  103. module SceneManager
  104.  
  105.   class << self
  106.     alias oc_scene_manager_run_8pqe91 run
  107.   end
  108.   def self.run
  109.     if OC::ENCRYPT::ENCRYPT_AT_STARTUP
  110.       Dir.foreach("Audio/BGM/") do |item|
  111.         next if item == "." || item == ".."
  112.         next if item =~ /#{OC::ENCRYPT::ENCRYPTED_EXT}/
  113.         item = "Audio/BGM/" + item
  114.         Audio.encrypt(item)
  115.       end
  116.     end
  117.     oc_scene_manager_run_8pqe91
  118.   end
  119.    
  120. end
  121.  
  122. #==============================================================================
  123. # ■ Audio
  124. #==============================================================================
  125. module Audio
  126.  
  127.   @fileswitch = false
  128.  
  129. #==============================================================================
  130. # * New Method: Encrypt *
  131. #==============================================================================
  132.   def self.encrypt(filename)
  133.     sourcefile = File.open(filename, "rb")
  134.     content = sourcefile.readlines
  135.     sourcefile.close
  136.     encry_filename = Audio.strip_extension(filename)
  137.     targetfile = File.open(encry_filename + OC::ENCRYPT::ENCRYPTED_EXT, "wb")
  138.     for i in 0...content.size
  139.       content[i] = OC::ENCRYPT::CIPHER_KEY + content[i]
  140.     end
  141.     Marshal.dump(content, targetfile)
  142.     targetfile.close
  143.   end
  144.  
  145. #==============================================================================
  146. # * New Method: Decrypt *
  147. #==============================================================================  
  148.   def self.decrypt(filename)
  149.     sourcefile = File.open(filename + OC::ENCRYPT::ENCRYPTED_EXT, "rb")
  150.     content = Marshal.load(sourcefile)
  151.     for i in 0...content.size
  152.       value = content[i]
  153.       content[i] = value[OC::ENCRYPT::CIPHER_KEY.length, content[i].size]
  154.     end
  155.     sourcefile.close
  156.     begin
  157.       targetfile = File.open(OC::ENCRYPT::ENCRYPTED_FILE, "wb")
  158.       @fileswitch = false
  159.     rescue
  160.       targetfile = File.open(OC::ENCRYPT::ENCRYPTED_FILE + "1", "wb")
  161.       @fileswitch = true
  162.     end
  163.     for i in 0...content.size
  164.       targetfile.write(content[i])
  165.     end
  166.     targetfile.close
  167.   end
  168.  
  169. #==============================================================================
  170. # * New Method: Strip Extension *
  171. #==============================================================================
  172.   def self.strip_extension(filename)
  173.     result = filename.chomp(File.extname(filename))
  174.     return result
  175.   end
  176.  
  177. #==============================================================================
  178. # * New Method: Fileswitch *
  179. #==============================================================================
  180.   def self.fileswitch
  181.     return @fileswitch
  182.   end
  183.  
  184. end
  185.  
  186. #==============================================================================
  187. # ■ RPG::BGM
  188. #==============================================================================
  189. class RPG::BGM < RPG::AudioFile
  190.  
  191. #==============================================================================
  192. # * Overwrite: Play *
  193. #==============================================================================
  194.   def play(pos = 0)
  195.     if @name.empty?
  196.       Audio.bgm_stop
  197.       @@last = RPG::BGM.new
  198.     else
  199.       filename = "Audio/BGM/" + @name
  200.       if FileTest.exist?(filename + OC::ENCRYPT::ENCRYPTED_EXT)
  201.         Audio.decrypt(filename)
  202.         if !Audio.fileswitch
  203.          Audio.bgm_play(OC::ENCRYPT::ENCRYPTED_FILE, @volume, @pitch, pos)
  204.          begin
  205.            File.delete(OC::ENCRYPT::ENCRYPTED_FILE + "1")
  206.          rescue
  207.          end
  208.         else
  209.          Audio.bgm_play(OC::ENCRYPT::ENCRYPTED_FILE + "1", @volume, @pitch, pos)
  210.          begin
  211.            File.delete(OC::ENCRYPT::ENCRYPTED_FILE)
  212.          rescue
  213.          end
  214.         end
  215.       else
  216.         Audio.bgm_play(filename, @volume, @pitch, pos)
  217.       end
  218.       @@last = self.clone
  219.     end
  220.   end
  221.  
  222. end

 

 

출처 겸 사용법

 

http://ocedic.wordpress.com/scripts/utility-scripts/oc-audio-encryption/

http://www.rpgmakervxace.net/topic/16928-oc-audio-encryption/

Who's 스리아씨

?
뺘라뺘뺘
  • profile
    오렌지캬라멜 2014.01.23 14:47
    적용방법을 자세히 알려주실수 있으신가요 ???
    스크립 내용을 복사 붙어넣기만으로는 오류가 나와서요 ;
    새로 추가가 아닌 기존의 내용에 덮어씌어야 하는건가요 ?
  • ?
    스리아씨 2014.01.23 14:49
    이 스크립트를 사용하기 전에,주의 :

    이 스크립트는 MP3 파일을 암호화하지 않습니다. 그것은 당신이 그들에 변환하는 것이 좋습니다거야. OGG 형식보기
    이 스크립트를 사용하는 암호화는 소스 코드를 누구나 볼 수 있다는 사실에 의해 합성, 매우 간단합니다.
    이 스크립트는 다소 엉성 인해 오디오를 재생할 때 RGSS3이 열려있는 파일을 유지한다는 사실에, 순간에 실행됩니다.
    이 스크립트는 현재 음악을 암호화하고 BGS와 SE를 암호화하지 않습니다. 이들은 나중에 올 수 있습니다.

    라고 적혀있네염.
    사용방법은 안써서 잘 모릅니다(>..)
  • profile
    오렌지캬라멜 2014.01.23 14:51
    그렇군요 답변 ㄳ합니다 ^^

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 5110
공지 RPG VX ACE 유용한 링크 모음 16 아방스 2012.01.03 28928
117 버그픽스 Text Cache by Mithran 1 Alkaid 2013.02.16 1393
116 전투 Etude87_SRPG_converter_for_Ace_Add_on ver.1.02 2 습작 2013.02.18 3088
115 전투 Basic Enemy HP Bars 2.1 by V.M 10 Alkaid 2013.02.21 4207
114 오디오 Extended Music Script (for VXA) by Zhek Alkaid 2013.02.22 1594
113 HUD SpriteIcon - 화면에 아이콘 그리기 4 file 허걱 2013.02.24 3630
112 스킬 VXAce 아츠장착 스킬습득 스크립트 1 file 아이미르 2013.02.24 2777
111 상태/속성 상태를 해제하는 상태 3 file 레미티 2013.03.07 1545
110 아이템 VXAce 셋트장비 스크립트 9 file 아이미르 2013.03.08 3642
109 스킬 VXAce 스킬포인트 스크립트 5 file 아이미르 2013.03.21 4150
108 이동 및 탈것 Etude87_Mouse_Move_Ex ver.1.00 9 습작 2013.03.29 1617
107 이동 및 탈것 Galv’s Character Animations V.2.0 캐릭터 애니메이션 2 yellowcat 2013.04.08 2488
106 메시지 N.A.S.T.Y. Text Pop Over Events 3 file Mimesis 2013.04.08 3619
105 스킬 Skill Cost Manager - Yanfly 4 file Rondo 2013.04.09 2608
104 메뉴 아이템 설명 메뉴 스크립트 (Crazyninjaguy) 2 file IZEN 2013.04.18 4780
103 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 3 습작 2013.04.19 1534
102 기타 Localization by ForeverZer0, KK20 file 습작 2013.04.26 1414
101 키입력 Key Simulator by Fantasist 1 습작 2013.05.01 1388
100 퀘스트 Quest Journal by modern algebra 11 file 습작 2013.05.03 3697
99 전투 Schala 전투 시스템 (XAS에 의해 구동) 11 홍색의환상향 2013.05.05 5321
98 전투 多人数SRPGコンバータ for Ace by AD.Bank 6 습작 2013.05.13 4038
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 Next
/ 11