设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3282|回复: 4
打印 上一主题 下一主题

[原创发布] 如果你想做RM的加密代码,请进!

[复制链接]

Lv2.观梦者

傻♂逼

梦石
0
星屑
369
在线时间
1605 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

跳转到指定楼层
1
发表于 2010-6-26 22:38:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
引用:
  1. $:.push(Dir.getwd)
  2. require 'stringio.rb'
复制代码
事件中插入

  1. a= StringOutput.new("")
  2. Marshal.dump($game_system,a)
  3. Marshal.dump($game_screen,a)
  4. b=a.string
  5. c= StringInput.new(b)
  6. p Marshal.load(c)
  7. p Marshal.load(c)
复制代码
具体效果自己看吧,我没有动文件哦,StringIO.rb可以直接复制到代码里面
附上StringIO.rb(这个文件在Ruby中有两个,一个是Game的一个是1.9的)
  1. # encoding: utf-8

  2. #--
  3. # Copyright (c) 1998-2003 Minero Aoki <[email protected]>
  4. #
  5. # Permission is hereby granted, free of charge, to any person obtaining
  6. # a copy of this software and associated documentation files (the
  7. # "Software"), to deal in the Software without restriction, including
  8. # without limitation the rights to use, copy, modify, merge, publish,
  9. # distribute, sublicense, and/or sell copies of the Software, and to
  10. # permit persons to whom the Software is furnished to do so, subject to
  11. # the following conditions:
  12. #
  13. # The above copyright notice and this permission notice shall be
  14. # included in all copies or substantial portions of the Software.
  15. #
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  20. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  21. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. #
  24. # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
  25. # with permission of Minero Aoki.
  26. #++

  27. class StringInput#:nodoc:

  28.   include Enumerable

  29.   class << self

  30.     def new( str )
  31.       if block_given?
  32.         begin
  33.           f = super
  34.           yield f
  35.         ensure
  36.           f.close if f
  37.         end
  38.       else
  39.         super
  40.       end
  41.     end

  42.     alias open new
  43.   
  44.   end

  45.   def initialize( str )
  46.     @src = str
  47.     @pos = 0
  48.     @closed = false
  49.     @lineno = 0
  50.   end

  51.   attr_reader :lineno

  52.   def string
  53.     @src
  54.   end

  55.   def inspect
  56.     "#<#{self.class}:#{@closed ? 'closed' : 'open'},src=#{@src[0,30].inspect}>"
  57.   end

  58.   def close
  59.     stream_check!
  60.     @pos = nil
  61.     @closed = true
  62.   end

  63.   def closed?
  64.     @closed
  65.   end

  66.   def pos
  67.     stream_check!
  68.     [@pos, @src.size].min
  69.   end

  70.   alias tell pos

  71.   def seek( offset, whence = IO::SEEK_SET )
  72.     stream_check!
  73.     case whence
  74.     when IO::SEEK_SET
  75.       @pos = offset
  76.     when IO::SEEK_CUR
  77.       @pos += offset
  78.     when IO::SEEK_END
  79.       @pos = @src.size - offset
  80.     else
  81.       raise ArgumentError, "unknown seek flag: #{whence}"
  82.     end
  83.     @pos = 0 if @pos < 0
  84.     @pos = [@pos, @src.size + 1].min
  85.     offset
  86.   end

  87.   def rewind
  88.     stream_check!
  89.     @pos = 0
  90.   end

  91.   def eof?
  92.     stream_check!
  93.     @pos > @src.size
  94.   end

  95.   def each( &block )
  96.     stream_check!
  97.     begin
  98.       @src.each(&block)
  99.     ensure
  100.       @pos = 0
  101.     end
  102.   end

  103.   def gets
  104.     stream_check!
  105.     if idx = @src.index(?\n, @pos)
  106.       idx += 1  # "\n".size
  107.       line = @src[ @pos ... idx ]
  108.       @pos = idx
  109.       @pos += 1 if @pos == @src.size
  110.     else
  111.       line = @src[ @pos .. -1 ]
  112.       @pos = @src.size + 1
  113.     end
  114.     @lineno += 1

  115.     line
  116.   end

  117.   def getc
  118.     stream_check!
  119.     ch = @src[@pos]
  120.     @pos += 1
  121.     @pos += 1 if @pos == @src.size
  122.     ch
  123.   end

  124.   def read( len = nil )
  125.     stream_check!
  126.     return read_all unless len
  127.     str = @src[@pos, len]
  128.     @pos += len
  129.     @pos += 1 if @pos == @src.size
  130.     str
  131.   end

  132.   alias sysread read

  133.   def read_all
  134.     stream_check!
  135.     return nil if eof?
  136.     rest = @src[@pos ... @src.size]
  137.     @pos = @src.size + 1
  138.     rest
  139.   end

  140.   def stream_check!
  141.     @closed and raise IOError, 'closed stream'
  142.   end

  143. end


  144. class StringOutput#:nodoc:

  145.   class << self

  146.     def new( str = '' )
  147.       if block_given?
  148.         begin
  149.           f = super
  150.           yield f
  151.         ensure
  152.           f.close if f
  153.         end
  154.       else
  155.         super
  156.       end
  157.     end

  158.     alias open new
  159.   
  160.   end

  161.   def initialize( str = '' )
  162.     @dest = str
  163.     @closed = false
  164.   end

  165.   def close
  166.     @closed = true
  167.   end

  168.   def closed?
  169.     @closed
  170.   end

  171.   def string
  172.     @dest
  173.   end

  174.   alias value string
  175.   alias to_str string

  176.   def size
  177.     @dest.size
  178.   end

  179.   alias pos size

  180.   def inspect
  181.     "#<#{self.class}:#{@dest ? 'open' : 'closed'},#{object_id}>"
  182.   end

  183.   def print( *args )
  184.     stream_check!
  185.     raise ArgumentError, 'wrong # of argument (0 for >1)' if args.empty?
  186.     args.each do |s|
  187.       raise ArgumentError, 'nil not allowed' if s.nil?
  188.       @dest << s.to_s
  189.     end
  190.     nil
  191.   end

  192.   def puts( *args )
  193.     stream_check!
  194.     args.each do |str|
  195.       @dest << (s = str.to_s)
  196.       @dest << "\n" unless s[-1] == ?\n
  197.     end
  198.     @dest << "\n" if args.empty?
  199.     nil
  200.   end

  201.   def putc( ch )
  202.     stream_check!
  203.     @dest << ch.chr
  204.     nil
  205.   end

  206.   def printf( *args )
  207.     stream_check!
  208.     @dest << sprintf(*args)
  209.     nil
  210.   end

  211.   def write( str )
  212.     stream_check!
  213.     s = str.to_s
  214.     @dest << s
  215.     s.size
  216.   end

  217.   alias syswrite write

  218.   def <<( str )
  219.     stream_check!
  220.     @dest << str.to_s
  221.     self
  222.   end

  223.   private

  224.   def stream_check!
  225.     @closed and raise IOError, 'closed stream'
  226.   end

  227. end
复制代码

Lv1.梦旅人

梦石
0
星屑
50
在线时间
55 小时
注册时间
2009-8-30
帖子
449
2
发表于 2010-6-26 22:38:56 | 只看该作者
FF你好……还有,为什么连注解都是……
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3263
在线时间
3616 小时
注册时间
2006-9-6
帖子
37399

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

3
发表于 2010-6-30 12:45:04 | 只看该作者
表示不知道怎么做……
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
253
在线时间
574 小时
注册时间
2006-8-25
帖子
969
4
发表于 2010-7-1 05:19:50 | 只看该作者
脚本看不明...
加密内容不明....
作用不明....(PS:只限于我)
请说明下...
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2009-2-13
帖子
82
5
发表于 2010-7-1 21:01:04 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-16 08:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表