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

Project1

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

[原创发布] 脑残物Custom RGSS Player(Game.exe)

[复制链接]

Lv1.梦旅人

路人党员

梦石
0
星屑
51
在线时间
2276 小时
注册时间
2010-12-30
帖子
3225
跳转到指定楼层
1
发表于 2015-3-26 10:27:12 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 英顺的马甲 于 2015-3-26 16:46 编辑

前几天比较看得懂c++后拿了第三方RGSS Player来改,于是就出了此脑残物

这脑残物对普通人来说比较有用的功能就只有会自动加载与exe同目录内fonts文件夹里的字体
不过这个exe有个缺点,那就是并不是所有的RGSS10XX.dll都支持(目前已知肯定支持的有原版的)
杀毒信息:https://www.virustotal.com/en/file/cba1f55c2ac3bc31e47ddf99897482e41600fe022db05bbb5bac40d24a90e3c6/analysis/1427335101/
下载:
EXE与源码.rar (64.99 KB, 下载次数: 161)

如果你完全不懂API或c++之类的请回头

EXE源码,大神勿喷(其实喷也没关系)
额外功能

带有WndProc的范例: Custom RGSS Player.rar (2.97 MB, 下载次数: 320)

@晴兰 @orzfly @yangff 求吐槽

点评

为什么我没看到……  发表于 2015-3-26 19:30
加了,那名字没被河蟹?==  发表于 2015-3-26 16:43
对  发表于 2015-3-26 13:42
Q群?==  发表于 2015-3-26 13:09
英叔快来99639268  发表于 2015-3-26 12:45

评分

参与人数 2星屑 +20 收起 理由
冷峻逸 + 11 好东西
stevenrock + 9 好厉害的代码…

查看全部评分

本人擅长XP,如果有脚本或者Ruby方面的问题欢迎发电邮到[email protected]咨询,本人很少检查电邮所以不一定会及时回复,本人不会直接出手解决问题只会提供一个方向,所以谢绝伸手党

Lv1.梦旅人

路人党员

梦石
0
星屑
51
在线时间
2276 小时
注册时间
2010-12-30
帖子
3225
2
 楼主| 发表于 2015-8-21 17:19:16 | 显示全部楼层
RUBY 代码复制下载
  1. # coding: gbk
  2. require 'win32api'
  3.  
  4. def err_msg(format, *args)
  5.         Win32API.new('user32', 'MessageBox', 'lppl', 'i').call(@hWnd ? @hWnd : 0, format % args, @title, 16)
  6.         stop
  7. end
  8.  
  9. def stop
  10.         Win32API.new('kernel32', 'FreeLibrary', 'l', 'i').call(@hRGSSCore) if @hRGSSCore and @hRGSSCore != 0
  11.         Win32API.new('user32', 'DestroyWindow', 'l', 'i').call(@hWnd) if @hWnd and @hWnd != 0
  12.         Win32API.new('user32', 'UnregisterClass', 'pl', 'i').call(WndClassName, @hInstance)
  13.         exit
  14. end
  15.  
  16. WndClassName = "RGSS Player"
  17. DefaultLibrary = "RGSS102J.dll"
  18. DefaultTitle = "Untitled"
  19. DefaultScripts = "Data\\Scripts.rxdata"
  20.  
  21. @library = [0].pack('C') * 100
  22. @title = [0].pack('C') * 100
  23. @scripts = [0].pack('C') * 100
  24.  
  25. @hInstance = Win32API.new('kernel32', 'GetModuleHandle', 'l', 'l').call(0)
  26. Win32API.new('user32', 'ShowWindow', 'li', 'i').call(Win32API.new('kernel32', 'GetConsoleWindow', 'v', 'l').call, 0)
  27.  
  28. @inipath = File.basename(__FILE__).sub(/\.rb$/i, '.ini')
  29. @inipath = File.join(Dir.pwd, @inipath).gsub(/\//, "\\")
  30. if File.exist?(@inipath)
  31.         gpps = Win32API.new('kernel32', 'GetPrivateProfileString', 'ppppip', 'i')
  32.         gpps.call('Game', 'Library', DefaultLibrary, @library, 100, @inipath)
  33.         gpps.call('Game', 'Title', DefaultTitle, @title, 100, @inipath)
  34.         gpps.call('Game', 'Scripts', DefaultScripts, @scripts, 100, @inipath)
  35.         @library.delete([0].pack('C'))
  36.         @title.delete([0].pack('C'))
  37.         @scripts.delete([0].pack('C'))
  38. else
  39.         @library = DefaultLibrary
  40.         @title = DefaultTitle
  41.         @scripts = DefaultScripts
  42. end
  43.  
  44. if File.exist?(File.basename(__FILE__).sub(/\.rb$/i, '.rgssad'))
  45.         @rgssad = File.basename(__FILE__).sub(/\.rb$/i, '.rgssad')
  46.         @rgssad = File.join(Dir.pwd, @rgssad).gsub(/\//, "\\")
  47. end       
  48.  
  49. @wndclass = [
  50.         43, # style
  51.         Win32API.new('kernel32', 'GetProcAddress', 'lp', 'l').call(
  52.                 Win32API.new('kernel32', 'LoadLibrary', 'p', 'l').call('User32.dll'),
  53.                 'DefWindowProcW'), # wndproc
  54.         0, # class extra
  55.         0, # wnd extra
  56.         @hInstance,
  57.         Win32API.new('user32', 'LoadIcon', 'll', 'l').call(0, 32512), # icon
  58.         Win32API.new('user32', 'LoadCursor', 'll', 'l').call(0, 32512), # cursor
  59.         Win32API.new('gdi32', 'GetStockObject', 'i', 'l').call(4), # brush
  60.         0, # menu name
  61.         WndClassName # class name
  62. ].pack('ILiiLLLLLp')
  63.  
  64. temp = Win32API.new('user32', 'RegisterClass', 'p', 'l').call(@wndclass)
  65. err_msg("注册窗口类失败 %s。", WndClassName) if temp == 0
  66.  
  67. gsm = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
  68.  
  69. width = gsm.call(7) * 2 + 640
  70. height = gsm.call(8) * 2 + gsm.call(4) + 480
  71. x = (gsm.call(0) - width) / 2
  72. y = (gsm.call(1) - height) / 2
  73.  
  74. @hWnd = Win32API.new('user32','CreateWindowExA','lpplllllllll','l').call(
  75.         0x100, WndClassName, @title, 0x90CA0000, x, y, width, height, 0, 0, @hInstance, 0)
  76. err_msg("创建窗口失败 %s。", @title) if @hWnd == 0
  77.  
  78. @hRGSSCore = Win32API.new('kernel32', 'LoadLibrary', 'p', 'l').call(@library)
  79. err_msg("加载RGSS核心库失败 %s。", @library) if @hRGSSCore == 0
  80.  
  81. def get_check(ary)
  82.         begin
  83.                 Kernel.const_set(ary[0], Win32API.new(@library, *ary))
  84.         rescue Exception
  85.                 err_msg("获取RGSS核心库导出函数失败 %s。", ary[0])
  86.         end
  87. end
  88. get_check(%w{RGSSEval p i})
  89. get_check(%w{RGSSInitialize l v})
  90. get_check(%w{RGSSGameMain lpl v})
  91. get_check(%w{RGSSSetupRTP ppi})
  92. undef :get_check
  93.  
  94. rtpname = [0].pack('C') * 1024
  95. if (RGSSSetupRTP.call(@inipath, rtpname, 1024) == 0)
  96.         err_msg("没有发现 RGSS-RTP %s。", rtpname.delete([0].pack('C')))
  97. end
  98.  
  99. RGSSInitialize.call(@hRGSSCore)
  100. if ARGV.include?("btest")
  101.         RGSSEval.call("$DEBUG = true; $BTEST = true")
  102.         @rgssad = nil
  103. elsif ARGV.include?('debug')
  104.         RGSSEval.call("$DEBUG = true")
  105. end
  106.  
  107. RGSSGameMain.call(@hWnd, @scripts, @rgssad ? rgssad.object_id * 2 + 16 : 0)
  108.  
  109. stop
本人擅长XP,如果有脚本或者Ruby方面的问题欢迎发电邮到[email protected]咨询,本人很少检查电邮所以不一定会及时回复,本人不会直接出手解决问题只会提供一个方向,所以谢绝伸手党
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-12 09:01

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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