SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 02-27-11, 03:33 PM   #16
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,226
Downloads: 901
Uploads: 73


Default

Quote:
Originally Posted by TheDarkWraith View Post
I wouldn't say it's not possible but it would be hard to do. It could be done though. You could do this easier with a game's .py file
You can already look at your sunk ship icons on google earth if you go on the official silent hunter 5 site . Not while playing the game though .
THE_MASK is offline   Reply With Quote
Old 02-27-11, 05:56 PM   #17
Krauter
Ocean Warrior
 
Join Date: Aug 2007
Location: Montreal, Canada
Posts: 2,983
Downloads: 102
Uploads: 1
Default

Could this be done to earlier Silent Hunter games as well? Or would it be possible to take features missing/taken out of SH5 that were in 3 & 4 and put them back in?

(New Ships?? Switch over from GR2 Files??)
__________________
Quote:
The U.S almost went to war over some missles in Cuba... Thank god the X-Men were there to save us right?
Krauter is offline   Reply With Quote
Old 02-27-11, 06:05 PM   #18
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Krauter View Post
Could this be done to earlier Silent Hunter games as well? Or would it be possible to take features missing/taken out of SH5 that were in 3 & 4 and put them back in?

(New Ships?? Switch over from GR2 Files??)
I can make it work with any application. I have a version I made that allows one to inject DLLs into ANY process (plus it does a lot more than that ). So yes I can make it work for SH3/4

Anything is possible when you are able to inject DLLs into a running process. The DLL being injected defines what the new features are or removes some functionality or ??? Really you can do anything with it that you can code.
TheDarkWraith is offline   Reply With Quote
Old 02-27-11, 06:19 PM   #19
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,226
Downloads: 901
Uploads: 73


Default

So theoretically you could link 2 diffrent games up together . I could be playing SH5 , walk thru a door in the bunker and be instantly playing COD 5 entering a village . Walk thru a door in COD 5 that was coded in and be back in the SH5 bunker . Just a lame example .
THE_MASK is offline   Reply With Quote
Old 02-27-11, 06:29 PM   #20
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
So theoretically you could link 2 diffrent games up together . I could be playing SH5 , walk thru a door in the bunker and be instantly playing COD 5 entering a village . Walk thru a door in COD 5 that was coded in and be back in the SH5 bunker . Just a lame example .
Theoretically yes but that would be hard because you'd have to share process memory between the two apps (games). That is beyond me currently Maybe someday in the future but currently I'm not able to share memory between processes.
TheDarkWraith is offline   Reply With Quote
Old 02-27-11, 07:16 PM   #21
Hartmann
Sea Lord
 
Join Date: Mar 2005
Location: Grid CH 26, Spain ,Barcelona
Posts: 1,857
Downloads: 204
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Yes one can change core game features to a large extent and one can add new features to the game. It's not as easy as it sounds though. Your new content would be in the dll to inject and you hook into the game to have it execute your new code. You add the hook via code in your dll.

I use Visual Studio 2008 C# or C++ to do my programming and my DLL creating. One could use Visual Basic if they wanted to. A DLL is an exe with one bit changed in the PE header to 'make' it a DLL. Any computer language can be used as long as you can compile the source code into a dll.
I'm going to make a sample dll file and include source code so that you can see what this app can do for SH5
Amazing

could be possible then make a surface warships game or more complex submarines or weapons
__________________
But this ship can't sink!...

She is made of iron, sir. I assure you, she can. and she will. It is a mathematical certainty.

Strength and honor
Hartmann is offline   Reply With Quote
Old 02-27-11, 07:22 PM   #22
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Hartmann View Post
Amazing

could be possible then make a surface warships game or more complex submarines or weapons
whatever you code your dll to do and how you hook it into the game will define what changes/additions/removals are incurred in the game
TheDarkWraith is offline   Reply With Quote
Old 02-27-11, 07:36 PM   #23
Krauter
Ocean Warrior
 
Join Date: Aug 2007
Location: Montreal, Canada
Posts: 2,983
Downloads: 102
Uploads: 1
Default

Dam.. I could see the CWSS guys making good use of this in the SH4 Mod Workshop
__________________
Quote:
The U.S almost went to war over some missles in Cuba... Thank god the X-Men were there to save us right?
Krauter is offline   Reply With Quote
Old 02-27-11, 07:38 PM   #24
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Krauter View Post
Dam.. I could see the CWSS guys making good use of this in the SH4 Mod Workshop
have them contact me and I'll make a version of this injector for SH4

What most people don't know is that a .exe file is mapped in memory by the Windows loader when the process is started. By copying these memory blocks one can assemble their own .exe file. So after injecting your .dll you could have it save the memory regions to a file (with an appropriate PE header) thus creating a new version of the sh5.exe file (a patched version if you will with your changes). Sounds easy to do but it's rather involved (but doable).
TheDarkWraith is offline   Reply With Quote
Old 02-27-11, 08:26 PM   #25
Yamato_NF
King of the Ocean
 
Yamato_NF's Avatar
 
Join Date: Mar 2010
Location: Michigan, United States
Posts: 337
Downloads: 621
Uploads: 0
"SH4 Injector": Possibility?

DarkWraith,
I think Jhapprich can make good use of this for CWSS, (Cold Warriors: Steel Sharks). which is supposed to bring SH4 into the Cold War!
i posted a reply on the CWSS thread found
here:
http://www.subsim.com/radioroom/showthread.php?t=161396
i said that i would recommend this program and to ask for a 32bit version for SH4
ill shoot him a PM aswell.
Yamato_NF
__________________
Proud owner of SH3/4/5
Proud owner of the DCS series

"He who controls the seas controls the world."
Yamato_NF is offline   Reply With Quote
Old 02-27-11, 08:32 PM   #26
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Yamato_NF View Post
DarkWraith,
I think Jhapprich can make good use of this for CWSS, (Cold Warriors: Steel Sharks). which is supposed to bring SH4 into the Cold War!
i posted a reply on the CWSS thread found
here:
http://www.subsim.com/radioroom/showthread.php?t=161396
i said that i would recommend this program and to ask for a 32bit version for SH4
ill shoot him a PM aswell.
Yamato_NF
I'll start work on making a 32bit SH4 version then
TheDarkWraith is offline   Reply With Quote
Old 02-27-11, 09:47 PM   #27
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

32bit version released for SH5. You'll have to tell me if this works or not (on a 32bit OS) as I run Windows 7 64bit and this whole WoW (Windows on Windows) stuff screws me up big time
TheDarkWraith is offline   Reply With Quote
Old 02-28-11, 03:00 AM   #28
Zedi
Sea Lord
 
Join Date: Mar 2010
Posts: 1,845
Downloads: 184
Uploads: 2
Default

Quote:
Originally Posted by sober View Post
You can already look at your sunk ship icons on google earth if you go on the official silent hunter 5 site . Not while playing the game though .
This is just awesome and I cannot understand why Ubi not implemented this map in the game now that we have to be online to play. I really miss something like this, it would be so cool to see your activity history on map and also see other players/captains location and recent activity.

Is no way to "suck" this data from g2w.ubi.com and make it available in the game?!
Zedi is offline   Reply With Quote
Old 02-28-11, 04:01 AM   #29
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@TDW: Very interesting and promising thread.

Until now I directly injected Hex Code into sh3.exe and some .act files in order to do some realism changes and additions. See this thread for details:

http://www.subsim.com/radioroom/showthread.php?t=174225

I still stick on direct HexCode Injection because I am not very familiar to DLL based code injection.

My question to you is: Does DLL code injection also work for .act files, which are loaded into different memory locations every time a game is started because of address space layout randomization (ASLR) in newer 64 Bit systems?

By the way: In SH3, DLL code injection seems to be very easy, just place your .act file into the sh3 install directory and it will be loaded automatically by sh3.exe when it starts, regardless of it's name.

Thanks very much and good luck!
h.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 02-28-11 at 07:22 AM.
h.sie is offline   Reply With Quote
Old 02-28-11, 09:45 AM   #30
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by h.sie View Post
My question to you is: Does DLL code injection also work for .act files, which are loaded into different memory locations every time a game is started because of address space layout randomization (ASLR) in newer 64 Bit systems?

By the way: In SH3, DLL code injection seems to be very easy, just place your .act file into the sh3 install directory and it will be loaded automatically by sh3.exe when it starts, regardless of it's name.

Thanks very much and good luck!
h.sie
Every Silent Hunter game will load ANY .act file it finds in it's root directory. What I'm not sure is whether those .act files have a DLLMain function in them (or something similar) and if they do whether it gets called or not by the game or the Windows loader. When the Windows loader adds a library (module) to a process it calls DLLMain on the module when it's loaded. DLLMain is used to initialize the dll (can be used to do other things also).

Your question about DLL code injection for .act files I don't understand. Maybe you're asking if DLL code injection places the loaded module at random memory locations everytime it's injected? If so, the answer is yes. The Windows loader determines where the module will be placed in memory. Now some will say well how can you inject new code if the memory address is always changing? The answer is simple. You hook into the main game code and point it to your code. You have DLLMain do the hook into the main game code (suspend the main game thread - add hook - resume main game thread).
TheDarkWraith is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.