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 05-26-12, 01:42 PM   #1
quink99
中国水兵
 
Join Date: Jul 2011
Posts: 278
Downloads: 941
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
v1.0.33.0 released. See post #1

This version allows you to inject a file (ANY type of file) into a process. You also have the option of executing the file you loaded You can inject ANY file into a process (bmp, hex, txt, etc, dll, exe).

If you elect to execute the file you injected, the last command HAS to be a RETN statement (or a RETN x if you need to pop temp variables off the stack). If you forget this the process WILL CRASH! You don't have to add the RETN statement if you are going to branch to somewhere else in the process but in doing so don't forget to pop the return value pushed onto the stack by the stub!

The execution will begin at the first byte found in the file. I'll add a way for you to specify beginning execution point in next version.

I've included a little file (TestFile(retn).hex) that you can inject into the SH5 process. When it asks if you want to execute it say yes. SH5 will never know anything every happened! The file is just one command, RETN, which means return to caller. Here's how the inject file works:
- the app allocates memory in the process in a multiple of pagesize to fit the file being injected
- the file contents are copied into this memory
- if the user selected execute then:
- a stub is made that will branch execution to the injected file. The first thing the stub does is push the EIP to the stack. This way when the injected code issues a RETN statement execution goes back to it's original place

There are two new buttons - Inject file and Remove file. They do just as they sound. To remove a file select the file from the Injections listview and then press Remove file.

Working on dumping process memory and reloading it now so user can modify it. Also adding a way to set watches on memory and letting you define the update time interval on them

The LoadLibraryA and FreeLibray offsets are still hardcoded for kernel32.dll. If you get failed to inject or failed to remove it's probably because you have older version of kernel32.dll installed on your computer. I should have these hard codes removed in next version.

TDW, I was wondering if you might have a Child's Garden-type explanation of your revised MOD above of what this revision is and what it does spoken slowly and using small words for those computer poster children among'st us.

Thanks
quink99 is offline   Reply With Quote
Old 05-26-12, 02:30 PM   #2
volodya61
Ocean Warrior
 
volodya61's Avatar
 
Join Date: Feb 2012
Location: Rostov-on-Don, local time GMT+4
Posts: 3,292
Downloads: 374
Uploads: 0


Default

Quote:
Originally Posted by quink99 View Post
TDW, I was wondering if you might have a Child's Garden-type explanation of your revised MOD above of what this revision is and what it does spoken slowly and using small words for those computer poster children among'st us.

Thanks
Absolutely agree
I would say the same thing, but couldn't find the right words.. my poor English..
I don't understand it myself (my poor English), and I can't explain this in sukhoi.ru..
TDW! Maybe you can make a simple version for children, please!
__________________
.
Where does human stupidity end?

.


El sueño de la razón produce monstruos © - and for some people awakening will be cruel
volodya61 is offline   Reply With Quote
Old 05-26-12, 04:03 PM   #3
Endroo
Nub
 
Join Date: May 2009
Posts: 3
Downloads: 5
Uploads: 0
Default

Oh my! I can't seem to find the older patches, but the CO2 fix in the latest asks for it. What do I do?
Endroo is offline   Reply With Quote
Old 05-26-12, 04:06 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by BIGREG View Post


To see this is great , but it is beyond my knowledge

What this mean in concrete

The possibility of adding what ?

- Contollers for. SIM? (Dials, lights ....)

- Otherwise to open other programes eg: Enigma, sextant ...

- .....
Quote:
Originally Posted by volodya61 View Post
Absolutely agree
I would say the same thing, but couldn't find the right words.. my poor English..
I don't understand it myself (my poor English), and I can't explain this in sukhoi.ru..
TDW! Maybe you can make a simple version for children, please!
In laymen's terms I'm giving you the tools to add/expand/change a process. If you're not familiar with what a process is it's a Windows term - once again, in laymen's terms, think of it as the encapsulation of everything needed to run an application in windows.

DLL injection let's you write code in some editor (Visual Studio for instance), compile that code into a DLL, and then inject that into a process to either change it's functionality, override a functionality, and/or add new functionality. Now simply injecting a DLL isn't going to do much. Yes, the DLL is now part of the process but it's never being 'called'. You need to add hooks into the existing code so that your new code is called.

If you're really computer saavy you can replace an existing DLL with your own. That lets you do things the app never intended to do (DLL injection/code injection does also but this way is easier for some)

Injecting a file is just as it sounds - taking the contents of a file and placing it inside an active process. What does this do for you? I can think of many things! You all are familiar with my patches - you load up the patch file and then you enable the patches you want. Think of those patches as files being injected into the SH5 process (I actually write new data to existing files but it should help you understand the concept).

Now for those of you, like me, who love assembly (long live DOS!) injecting a file is the way to go. You can write your 'code' in an assembler, take the hex file generated and inject it into the process. Once I code in the ability to dump and replace process memory then you will have an easy way to add your hooks to call your new code.

I'm working on the ability to add watches currently. If your familiar with Visual Studio then you know what watches are already. If not I'll try to make it a little clear: say you have an application that displays a value on a screen and you'd really like to change that value and/or monitor it. We have no idea where this value resides so we have to do a little exploring inside the active process. We pick an area of memory and set a watch on it - the watch will monitor that area of memory for any changes. When it detects changes it can either suspend the process or just update the app with the new value. This allows you to see what that memory is doing in real time. By setting many different watches (and changing what they are monitoring) you will eventually find where the variable is located so you can manipulate it.

I made the app generic in nature so that it can be used on anything. It's not fixed to any particular app or process.

This app now let's you 'play' in my favorite playground...process memory. You are limited only by your imagination/skill level


Last edited by TheDarkWraith; 05-26-12 at 04:21 PM.
TheDarkWraith is offline   Reply With Quote
Old 05-26-12, 05:47 PM   #5
quink99
中国水兵
 
Join Date: Jul 2011
Posts: 278
Downloads: 941
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
In laymen's terms I'm giving you the tools to add/expand/change a process. If you're not familiar with what a process is it's a Windows term - once again, in laymen's terms, think of it as the encapsulation of everything needed to run an application in windows.

DLL injection let's you write code in some editor (Visual Studio for instance), compile that code into a DLL, and then inject that into a process to either change it's functionality, override a functionality, and/or add new functionality. Now simply injecting a DLL isn't going to do much. Yes, the DLL is now part of the process but it's never being 'called'. You need to add hooks into the existing code so that your new code is called.

If you're really computer saavy you can replace an existing DLL with your own. That lets you do things the app never intended to do (DLL injection/code injection does also but this way is easier for some)

Injecting a file is just as it sounds - taking the contents of a file and placing it inside an active process. What does this do for you? I can think of many things! You all are familiar with my patches - you load up the patch file and then you enable the patches you want. Think of those patches as files being injected into the SH5 process (I actually write new data to existing files but it should help you understand the concept).

Now for those of you, like me, who love assembly (long live DOS!) injecting a file is the way to go. You can write your 'code' in an assembler, take the hex file generated and inject it into the process. Once I code in the ability to dump and replace process memory then you will have an easy way to add your hooks to call your new code.

I'm working on the ability to add watches currently. If your familiar with Visual Studio then you know what watches are already. If not I'll try to make it a little clear: say you have an application that displays a value on a screen and you'd really like to change that value and/or monitor it. We have no idea where this value resides so we have to do a little exploring inside the active process. We pick an area of memory and set a watch on it - the watch will monitor that area of memory for any changes. When it detects changes it can either suspend the process or just update the app with the new value. This allows you to see what that memory is doing in real time. By setting many different watches (and changing what they are monitoring) you will eventually find where the variable is located so you can manipulate it.

I made the app generic in nature so that it can be used on anything. It's not fixed to any particular app or process.

This app now let's you 'play' in my favorite playground...process memory. You are limited only by your imagination/skill level

A thing of beauty, TDW, You were able to explain it in such an elegant manner that even a complete computer retardo is beginning to grasp what your talking about..............Thanks so much, Quink
quink99 is offline   Reply With Quote
Old 05-26-12, 11:53 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

v1.0.34.0 released. See post #1

You can now add watches Click the watches button to open the watches window. Use Watches-->Add to add watches. Should be pretty self-explanatory

Still working on the dumping/reloading of memory

Same thing still applies to the kernel32.dll as I haven't gotten around to coding that either.
TheDarkWraith is offline   Reply With Quote
Old 05-27-12, 03:43 AM   #7
Endroo
Nub
 
Join Date: May 2009
Posts: 3
Downloads: 5
Uploads: 0
Default

Hey TDW! Where can I find the older patches, like the first one? They don't appear to be in the latest patch's files.
Endroo is offline   Reply With Quote
Old 05-27-12, 08:49 AM   #8
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Endroo View Post
Hey TDW! Where can I find the older patches, like the first one? They don't appear to be in the latest patch's files.
All the patches are included with each new version. When you unzip the package you'll find (currently) three s5p files. These s5p files are the patch files.

I'm assuming when you say older patches like the first one you are referring to the hydro fix and map color changes. Those can be found in the TDW_SH5_Patches.s5p file.
TheDarkWraith is offline   Reply With Quote
Old 05-27-12, 11:34 AM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

v1.0.35.0 released. See post #1

This version adds a new patch to the sh5.exe that fixes the broken resupply system while at sea

There's no way I could test for the full impact of this change so you all will have to let me know anything odd. All the change does is remove the check that determines the number of resupplies available (thus allowing you to resupply as long as a resupply point is shown on the map)
TheDarkWraith is offline   Reply With Quote
Old 05-27-12, 05:22 PM   #10
Endroo
Nub
 
Join Date: May 2009
Posts: 3
Downloads: 5
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
All the patches are included with each new version. When you unzip the package you'll find (currently) three s5p files. These s5p files are the patch files.

I'm assuming when you say older patches like the first one you are referring to the hydro fix and map color changes. Those can be found in the TDW_SH5_Patches.s5p file.
Why thank you! Good work, and I'm glad to see that someone is still taking care of this game to this day!
Endroo is offline   Reply With Quote
Old 05-27-12, 09:45 PM   #11
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,153
Downloads: 901
Uploads: 73


Default

Could we have the patcher remember the path to the sh5.exe or is that not allowed . Set path to sh5.exe rather than select path to sh5.exe .
THE_MASK is offline   Reply With Quote
Old 05-27-12, 10:07 PM   #12
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
Could we have the patcher remember the path to the sh5.exe or is that not allowed . Set path to sh5.exe rather than select path to sh5.exe .
I can do that. I can have it write the last path you selected for the file being patched to the patch file Good idea
TheDarkWraith is offline   Reply With Quote
Old 05-27-12, 10:11 PM   #13
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,153
Downloads: 901
Uploads: 73


Default

Quote:
Originally Posted by TheDarkWraith View Post
I can do that. I can have it write the last path you selected for the file being patched to the patch file Good idea
Thankyou sir
THE_MASK is offline   Reply With Quote
Old 06-27-12, 04:51 PM   #14
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
Could we have the patcher remember the path to the sh5.exe or is that not allowed . Set path to sh5.exe rather than select path to sh5.exe .
v1.0.42.0 released. See post #1

This version remembers the path you last used to the file mentioned in the patch file. It will prompt you if you want to use the path found or select a new one

This version (and all subsequent versions) are Linux friendly (compiled against .NET 2.0)
TheDarkWraith is offline   Reply With Quote
Old 06-27-12, 05:29 PM   #15
StinkiePoep
Watch
 
Join Date: Mar 2010
Posts: 30
Downloads: 249
Uploads: 0
Default

Thanks TDW ,

I wish i had half ur skills in this ...
StinkiePoep is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 08:35 AM.


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