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 03-06-13, 12:35 AM   #1
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

My GR2s aren't opening. It was either 355 or 356 that I first tried it and it opened that old augustus gr2 but wouldn't open others. Now with 365 it says "failed to retrieve handle to Granny viewer process"


I attached a rar with a few gr2's that are created with "grannymaterialhacker" it was a quick utility that made game playable GR2s for reskinning. The program cant access all the textures (probably because if the hidden stuff you found) but I included it and all the DLLs so maybe you can find how they did it. They lost their source code in a burglary but said that the program can be decompiled in Reflector and was done in C++. I hope it helps

http://www.mediafire.com/?mtv89wmrbabatv1


Also, they made their program use the one of the DLLs to make the GR2s for civ5. Maybe you can see what they did so we can recompress? just a thought, nothing urgent. Thank you for your work!
Ekmek is offline   Reply With Quote
Old 03-06-13, 09:25 AM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Ekmek View Post
My GR2s aren't opening. It was either 355 or 356 that I first tried it and it opened that old augustus gr2 but wouldn't open others. Now with 365 it says "failed to retrieve handle to Granny viewer process"


I attached a rar with a few gr2's that are created with "grannymaterialhacker" it was a quick utility that made game playable GR2s for reskinning. The program cant access all the textures (probably because if the hidden stuff you found) but I included it and all the DLLs so maybe you can find how they did it. They lost their source code in a burglary but said that the program can be decompiled in Reflector and was done in C++. I hope it helps

http://www.mediafire.com/?mtv89wmrbabatv1


Also, they made their program use the one of the DLLs to make the GR2s for civ5. Maybe you can see what they did so we can recompress? just a thought, nothing urgent. Thank you for your work!
Run the app with admin rights. Ensure you didn't install your Granny Viewer or the app in the \Program Files or \Program Files (x86) folder. The error of failed to retrieve handle to blah blah is Windows imposing security restrictions on you.

I'm not using any outside DLLs with the app to avoid legal problems. I'll use a company's app against them (ala Granny Viewer) though as there are no legal ramifications against injecting code and hooks into a running process.

I can read the whole GR2 file now except for embedded images without using any DLL. Because I can read it I can also write it. I don't need to look at any DLL or RE any DLL to find out how to read a GR2 file anymore. I understand the structure/layout and how to manipulate it

There really is no need to recompress a GR2 file unless you are installing it on a tablet or handheld device where the harddrive space is small. You have to understand that a compressed GR2 file still has to be decompressed when loaded. The file is junk unless it's decompressed. This adds in the loading time of whatever app due to having to decompress x GR2 files. Being already decompressed speeds up the loading time Compressing a GR2 file is just one way to 'hide' the information contained in it.
TheDarkWraith is offline   Reply With Quote
Old 03-06-13, 02:45 PM   #3
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Run the app with admin rights. Ensure you didn't install your Granny Viewer or the app in the \Program Files or \Program Files (x86) folder. The error of failed to retrieve handle to blah blah is Windows imposing security restrictions on you.

I'm not using any outside DLLs with the app to avoid legal problems. I'll use a company's app against them (ala Granny Viewer) though as there are no legal ramifications against injecting code and hooks into a running process.

I can read the whole GR2 file now except for embedded images without using any DLL. Because I can read it I can also write it. I don't need to look at any DLL or RE any DLL to find out how to read a GR2 file anymore. I understand the structure/layout and how to manipulate it

There really is no need to recompress a GR2 file unless you are installing it on a tablet or handheld device where the harddrive space is small. You have to understand that a compressed GR2 file still has to be decompressed when loaded. The file is junk unless it's decompressed. This adds in the loading time of whatever app due to having to decompress x GR2 files. Being already decompressed speeds up the loading time Compressing a GR2 file is just one way to 'hide' the information contained in it.

Thanks. I got the GrannyViewer going but when I tried to open the montezuma.gr2 I can see it/decompress it in grannyviewer but then when I go to your app I get the Unhandled Exception error.

The GR2 in question is with the the last link I posted.
Ekmek is offline   Reply With Quote
Old 03-06-13, 03:55 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Ekmek View Post
Thanks. I got the GrannyViewer going but when I tried to open the montezuma.gr2 I can see it/decompress it in grannyviewer but then when I go to your app I get the Unhandled Exception error.

The GR2 in question is with the the last link I posted.
Excellent. I'll check out that GR2 file to see what's going on
TheDarkWraith is offline   Reply With Quote
Old 03-06-13, 05:06 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

That montezuma.GR2 is a doozy Most of the 'rules' I thought I knew just got shattered by it It exposed a new datatype in the datatype definitions - granny_real16 so that's a positive. It'll take me some time to analyze this and make the necessary changes I've already made a few that were easy to do. This granny_real16 though is something I was hoping I would never see
TheDarkWraith is offline   Reply With Quote
Old 03-06-13, 06:47 PM   #6
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
That montezuma.GR2 is a doozy Most of the 'rules' I thought I knew just got shattered by it It exposed a new datatype in the datatype definitions - granny_real16 so that's a positive. It'll take me some time to analyze this and make the necessary changes I've already made a few that were easy to do. This granny_real16 though is something I was hoping I would never see

ouch! I got faith in you man!
Ekmek is offline   Reply With Quote
Old 03-06-13, 07:01 PM   #7
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Ekmek View Post
ouch! I got faith in you man!
It's not that bad. The hardest part was finding a float16 data type. C# doesn't define that value type but DirectX does: Microsoft.DirectX.Single16 Since I'm already using DirectX for the rendering it's a no problem
TheDarkWraith 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 05:01 PM.


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.