Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Li | defd3f977c | |
Li | 53c04dfe7a | |
Li | 789eb5f4f2 | |
Li | 83b544655a | |
Li | c41d2b107d | |
Li | d35581525d | |
random() | 11fd69f882 | |
Li | 8bfe2bad45 |
|
@ -2,3 +2,5 @@
|
|||
*/bin/*
|
||||
*/Release/*
|
||||
*/Debug/*
|
||||
*/.vs/*
|
||||
*.pdb
|
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
Copyright (c) 2022 Li
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
|
43
README.md
|
@ -1,5 +1,44 @@
|
|||
# UGP
|
||||
# Universal GameMaker Patcher
|
||||
Originally created to enable the built in PSVita support in GM Studio, it has evolved into the most universal key generator for the old GameMaker programs
|
||||
|
||||
gamemaker-studio allows you to provide any modules you want into your license
|
||||
all options are:
|
||||
```
|
||||
HTML5
|
||||
iOS
|
||||
android
|
||||
androidTest
|
||||
AndroidTest
|
||||
AndroidMips
|
||||
AmazonFire
|
||||
Mac
|
||||
Tizen
|
||||
WindowsTest
|
||||
Linux
|
||||
RaspberryPi
|
||||
BlackBerry
|
||||
WindowsPhone
|
||||
Symbia
|
||||
Windows8
|
||||
Windows8RT
|
||||
WindowsPhone8
|
||||
yycompiler
|
||||
NeoGeoX
|
||||
ps3
|
||||
ps4
|
||||
psvita
|
||||
wiiu
|
||||
3ds
|
||||
xboxone
|
||||
WindowsUAP
|
||||
AndroidTV
|
||||
AppleTV
|
||||
JavaScript
|
||||
AmazonFireExpired
|
||||
Free
|
||||
```
|
||||
note: not all of these are actually avalible for download on yoyogames servers, for example BlackBerrry, RaspberryPi, etc.
|
||||
and so will not actually *work* if added into your license, the default options is for all modules that are public on yoyogames servers.
|
||||
|
||||
Universal GameMaker Patcher
|
||||
|
||||
Created in GameMaker: HTML5.
|
|
@ -1,24 +1,10 @@
|
|||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<assets>
|
||||
<datafiles number="3">
|
||||
<datafile>
|
||||
<name>libeay32.dll</name>
|
||||
<filename>libeay32.dll</filename>
|
||||
<origname>C:\Users\Li\Desktop\NuclearWar\UGP\UGP.gmx\\\datafiles\libeay32.dll</origname>
|
||||
<exists>-1</exists>
|
||||
<size>1207808</size>
|
||||
<exportAction>2</exportAction>
|
||||
<exportDir></exportDir>
|
||||
<overwrite>0</overwrite>
|
||||
<freeData>-1</freeData>
|
||||
<removeEnd>0</removeEnd>
|
||||
<store>-1</store>
|
||||
<data>datafiles\libeay32.dll</data>
|
||||
</datafile>
|
||||
<datafile>
|
||||
<name>UGP.dll</name>
|
||||
<filename>UGP.dll</filename>
|
||||
<origname>C:\Users\Li\Desktop\NuclearWar\UGP\UGP.gmx\\\datafiles\UGP.dll</origname>
|
||||
<origname>C:\Users\Li\Desktop\UGP\UGP\UGP.gmx\\\datafiles\UGP.dll</origname>
|
||||
<exists>-1</exists>
|
||||
<size>97280</size>
|
||||
<exportAction>2</exportAction>
|
||||
|
@ -32,7 +18,7 @@
|
|||
<datafile>
|
||||
<name>ModuleDownloader.exe</name>
|
||||
<filename>ModuleDownloader.exe</filename>
|
||||
<origname>C:\Users\Li\Desktop\NuclearWar\UGP\UGP.gmx\\\datafiles\ModuleDownloader.exe</origname>
|
||||
<origname>C:\Users\Li\Desktop\UGP\UGP\UGP.gmx\\\datafiles\ModuleDownloader.exe</origname>
|
||||
<exists>-1</exists>
|
||||
<size>2147328</size>
|
||||
<exportAction>2</exportAction>
|
||||
|
@ -43,19 +29,33 @@
|
|||
<store>-1</store>
|
||||
<data>datafiles\ModuleDownloader.exe</data>
|
||||
</datafile>
|
||||
<datafile>
|
||||
<name>winspool.dll</name>
|
||||
<filename>winspool.dll</filename>
|
||||
<origname>C:\Users\Li\Desktop\UGP\UGP\UGP.gmx\\\datafiles\winspool.dll</origname>
|
||||
<exists>-1</exists>
|
||||
<size>75776</size>
|
||||
<exportAction>2</exportAction>
|
||||
<exportDir></exportDir>
|
||||
<overwrite>0</overwrite>
|
||||
<freeData>-1</freeData>
|
||||
<removeEnd>0</removeEnd>
|
||||
<store>-1</store>
|
||||
<data>datafiles\winspool.dll</data>
|
||||
</datafile>
|
||||
</datafiles>
|
||||
<options>
|
||||
<fullscreen>-1</fullscreen>
|
||||
<interpolate>0</interpolate>
|
||||
<interpolate>-1</interpolate>
|
||||
<noborder>0</noborder>
|
||||
<showcursor>0</showcursor>
|
||||
<scale>-1</scale>
|
||||
<sizeable>0</sizeable>
|
||||
<scale>0</scale>
|
||||
<sizeable>-1</sizeable>
|
||||
<stayontop>0</stayontop>
|
||||
<windowcolor>0</windowcolor>
|
||||
<changeresolution>0</changeresolution>
|
||||
<colordepth>0</colordepth>
|
||||
<resolution>0</resolution>
|
||||
<resolution>6</resolution>
|
||||
<frequency>0</frequency>
|
||||
<nobuttons>0</nobuttons>
|
||||
<freeze>0</freeze>
|
||||
|
@ -84,18 +84,18 @@
|
|||
<aborterrors>0</aborterrors>
|
||||
<variableerrors>0</variableerrors>
|
||||
<argumenterrors>-1</argumenterrors>
|
||||
<author>decompiler clan :police_car: :police_car: :police_car:</author>
|
||||
<version></version>
|
||||
<author>Li</author>
|
||||
<version>1.5</version>
|
||||
<lastchanged>44738.8179982292</lastchanged>
|
||||
<information></information>
|
||||
<version_major>1</version_major>
|
||||
<version_minor>0</version_minor>
|
||||
<version_release>0</version_release>
|
||||
<version_build>0</version_build>
|
||||
<version_company></version_company>
|
||||
<version_product></version_product>
|
||||
<version_copyright></version_copyright>
|
||||
<version_description></version_description>
|
||||
<version_company>The Crystal System</version_company>
|
||||
<version_product>Universal GameMaker Patcher</version_product>
|
||||
<version_copyright>no</version_copyright>
|
||||
<version_description>Patcher for GM5, 6, 8.1 HTML5 and Studio 1.4</version_description>
|
||||
<html5_index><undefined></html5_index>
|
||||
<html5_loadingbar></html5_loadingbar>
|
||||
<html5_alwaysreload>0</html5_alwaysreload>
|
||||
|
@ -147,6 +147,7 @@
|
|||
</sprites>
|
||||
<sprite>sprites\spr_checkmark</sprite>
|
||||
<sprite>sprites\spr_mute</sprite>
|
||||
<sprite>sprites\spr_fullscreen</sprite>
|
||||
<sprite>sprites\spr_back</sprite>
|
||||
<sprite>sprites\spr_go</sprite>
|
||||
<sprite>sprites\spr_textinput</sprite>
|
||||
|
@ -159,11 +160,11 @@
|
|||
<paths name="paths"/>
|
||||
<scripts name="scripts">
|
||||
<scripts name="UI">
|
||||
<script>scripts\create_gmhtml5_menu.gml</script>
|
||||
<script>scripts\create_status.gml</script>
|
||||
<script>scripts\create_product_menu.gml</script>
|
||||
<script>scripts\create_status.gml</script>
|
||||
<script>scripts\create_gm81_menu.gml</script>
|
||||
<script>scripts\create_gm5_menu.gml</script>
|
||||
<script>scripts\create_gmhtml5_menu.gml</script>
|
||||
<script>scripts\create_studio_menu.gml</script>
|
||||
<script>scripts\show_modules.gml</script>
|
||||
</scripts>
|
||||
|
@ -194,6 +195,11 @@
|
|||
<script>scripts\dectohex.gml</script>
|
||||
<script>scripts\string_starts_with.gml</script>
|
||||
</scripts>
|
||||
<scripts name="Ext">
|
||||
<script>scripts\draw_text_center.gml</script>
|
||||
<script>scripts\fullscreen_toggle.gml</script>
|
||||
<script>scripts\fullscreen_off.gml</script>
|
||||
</scripts>
|
||||
</scripts>
|
||||
<fonts name="fonts">
|
||||
<font>fonts\fn_text</font>
|
||||
|
@ -205,7 +211,7 @@
|
|||
<object>objects\obj_checkmark_old</object>
|
||||
<object>objects\obj_checkmark_modules</object>
|
||||
<object>objects\obj_checkmark_updater</object>
|
||||
<object>objects\obj_checkmark_libeay32</object>
|
||||
<object>objects\obj_checkmark_winspool</object>
|
||||
<object>objects\obj_checkmark_base</object>
|
||||
</objects>
|
||||
<objects name="Buttons">
|
||||
|
@ -222,6 +228,7 @@
|
|||
</objects>
|
||||
<object>objects\obj_back</object>
|
||||
<object>objects\obj_mute</object>
|
||||
<object>objects\obj_fullscreen</object>
|
||||
<object>objects\obj_lstbox_entry_module</object>
|
||||
</objects>
|
||||
<objects name="TextInputs">
|
||||
|
@ -245,11 +252,10 @@
|
|||
<object>objects\obj_draw_exports</object>
|
||||
<object>objects\obj_status_draw</object>
|
||||
<object>objects\obj_draw</object>
|
||||
<object>objects\obj_cursor</object>
|
||||
</objects>
|
||||
</objects>
|
||||
</objects>
|
||||
<rooms name="rooms" roommaxid="100000" room_maxtileid="10000000">
|
||||
<rooms name="rooms" roommaxid="100002" room_maxtileid="10000000">
|
||||
<room>rooms\rm_product_select</room>
|
||||
<room>rooms\rm_crack_gm8</room>
|
||||
<room>rooms\rm_crack_studio</room>
|
||||
|
|
BIN
UGP.gmx/help.rtf
|
@ -0,0 +1,19 @@
|
|||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<object>
|
||||
<spriteName>spr_checkmark</spriteName>
|
||||
<solid>0</solid>
|
||||
<visible>-1</visible>
|
||||
<depth>0</depth>
|
||||
<persistent>0</persistent>
|
||||
<parentName>obj_checkmark_base</parentName>
|
||||
<maskName><undefined></maskName>
|
||||
<events/>
|
||||
<PhysicsObject>0</PhysicsObject>
|
||||
<PhysicsObjectSensor>0</PhysicsObjectSensor>
|
||||
<PhysicsObjectShape>0</PhysicsObjectShape>
|
||||
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
|
||||
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
|
||||
<PhysicsObjectGroup>0</PhysicsObjectGroup>
|
||||
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
|
||||
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
|
||||
</object>
|
|
@ -8,6 +8,30 @@
|
|||
<parentName><undefined></parentName>
|
||||
<maskName><undefined></maskName>
|
||||
<events>
|
||||
<event eventtype="3" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>x = mouse_x;
|
||||
y = mouse_y;
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="8" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
|
@ -25,7 +49,7 @@
|
|||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>draw_sprite(spr_cursor, 0, mouse_x, mouse_y);
|
||||
<string>draw_sprite(spr_cursor, 0, window_mouse_get_x(), window_mouse_get_y());
|
||||
|
||||
</string>
|
||||
</argument>
|
||||
|
|
|
@ -124,7 +124,7 @@ centerY = room_height/2;
|
|||
|
||||
draw_set_font(fn_text);
|
||||
draw_set_color(c_white);
|
||||
draw_text(0,0,"Press 'ESC' to exit.");
|
||||
draw_text_center(0,"Press 'ESC' to exit.");
|
||||
|
||||
if(draw_flashing_text){
|
||||
draw_text(centerX - (string_width(global.flashing_msg) / 2), room_height - (string_height(global.flashing_msg)), global.flashing_msg);
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<object>
|
||||
<spriteName>spr_fullscreen</spriteName>
|
||||
<solid>0</solid>
|
||||
<visible>-1</visible>
|
||||
<depth>0</depth>
|
||||
<persistent>-1</persistent>
|
||||
<parentName><undefined></parentName>
|
||||
<maskName><undefined></maskName>
|
||||
<events>
|
||||
<event eventtype="0" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>checked = 0;
|
||||
image_speed = 0;
|
||||
image_index = 0;
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="6" enumb="11">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>if(checked)
|
||||
image_index = 2;
|
||||
else
|
||||
image_index = 0
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="6" enumb="10">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>if(checked)
|
||||
image_index = 3;
|
||||
else
|
||||
image_index = 1
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="6" enumb="4">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>fullscreen_toggle();
|
||||
|
||||
|
||||
if(checked == 0)
|
||||
checked = 1;
|
||||
else
|
||||
checked = 0;
|
||||
|
||||
|
||||
if(checked)
|
||||
image_index = 3;
|
||||
else
|
||||
image_index = 1;
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
</events>
|
||||
<PhysicsObject>0</PhysicsObject>
|
||||
<PhysicsObjectSensor>0</PhysicsObjectSensor>
|
||||
<PhysicsObjectShape>0</PhysicsObjectShape>
|
||||
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
|
||||
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
|
||||
<PhysicsObjectGroup>0</PhysicsObjectGroup>
|
||||
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
|
||||
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
|
||||
</object>
|
|
@ -97,7 +97,7 @@ image_index = 0;
|
|||
<kind>1</kind>
|
||||
<string>error_occurred = 0;
|
||||
|
||||
license_gm81(obj_textinput_name.text, obj_textinput_key.text, obj_checkmark_libeay32.checked);
|
||||
license_gm81(obj_textinput_name.text, obj_textinput_key.text, obj_checkmark_winspool.checked);
|
||||
|
||||
obj_draw.back_down = true;
|
||||
if(!error_occurred)
|
||||
|
|
|
@ -97,7 +97,7 @@ image_index = 0;
|
|||
<kind>1</kind>
|
||||
<string>error_occurred = 0;
|
||||
|
||||
license_gmhtml5(obj_textinput_name.text, obj_textinput_key.text, obj_checkmark_libeay32.checked);
|
||||
license_gmhtml5(obj_textinput_name.text, obj_textinput_key.text, obj_checkmark_winspool.checked);
|
||||
|
||||
obj_draw.back_down = true;
|
||||
if(!error_occurred)
|
||||
|
|
|
@ -98,7 +98,7 @@ image_index = 0;
|
|||
<string>error_occurred = 0;
|
||||
///license_gmhtml5(name, answer, key, email, type, export_modules, do_libeay32, download_exports)
|
||||
|
||||
license_studio(obj_textinput_name.text, string(obj_textinput_answer.text), obj_textinput_key.text, obj_textinput_email.text, obj_textinput_type.text, global.export_modules, obj_checkmark_libeay32.checked, obj_checkmark_modules.checked, obj_checkmark_old.checked)
|
||||
license_studio(obj_textinput_name.text, string(obj_textinput_answer.text), obj_textinput_key.text, obj_textinput_email.text, obj_textinput_type.text, global.export_modules, obj_checkmark_winspool.checked, obj_checkmark_modules.checked, obj_checkmark_old.checked)
|
||||
obj_draw.back_down = true;
|
||||
if(!error_occurred)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,43 @@ if(obj_draw.back_down == false && obj_draw.back_up == false)
|
|||
obj_draw.action += "game_end();";
|
||||
}
|
||||
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="7" enumb="4">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>///Check if the room is too big for the display.
|
||||
|
||||
var display_height;
|
||||
display_height = display_get_height()
|
||||
|
||||
var display_width;
|
||||
display_width = display_get_width()
|
||||
|
||||
|
||||
if(room_width > display_width && room_height > display_height){
|
||||
|
||||
fullscreen_off();
|
||||
obj_fullscreen.checked = 1;
|
||||
|
||||
}
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
|
@ -58,10 +95,11 @@ if(obj_draw.back_down == false && obj_draw.back_up == false)
|
|||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>external_free("UGP.dll");
|
||||
<string>/// delete included files
|
||||
external_free("UGP.dll");
|
||||
|
||||
file_delete("UGP.dll");
|
||||
file_delete("libeay32.dll");
|
||||
file_delete("winspool.dll");
|
||||
file_delete("ModuleDownloader.exe");
|
||||
</string>
|
||||
</argument>
|
||||
|
@ -85,7 +123,8 @@ file_delete("ModuleDownloader.exe");
|
|||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>//UGP.DLL imports
|
||||
<string>///Initalize
|
||||
//UGP.DLL imports
|
||||
global.getMachineGuid = external_define("UGP.dll","GetMachineGuid",dll_cdecl,ty_string,0);
|
||||
global.MD5 = external_define("UGP.dll","MD5",dll_cdecl,ty_string,1,ty_string);
|
||||
global.setBinKey = external_define("UGP.dll","SetBinKey",dll_cdecl,ty_real,3,ty_string, ty_string, ty_string);
|
||||
|
@ -101,6 +140,9 @@ global.LOCALAPPDATA = external_call(global.getLocalAppDataFolder);
|
|||
global.download_exports = false;
|
||||
|
||||
instance_create((room_width-(44/2))-10, (room_height-(44/2))-10, obj_mute);
|
||||
instance_create(35, 35, obj_fullscreen);
|
||||
|
||||
cursor_sprite = spr_cursor;
|
||||
|
||||
global.direction = 0;
|
||||
sound_loop(snd_mus);
|
||||
|
@ -111,6 +153,8 @@ for(i = 0; i < 1000; i+=1)
|
|||
|
||||
obj = instance_create(obj_x, obj_y, obj_star);
|
||||
}
|
||||
|
||||
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<background visible="0" foreground="0" name="" x="0" y="0" htiled="-1" vtiled="-1" hspeed="0" vspeed="0" stretch="0"/>
|
||||
</backgrounds>
|
||||
<views>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="999" vborder="999" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<background visible="0" foreground="0" name="" x="0" y="0" htiled="-1" vtiled="-1" hspeed="0" vspeed="0" stretch="0"/>
|
||||
</backgrounds>
|
||||
<views>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="999" vborder="999" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<background visible="0" foreground="0" name="" x="0" y="0" htiled="-1" vtiled="-1" hspeed="0" vspeed="0" stretch="0"/>
|
||||
</backgrounds>
|
||||
<views>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="999" vborder="999" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<background visible="0" foreground="0" name="" x="0" y="0" htiled="-1" vtiled="-1" hspeed="0" vspeed="0" stretch="0"/>
|
||||
</backgrounds>
|
||||
<views>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="999" vborder="999" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<background visible="0" foreground="0" name="" x="0" y="0" htiled="-1" vtiled="-1" hspeed="0" vspeed="0" stretch="0"/>
|
||||
</backgrounds>
|
||||
<views>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="1920" hview="1080" xport="0" yport="0" wport="1920" hport="1080" hborder="999" vborder="999" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
|
@ -51,8 +51,7 @@
|
|||
</views>
|
||||
<instances>
|
||||
<instance index="0" objName="obj_main" x="0" y="0" name="inst_14C62424" locked="0" code="" scaleX="1" scaleY="1" colour="-1" rotation="0"/>
|
||||
<instance index="29" objName="obj_draw" x="16" y="0" name="inst_A00DD3E8" locked="0" code="" scaleX="1" scaleY="1" colour="-1" rotation="0"/>
|
||||
<instance index="30" objName="obj_cursor" x="32" y="0" name="inst_DA3296D2" locked="0" code="" scaleX="1" scaleY="1" colour="-1" rotation="0"/>
|
||||
<instance index="30" objName="obj_draw" x="16" y="0" name="inst_A00DD3E8" locked="0" code="" scaleX="1" scaleY="1" colour="-1" rotation="0"/>
|
||||
</instances>
|
||||
<tiles/>
|
||||
<PhysicsWorld>0</PhysicsWorld>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<background visible="0" foreground="0" name="" x="0" y="0" htiled="-1" vtiled="-1" hspeed="0" vspeed="0" stretch="0"/>
|
||||
</backgrounds>
|
||||
<views>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="999" vborder="999" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
<view visible="0" objName="<undefined>" xview="0" yview="0" wview="640" hview="480" xport="0" yport="0" wport="640" hport="480" hborder="32" vborder="32" hspeed="-1" vspeed="-1"/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
global.direction = 1;
|
||||
|
||||
instance_create(centerX-250, centerY-150, obj_checkmark_libeay32);
|
||||
instance_create(centerX-250, centerY-150, obj_checkmark_winspool);
|
||||
//instance_create(centerX-250, centerY-90, obj_checkmark_updater);
|
||||
instance_create(centerX-290, centerY+20, obj_textinput_name);
|
||||
instance_create(centerX-290, centerY+110, obj_textinput_key);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
global.direction = 1;
|
||||
|
||||
instance_create(centerX-250, centerY-150, obj_checkmark_libeay32);
|
||||
instance_create(centerX-250, centerY-150, obj_checkmark_winspool);
|
||||
instance_create(centerX-290, centerY+20, obj_textinput_name);
|
||||
instance_create(centerX-290, centerY+110, obj_textinput_key);
|
||||
instance_create(centerX, centerY+250, obj_go_gmhtml5);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
global.direction = 1;
|
||||
|
||||
instance_create(centerX-250, centerY-150, obj_checkmark_libeay32);
|
||||
instance_create(centerX-250, centerY-150, obj_checkmark_winspool);
|
||||
instance_create(centerX-250, centerY-90, obj_checkmark_modules);
|
||||
instance_create(centerX-290, centerY-30, obj_textinput_name);
|
||||
instance_create(centerX-290, centerY+15, obj_textinput_key);
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
///draw_text(y, text)
|
||||
draw_text((room_width / 2) - (string_width(argument1) / 2), argument0, argument1);
|
|
@ -0,0 +1,10 @@
|
|||
///fullscreen_off()
|
||||
window_set_fullscreen(false);
|
||||
window_set_size(960, 544);
|
||||
|
||||
window_set_region_size(window_get_width(), window_get_height(), true);
|
||||
window_set_region_scale(0, true);
|
||||
|
||||
window_set_position((display_get_width() / 2) - (window_get_width() / 2), (display_get_height() / 2) - (window_get_height() / 2));
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
///fullscreen_toggle()
|
||||
if(window_get_fullscreen()) {
|
||||
fullscreen_off();
|
||||
}
|
||||
else{
|
||||
window_set_fullscreen(true);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
///license_gm81(name, key, do_libeay32)
|
||||
///license_gm81(name, key, do_winspool)
|
||||
var name;
|
||||
var key;
|
||||
var machineGuid;
|
||||
|
@ -9,11 +9,10 @@ key = argument1;
|
|||
|
||||
if(argument2)
|
||||
{
|
||||
dll_path = global.APPDATA+"\GameMaker\libeay32.dll";
|
||||
dll_path = global.APPDATA+"\GameMaker\winspool.drv";
|
||||
if(file_exists(dll_path))
|
||||
file_delete(dll_path);
|
||||
//export_include_file_location("libeay32.dll", dll_path);
|
||||
file_copy("libeay32.dll", dll_path);
|
||||
file_copy("winspool.dll", dll_path);
|
||||
}
|
||||
|
||||
guid = external_call(global.getMachineGuid);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
///license_gmhtml5(name, key, do_libeay32)
|
||||
///license_gmhtml5(name, key, do_winspool)
|
||||
var name;
|
||||
var key;
|
||||
var machineGuid;
|
||||
|
@ -9,11 +9,10 @@ key = argument1;
|
|||
|
||||
if(argument2)
|
||||
{
|
||||
dll_path = global.APPDATA+"\GameMaker-HTML5\libeay32.dll";
|
||||
dll_path = global.APPDATA+"\GameMaker-HTML5\winspool.drv";
|
||||
if(file_exists(dll_path))
|
||||
file_delete(dll_path);
|
||||
//export_include_file_location("libeay32.dll", dll_path);
|
||||
file_copy("libeay32.dll", dll_path);
|
||||
file_copy("winspool.dll", dll_path);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
///license_studio(name, answer, key, email, type, export_modules, do_libeay32, download_exports, old_version)
|
||||
///license_studio(name, answer, key, email, type, export_modules, do_winspool, download_exports, old_version)
|
||||
var name;
|
||||
var key;
|
||||
var answer;
|
||||
|
@ -15,17 +15,16 @@ email = argument3;
|
|||
type = argument4;
|
||||
export_modules = argument5;
|
||||
|
||||
do_libeay32 = argument6
|
||||
do_winspool = argument6
|
||||
global.download_exports = argument7
|
||||
old_version = argument8
|
||||
|
||||
if(do_libeay32)
|
||||
if(do_winspool)
|
||||
{
|
||||
dll_path = global.APPDATA+"\GameMaker-Studio\libeay32.dll";
|
||||
dll_path = global.APPDATA+"\GameMaker-Studio\winspool.drv";
|
||||
if(file_exists(dll_path))
|
||||
file_delete(dll_path);
|
||||
//export_include_file_location("libeay32.dll", dll_path);
|
||||
file_copy("libeay32.dll", dll_path);
|
||||
file_copy("winspool.dll", dll_path);
|
||||
}
|
||||
|
||||
addons_string = "";
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
///generate_gm6(name)
|
||||
var name;
|
||||
var new_name;
|
||||
var start;
|
||||
var encname;
|
||||
///setup_views()
|
||||
|
||||
// Pad name out with "X" (if its < 5 chars long)
|
||||
new_name = string_upper(pad(name, 5, "X"));
|
||||
var display_height = display_get_height()
|
||||
var display_width = display_get_width()
|
||||
|
||||
// Start 5 characters from the end
|
||||
start = (string_length(new_name) - 5)+1;
|
||||
|
||||
// Extract last 5 characters, into a 2 char and 3 char string
|
||||
encname = string_copy(new_name, start, 2);
|
||||
|
||||
external_call(global.generateGM6Key, argument0);
|
||||
if(room_height > display_height){
|
||||
view_hview[view_current] = display_height;
|
||||
}
|
||||
|
||||
if(room_width > display_width){
|
||||
view_hview[view_current] = display_width;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
///setup views()
|
||||
|
||||
var display_height;
|
||||
display_height = display_get_height()
|
||||
|
||||
var display_width;
|
||||
display_width = display_get_width()
|
||||
|
||||
|
||||
|
||||
if(room_height > display_height){
|
||||
view_hview[view_current] = display_height;
|
||||
view_hport[view_current] = display_height;
|
||||
}
|
||||
else{
|
||||
view_hview[view_current] = room_height;
|
||||
view_hport[view_current] = room_height;
|
||||
}
|
||||
if(room_width > display_width){
|
||||
view_wview[view_current] = display_width;
|
||||
view_wview[view_current] = display_width;
|
||||
}
|
||||
else{
|
||||
view_wview[view_current] = room_width;
|
||||
view_wport[view_current] = room_width;
|
||||
}
|
||||
|
|
@ -8,7 +8,6 @@ else{
|
|||
file_delete(location+"\ModuleDownloader.exe");
|
||||
}
|
||||
|
||||
//export_include_file_location("ModuleDownloader.exe", location+"\ModuleDownloader.exe");
|
||||
file_copy("ModuleDownloader.exe", location+"\ModuleDownloader.exe");
|
||||
execute_program(location+"\ModuleDownloader.exe","",false);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<sound>
|
||||
<kind>3</kind>
|
||||
<extension>.mp3</extension>
|
||||
<origname>C:\Users\Li\Desktop\NuclearWar\UGP\UGP.gmx\\\sound\audio\snd_mus.mp3</origname>
|
||||
<origname>C:\Users\Li\Desktop\UGP\UGP\UGP.gmx\\\sound\audio\snd_mus.mp3</origname>
|
||||
<effects>0</effects>
|
||||
<volume>1</volume>
|
||||
<pan>0</pan>
|
||||
|
|
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
@ -1,7 +1,7 @@
|
|||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<sprite>
|
||||
<xorig>41</xorig>
|
||||
<yorigin>41</yorigin>
|
||||
<xorig>44</xorig>
|
||||
<yorigin>44</yorigin>
|
||||
<colkind>0</colkind>
|
||||
<coltolerance>0</coltolerance>
|
||||
<sepmasks>0</sepmasks>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<sprite>
|
||||
<xorig>25</xorig>
|
||||
<yorigin>25</yorigin>
|
||||
<colkind>0</colkind>
|
||||
<coltolerance>0</coltolerance>
|
||||
<sepmasks>0</sepmasks>
|
||||
<bboxmode>2</bboxmode>
|
||||
<bbox_left>3</bbox_left>
|
||||
<bbox_right>46</bbox_right>
|
||||
<bbox_top>3</bbox_top>
|
||||
<bbox_bottom>46</bbox_bottom>
|
||||
<frames>
|
||||
<frame index="0">images\spr_fullscreen_0.png</frame>
|
||||
<frame index="1">images\spr_fullscreen_1.png</frame>
|
||||
<frame index="2">images\spr_fullscreen_2.png</frame>
|
||||
<frame index="3">images\spr_fullscreen_3.png</frame>
|
||||
</frames>
|
||||
</sprite>
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34330.188
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibeayPatch", "LibeayPatch\LibeayPatch.vcxproj", "{122013EF-A5F6-40A0-A8E4-71F725C240A4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{122013EF-A5F6-40A0-A8E4-71F725C240A4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{122013EF-A5F6-40A0-A8E4-71F725C240A4}.Debug|x64.Build.0 = Debug|x64
|
||||
{122013EF-A5F6-40A0-A8E4-71F725C240A4}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{122013EF-A5F6-40A0-A8E4-71F725C240A4}.Debug|x86.Build.0 = Debug|Win32
|
||||
{122013EF-A5F6-40A0-A8E4-71F725C240A4}.Release|x64.ActiveCfg = Release|x64
|
||||
{122013EF-A5F6-40A0-A8E4-71F725C240A4}.Release|x64.Build.0 = Release|x64
|
||||
{122013EF-A5F6-40A0-A8E4-71F725C240A4}.Release|x86.ActiveCfg = Release|Win32
|
||||
{122013EF-A5F6-40A0-A8E4-71F725C240A4}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {41A99AAD-D35F-4E17-A5BC-8DA7837843FE}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,39 @@
|
|||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include "OpenSSLPatch.h"
|
||||
|
||||
void createDebugConsole() {
|
||||
FILE* fDummy;
|
||||
AllocConsole();
|
||||
freopen_s(&fDummy, "CONIN$", "r", stdin);
|
||||
freopen_s(&fDummy, "CONOUT$", "w", stderr);
|
||||
freopen_s(&fDummy, "CONOUT$", "w", stdout);
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
|
||||
#ifdef _DEBUG
|
||||
createDebugConsole();
|
||||
#endif
|
||||
|
||||
PatchLibeay32();
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
break;
|
||||
case DLL_THREAD_DETACH:
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
UnpatchLibeay32();
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
/*
|
||||
* Shamelessly stolen from:
|
||||
* https://github.com/adamhlt/IAT-Hooking/tree/main
|
||||
*/
|
||||
|
||||
#include "Hook.h"
|
||||
|
||||
#include <TlHelp32.h>
|
||||
#include <Psapi.h>
|
||||
#include <Shlwapi.h>
|
||||
|
||||
/**
|
||||
* Function who retrieve the base address of the main module of the current process.
|
||||
* \return : the base address if it's successfull else nullptr
|
||||
*/
|
||||
LPVOID IAT::GetCurrentProcessModule()
|
||||
{
|
||||
char lpCurrentModuleName[MAX_PATH];
|
||||
|
||||
char lpImageName[MAX_PATH];
|
||||
|
||||
GetProcessImageFileNameA(GetCurrentProcess(), lpImageName, MAX_PATH);
|
||||
|
||||
MODULEENTRY32 ModuleList{};
|
||||
ModuleList.dwSize = sizeof(ModuleList);
|
||||
|
||||
const HANDLE hProcList = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0);
|
||||
if (hProcList == INVALID_HANDLE_VALUE)
|
||||
return nullptr;
|
||||
|
||||
if (!Module32First(hProcList, &ModuleList))
|
||||
return nullptr;
|
||||
|
||||
wcstombs_s(nullptr, lpCurrentModuleName, ModuleList.szModule, MAX_PATH);
|
||||
lpCurrentModuleName[MAX_PATH - 1] = '\0';
|
||||
|
||||
if (strstr(lpImageName, lpCurrentModuleName) != nullptr)
|
||||
return ModuleList.hModule;
|
||||
|
||||
while (Module32Next(hProcList, &ModuleList))
|
||||
{
|
||||
wcstombs_s(nullptr, lpCurrentModuleName, ModuleList.szModule, MAX_PATH);
|
||||
lpCurrentModuleName[MAX_PATH - 1] = '\0';
|
||||
|
||||
if (strstr(lpImageName, lpCurrentModuleName) != nullptr)
|
||||
return ModuleList.hModule;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to hook functions in the IAT of a specified module.
|
||||
* \param lpModuleName : name of the module wich contains the function you want to hook.
|
||||
* \param lpFunctionName : name of the function you want to hook.
|
||||
* \param lpFunction : pointer of the new function.
|
||||
* \param lpTargetModuleName : name of the module you want to target.
|
||||
* \return : the pointer of the original function or nullptr if it failed.
|
||||
*/
|
||||
LPVOID IAT::Hook(LPCSTR lpModuleName, LPCSTR lpFunctionName, const LPVOID lpFunction, LPCSTR lpTargetModuleName)
|
||||
{
|
||||
const HANDLE hModule = GetModuleHandleA(lpTargetModuleName);
|
||||
const auto lpImageDOSHeader = (PIMAGE_DOS_HEADER)(hModule);
|
||||
if (lpImageDOSHeader == nullptr)
|
||||
return nullptr;
|
||||
|
||||
const auto lpImageNtHeader = (PIMAGE_NT_HEADERS)((DWORD_PTR)lpImageDOSHeader + lpImageDOSHeader->e_lfanew);
|
||||
|
||||
const IMAGE_DATA_DIRECTORY ImportDataDirectory = lpImageNtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
|
||||
auto lpImageImportDescriptor = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD_PTR)hModule + ImportDataDirectory.VirtualAddress);
|
||||
|
||||
while (lpImageImportDescriptor->Characteristics != 0)
|
||||
{
|
||||
const auto lpCurrentModuleName = (LPSTR)((DWORD_PTR)lpImageDOSHeader + lpImageImportDescriptor->Name);
|
||||
if (_stricmp(lpCurrentModuleName, lpModuleName) != 0)
|
||||
{
|
||||
lpImageImportDescriptor++;
|
||||
continue;
|
||||
}
|
||||
|
||||
auto lpImageOrgThunkData = (PIMAGE_THUNK_DATA)((DWORD_PTR)lpImageDOSHeader + lpImageImportDescriptor->OriginalFirstThunk);
|
||||
auto lpImageThunkData = (PIMAGE_THUNK_DATA)((DWORD_PTR)lpImageDOSHeader + lpImageImportDescriptor->FirstThunk);
|
||||
|
||||
while (lpImageOrgThunkData->u1.AddressOfData != 0)
|
||||
{
|
||||
const auto lpImportData = (PIMAGE_IMPORT_BY_NAME)((DWORD_PTR)lpImageDOSHeader + lpImageOrgThunkData->u1.AddressOfData);
|
||||
|
||||
if (strcmp(lpFunctionName, (char*)lpImportData->Name) == 0)
|
||||
{
|
||||
DWORD dwJunk = 0;
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
|
||||
VirtualQuery(lpImageThunkData, &mbi, sizeof(MEMORY_BASIC_INFORMATION));
|
||||
if (!VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_READWRITE, &mbi.Protect))
|
||||
return nullptr;
|
||||
|
||||
const auto lpOrgFunction = (LPVOID)lpImageThunkData->u1.Function;
|
||||
|
||||
#if defined _M_IX86
|
||||
lpImageThunkData->u1.Function = (DWORD_PTR)lpFunction;
|
||||
#elif defined _M_X64
|
||||
lpImageThunkData->u1.Function = (DWORD_PTR)lpFunction;
|
||||
#endif
|
||||
|
||||
if (VirtualProtect(mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &dwJunk))
|
||||
return lpOrgFunction;
|
||||
}
|
||||
|
||||
lpImageThunkData++;
|
||||
lpImageOrgThunkData++;
|
||||
}
|
||||
|
||||
lpImageImportDescriptor++;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to hook functions in the IAT of a the main module of the process.
|
||||
* \param lpModuleName : name of the module wich contains the function.
|
||||
* \param lpFunctionName : name of the function you want to hook.
|
||||
* \param lpFunction : pointer of the new function.
|
||||
* \return : the pointer of the original function or nullptr if it failed.
|
||||
*/
|
||||
LPVOID IAT::Hook(LPCSTR lpModuleName, LPCSTR lpFunctionName, const LPVOID lpFunction)
|
||||
{
|
||||
const LPVOID hModule = GetCurrentProcessModule();
|
||||
const auto lpImageDOSHeader = (PIMAGE_DOS_HEADER)(hModule);
|
||||
if (lpImageDOSHeader == nullptr)
|
||||
return nullptr;
|
||||
|
||||
const auto lpImageNtHeader = (PIMAGE_NT_HEADERS)((DWORD_PTR)lpImageDOSHeader + lpImageDOSHeader->e_lfanew);
|
||||
|
||||
const IMAGE_DATA_DIRECTORY ImportDataDirectory = lpImageNtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
|
||||
auto lpImageImportDescriptor = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD_PTR)hModule + ImportDataDirectory.VirtualAddress);
|
||||
|
||||
while (lpImageImportDescriptor->Characteristics != 0)
|
||||
{
|
||||
const auto lpCurrentModuleName = (LPSTR)((DWORD_PTR)lpImageDOSHeader + lpImageImportDescriptor->Name);
|
||||
if (_stricmp(lpCurrentModuleName, lpModuleName) != 0)
|
||||
{
|
||||
lpImageImportDescriptor++;
|
||||
continue;
|
||||
}
|
||||
|
||||
auto lpImageOrgThunkData = (PIMAGE_THUNK_DATA)((DWORD_PTR)lpImageDOSHeader + lpImageImportDescriptor->OriginalFirstThunk);
|
||||
auto lpImageThunkData = (PIMAGE_THUNK_DATA)((DWORD_PTR)lpImageDOSHeader + lpImageImportDescriptor->FirstThunk);
|
||||
|
||||
while (lpImageOrgThunkData->u1.AddressOfData != 0)
|
||||
{
|
||||
const auto lpImportData = (PIMAGE_IMPORT_BY_NAME)((DWORD_PTR)lpImageDOSHeader + lpImageOrgThunkData->u1.AddressOfData);
|
||||
|
||||
if (strcmp(lpFunctionName, (char*)lpImportData->Name) == 0)
|
||||
{
|
||||
DWORD dwJunk = 0;
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
|
||||
VirtualQuery(lpImageThunkData, &mbi, sizeof(MEMORY_BASIC_INFORMATION));
|
||||
if (!VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_READWRITE, &mbi.Protect))
|
||||
return nullptr;
|
||||
|
||||
const auto lpOrgFunction = (LPVOID)lpImageThunkData->u1.Function;
|
||||
|
||||
#if defined _M_IX86
|
||||
lpImageThunkData->u1.Function = (DWORD_PTR)lpFunction;
|
||||
#elif defined _M_X64
|
||||
lpImageThunkData->u1.Function = (DWORD_PTR)lpFunction;
|
||||
#endif
|
||||
|
||||
if (VirtualProtect(mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &dwJunk))
|
||||
return lpOrgFunction;
|
||||
}
|
||||
|
||||
lpImageThunkData++;
|
||||
lpImageOrgThunkData++;
|
||||
}
|
||||
|
||||
lpImageImportDescriptor++;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef IAT_HOOK_H
|
||||
#define IAT_HOOK_H
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
class IAT
|
||||
{
|
||||
public:
|
||||
static LPVOID Hook(LPCSTR lpModuleName, LPCSTR lpFunctionName, const LPVOID lpFunction, LPCSTR lpTargetModuleName);
|
||||
static LPVOID Hook(LPCSTR lpModuleName, LPCSTR lpFunctionName, const LPVOID lpFunction);
|
||||
private:
|
||||
static LPVOID GetCurrentProcessModule();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,186 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{122013ef-a5f6-40a0-a8e4-71f725c240a4}</ProjectGuid>
|
||||
<RootNamespace>winspoolstub</RootNamespace>
|
||||
<ProjectName>LibeayPatch</ProjectName>
|
||||
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<TargetName>winspool</TargetName>
|
||||
<OutDir>$(SolutionDir)\..\..\UGP.gmx\datafiles</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<TargetName>winspool</TargetName>
|
||||
<OutDir>$(SolutionDir)\..\..\UGP.gmx\datafiles</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TargetName>winspool</TargetName>
|
||||
<OutDir>$(SolutionDir)\..\..\UGP.gmx\datafiles</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<TargetName>winspool</TargetName>
|
||||
<OutDir>$(SolutionDir)\..\..\UGP.gmx\datafiles</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;WINSPOOLSTUB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>Psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>Stub.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;WINSPOOLSTUB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>Psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>Stub.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;WINSPOOLSTUB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>Psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>Stub.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;WINSPOOLSTUB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>Psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>Stub.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Dllmain.cpp" />
|
||||
<ClCompile Include="Hook.cpp" />
|
||||
<ClCompile Include="OpenSSLPatch.cpp" />
|
||||
<ClCompile Include="Stub.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Hook.h" />
|
||||
<ClInclude Include="OpenSSLPatch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Stub.def" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Dllmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Stub.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Hook.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="OpenSSLPatch.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Hook.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="OpenSSLPatch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Stub.def">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
|
@ -0,0 +1,96 @@
|
|||
#include "Hook.h"
|
||||
#include <stdio.h>
|
||||
|
||||
// dllmain.cpp : Defines the entry point for the DLL application.
|
||||
|
||||
// ripped from openssl
|
||||
typedef struct bignum_st {
|
||||
unsigned long* d;
|
||||
int top;
|
||||
int dmax;
|
||||
int neg;
|
||||
int flags;
|
||||
} BIGNUM;
|
||||
|
||||
typedef struct rsa_st {
|
||||
void* unk1;
|
||||
void* unk2;
|
||||
void* unk3;
|
||||
void* unk4;
|
||||
BIGNUM* m;
|
||||
BIGNUM* e;
|
||||
void* unk5;
|
||||
void* unk6;
|
||||
} RSA;
|
||||
|
||||
using openssl_rsa_public_decrypt_ptr = int(__cdecl*)(int flen, const unsigned char* from, unsigned char* to, RSA* rsa, int padding);
|
||||
static openssl_rsa_public_decrypt_ptr RsaPublicDecrypt = nullptr;
|
||||
|
||||
using openssl_sha1_ptr = char* (__cdecl*)(const unsigned char* d, size_t n, unsigned char* md);
|
||||
static openssl_sha1_ptr Sha1 = nullptr;
|
||||
|
||||
const size_t SHA1_SZ = 0x14;
|
||||
|
||||
char YOYO_LICENSE_PUBLIC_KEY[0x80] = {
|
||||
0x7B, 0x05, 0x78, 0xE0, 0x05, 0x50, 0xA4, 0xD6, 0xBA, 0xE9, 0x5E, 0x28, 0xF6, 0x74, 0x2A, 0x07,
|
||||
0x21, 0x08, 0xB8, 0xC0, 0x71, 0x38, 0xA3, 0x44, 0xCD, 0x87, 0xD0, 0xAB, 0x39, 0xA1, 0xF5, 0x56,
|
||||
0x94, 0x97, 0x3E, 0xF2, 0x03, 0x9C, 0xAD, 0x86, 0x37, 0x4B, 0x82, 0xC2, 0x8C, 0x40, 0x30, 0x85,
|
||||
0x39, 0x4F, 0x04, 0xBA, 0x4B, 0x65, 0xF6, 0x0E, 0x4B, 0x9A, 0x47, 0x59, 0xFE, 0xA0, 0xA6, 0x33,
|
||||
0xDC, 0x8A, 0x0C, 0x35, 0x58, 0xDF, 0x74, 0xDC, 0xB7, 0xFE, 0x57, 0x2C, 0x85, 0x14, 0xA6, 0xD2,
|
||||
0x34, 0x9E, 0x54, 0x7D, 0xCF, 0xEA, 0x08, 0x2D, 0x29, 0xB5, 0x0B, 0x01, 0x30, 0x14, 0x5A, 0x0C,
|
||||
0xBC, 0x28, 0xF2, 0x44, 0xAA, 0xA4, 0x59, 0xEF, 0xF4, 0x4A, 0x4D, 0xFE, 0x90, 0xF4, 0x19, 0x4D,
|
||||
0xAE, 0x9C, 0x8B, 0x26, 0x9B, 0x57, 0xE5, 0x7A, 0xFC, 0x93, 0x31, 0xE5, 0xA7, 0x43, 0xCA, 0xDD
|
||||
};
|
||||
|
||||
static bool JustCheckedLicense = false;
|
||||
|
||||
char* SHA1(const unsigned char* d, size_t n, unsigned char* md) {
|
||||
// If the license was just checked, fake the SHA1 result as all 0xFF
|
||||
if (md != nullptr && JustCheckedLicense) {
|
||||
memset(md, 0xFF, SHA1_SZ);
|
||||
JustCheckedLicense = false;
|
||||
|
||||
return (char*)md;
|
||||
}
|
||||
|
||||
return Sha1(d, n, md);
|
||||
}
|
||||
|
||||
int RSA_public_decrypt(int flen, const unsigned char* from, unsigned char* to, RSA* rsa, int padding) {
|
||||
|
||||
// If the rsa key being used is the public key for license files,
|
||||
// set 0xFF as the result
|
||||
|
||||
int res = RsaPublicDecrypt(flen, from, to, rsa, padding);
|
||||
|
||||
if ( res == SHA1_SZ && memcmp(rsa->m->d, YOYO_LICENSE_PUBLIC_KEY, rsa->m->dmax) == 0) {
|
||||
memset(to, 0xFF, SHA1_SZ);
|
||||
JustCheckedLicense = true;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// hook RSA Public Decrypt & SHA1 functions
|
||||
void PatchLibeay32() {
|
||||
|
||||
LPVOID pubdecPtr = IAT::Hook("libeay32.dll", "RSA_public_decrypt", &RSA_public_decrypt);
|
||||
if (pubdecPtr == nullptr)
|
||||
return;
|
||||
|
||||
RsaPublicDecrypt = (openssl_rsa_public_decrypt_ptr)pubdecPtr;
|
||||
|
||||
LPVOID shaPtr = IAT::Hook("libeay32.dll", "SHA1", &SHA1);
|
||||
if (shaPtr == nullptr)
|
||||
return;
|
||||
|
||||
Sha1 = (openssl_sha1_ptr)shaPtr;
|
||||
|
||||
}
|
||||
|
||||
void UnpatchLibeay32() {
|
||||
if(RsaPublicDecrypt != nullptr)
|
||||
IAT::Hook("libeay32.dll", "RSA_public_decrypt", &RsaPublicDecrypt);
|
||||
if(Sha1 != nullptr)
|
||||
IAT::Hook("libeay32.dll", "SHA1", &Sha1);
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
void PatchLibeay32();
|
||||
void UnpatchLibeay32();
|
|
@ -0,0 +1,43 @@
|
|||
void ClosePrinter(int a) {
|
||||
|
||||
}
|
||||
|
||||
void DocumentPropertiesW(int a, int b, int c, int d, int e, int f) {
|
||||
|
||||
}
|
||||
|
||||
void DocumentPropertiesA(int a, int b, int c, int d, int e, int f) {
|
||||
|
||||
}
|
||||
|
||||
void GetPrinterA(int a, int b, int c, int d, int e) {
|
||||
|
||||
}
|
||||
|
||||
void GetPrinterW(int a, int b, int c, int d, int e) {
|
||||
|
||||
}
|
||||
|
||||
void EnumPrintersW(int a, int b, int c, int d, int e, int f, int g) {
|
||||
|
||||
}
|
||||
|
||||
void EnumPrintersA(int a, int b, int c, int d, int e, int f, int g) {
|
||||
|
||||
}
|
||||
|
||||
void GetDefaultPrinterW(int a, int b) {
|
||||
|
||||
}
|
||||
|
||||
void GetDefaultPrinterA(int a, int b) {
|
||||
|
||||
}
|
||||
|
||||
void OpenPrinterA(int a, int b, int c) {
|
||||
|
||||
}
|
||||
|
||||
void OpenPrinterW(int a, int b, int c) {
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
LIBRARY WINSPOOL
|
||||
EXPORTS
|
||||
ClosePrinter @144
|
||||
DocumentPropertiesW @189
|
||||
DocumentPropertiesA @188
|
||||
GetPrinterA @281
|
||||
GetPrinterW @294
|
||||
EnumPrintersW @248
|
||||
EnumPrintersA @247
|
||||
GetDefaultPrinterW @203
|
||||
GetDefaultPrinterA @201
|
||||
OpenPrinterA @302
|
||||
OpenPrinterW @308
|
|
@ -112,7 +112,7 @@
|
|||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|