Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
About Us Register FAQ Members List Calendar Mark Forums Read

Login to remove all ads!
Reply
 
LinkBack Thread Tools Display Modes
Old March 16th, 2008   #1 (permalink)
Emu author
 
mudlord's Avatar
 
Join Date: Feb 2007
Location: Wuzzleberg
Posts: 1,357
Mudlord's Generic HLSL Shader Patch

Okay, here's a generic patcher to add HLSL support to any D3D9 based app.

Theoretically.

This is tested to work with Rice Video and BSNES. Copy protected apps are not supported. Same goes for packed targets.

Any testing and feedback is appreciated.

EDIT: Update 1 posted.
EDIT2: Major update

http://vba-m.ngemu.com/personalpage/...ds/shaders.rar
__________________


"Software is getting slower more rapidly than hardware becomes faster......"

-Niklaus Wirth

Last edited by mudlord; June 16th, 2008 at 12:41.
mudlord is offline   Reply With Quote
Old March 17th, 2008   #2 (permalink)
King Of Evil
 
wadibahi's Avatar
 
Join Date: Feb 2008
Location: Pakistan
Posts: 71
G00d work
wadibahi is offline   Reply With Quote
Old March 17th, 2008   #3 (permalink)
Emu author
 
@ruantec's Avatar
 
Join Date: Nov 2002
Location: Austria (originally from the most beautiful island of the caribbean "Dominican Republic")
Posts: 1,315
Quote:
Originally Posted by wadibahi View Post
G00d work
it´s indeed a great tool

i personally love to see great tools with a great GUI.... and this tool has definitely both!
__________________

Current development tools:

Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6
@ruantec is online now   Reply With Quote
Old March 17th, 2008   #4 (permalink)
I'm evil
 
Titus03's Avatar
 
Join Date: Aug 2003
Location: ? (In PAL-area)
Posts: 666
Quote:
Originally Posted by @ruantec-Man View Post
itīs indeed a great tool

i personally love to see great tools with a great GUI.... and this tool has definitely both!
I agree with you. GUI is great.

Just tried testing it with other D3D9 based programs. Dunno if they all were copy protected I tried, but it complained "nothing patched!". Only program it patched was NFSU, but shaders did no effect to it. I followed all the instructions and I'm running it with a card capable of pixel shaders.

Testing is pending.
__________________

- SYSTEM SPECIFICATIONS: ----------------------------------
Intel Core2 Duo E4600 @2.40GHz || ASUS Commando
4GB DDR2 800MHz RAM ||
EVGA GeForce 8800 GTS 512Mb
Corsair 620W 620HX || 3x Seagate 160Gb SATAII HDD
Creative Sound Blaster X-Fi XtremeMusic
Windows XP Home Edition SP3/Ubuntu 8.04 Hardy Heron
------------------------------------------------------------------
Titus03 is offline   Reply With Quote
Old March 18th, 2008   #5 (permalink)
Emu author
 
mudlord's Avatar
 
Join Date: Feb 2007
Location: Wuzzleberg
Posts: 1,357
Hmmm, well copy protected games are encrypted to protect against modification. A good program to detect copy protections for games is Protection ID.

As for your NFSU game, are you running a "unpatched" game? Though it depends on how the release group reversed and unpacked the SafeDisc protection on that game...

As for supported apps:
* All BSNES versions
* All Rice Video DX9 compiles
* Colin McRae Rally 2005 1.1 (Starforce unwrapped)
* Just Cause (RELOADED)

As for unsupported apps:
* F.E.A.R (RELOADED) - memory writing error
* Direct64 - loads imports differently to other DX9 plugins
Attached Images
File Type: jpg justcause.JPG (66.7 KB, 70 views)
__________________


"Software is getting slower more rapidly than hardware becomes faster......"

-Niklaus Wirth

Last edited by mudlord; March 18th, 2008 at 06:35.
mudlord is offline   Reply With Quote
Old March 18th, 2008   #6 (permalink)
Smart Star
 
Rebel_X's Avatar
 
Join Date: Sep 2002
Location: Chicago, Oak Lawn
Posts: 698
hey! nice program! I have suggestion here if you don't mind

Why don't you make the program run in the background and intercept all D3D9 calls (just like 3D Analyzer) and make changes with Shaders effects to actual running game or emulator (post processing), this is gonna be great, since it can work for larger set of applications or even windows itself (Am I going to far with my imagination!!) and It's gonna be nice to add the filters from Pete OGL2 plugin and others and switch between them by certain key combination!

I am telling you it's gonna ROCK! it's GENUINE idea, there is no other program on the net (AFAIK) can do that, and you might make some money from it if you have PayPal and make it commercial! think about it..

But to be honest! I don't know if this is gonna work since all the drawing using DirectX applications is:

lock video hardware
draw stuff on back buffer
unlock video hardware
show stuff on screen (flip back buffer with front buffer)

Sorry I am not that much in DirectX programming, but I think it's close (similar) enough!
__________________

"Logic is the Art of going wrong with confidence"
Rebel_X is offline   Reply With Quote
Old March 18th, 2008   #7 (permalink)
Emu author
 
mudlord's Avatar
 
Join Date: Feb 2007
Location: Wuzzleberg
Posts: 1,357
Quote:
and It's gonna be nice to add the filters from Pete OGL2 plugin and others
That would require hooking OpenGL too...

Quote:
Why don't you make the program run in the background and intercept all D3D9 calls (just like 3D Analyzer) and make changes with Shaders effects to actual running game or emulator (post processing)
Thats exactly how the patch works. It forces the program to load d4rk.dll to intercept all calls to D3D9.DLL, which is the main DLL for Direct3D9. It then interferes with how the rendering is done so that it adds a additional render pass to add shaders. However, making changes while its running is a bit more complicated. I know there is one app for OpenGL things that does exactly what you describe. And its open source too.

Quote:
this is gonna be great, since it can work for larger set of applications or even windows itself
If there is a decent way to hook D3D8 apps and add assembler shaders to that, then thats D3D8/9 covered. Your idea of messing with Windows though is a whole different ball game :P.

Quote:
lock video hardware
draw stuff on back buffer
unlock video hardware
show stuff on screen (flip back buffer with front buffer)
More like:

Lock render surface
Draw
Unlock render surface
show stuff
__________________


"Software is getting slower more rapidly than hardware becomes faster......"

-Niklaus Wirth
mudlord is offline   Reply With Quote
Old April 12th, 2008   #8 (permalink)
Registered User
 
Join Date: Apr 2007
Location: indiana
Posts: 374
post some more pics!
fried_egg is offline   Reply With Quote
Old April 12th, 2008   #9 (permalink)
Emu author
 
mudlord's Avatar
 
Join Date: Feb 2007
Location: Wuzzleberg
Posts: 1,357
If people interested....I might :/
__________________


"Software is getting slower more rapidly than hardware becomes faster......"

-Niklaus Wirth
mudlord is offline   Reply With Quote
Old April 12th, 2008   #10 (permalink)
Smart Star
 
Rebel_X's Avatar
 
Join Date: Sep 2002
Location: Chicago, Oak Lawn
Posts: 698
I am..

But you didn't answer mah question clearly (I think I didn't explain it in a good way)

My question is, instead of patching the program, why don't you make your program resident in memory and systray. and intercept the calls to d3d9 calls when it happems (just like trigger) or even add a white list to your program that when those applications are running do patching in (RAM) memory instead of patching EXE files.. (similar to what Game Cheater programs do about hacking memory addresses).. without copying any dll to game directory or whatteva...

My second question is, if I copied shader effects from pete OGL2 plugin and renamed them to *.fx file, is it gonna work or not, is it written in HLSL 1, 2, 3 or 4
__________________

"Logic is the Art of going wrong with confidence"

Last edited by Rebel_X; April 12th, 2008 at 04:21.
Rebel_X is offline   Reply With Quote
Old April 12th, 2008   #11 (permalink)
Emu author
 
mudlord's Avatar
 
Join Date: Feb 2007
Location: Wuzzleberg
Posts: 1,357
Quote:
My question is, instead of patching the program, why don't you make your program resident in memory and systray. and intercept the calls to d3d9 calls when it happems (just like trigger) or even add a white list to your program that when those applications are running do patching in (RAM) memory instead of patching EXE files.. (similar to what Game Cheater programs do about hacking memory addresses).. without copying any dll to game directory or whatteva...
Ah, now I know exactly what your talking about. So, your asking about code injection? Well, it could be something I can look into....

Quote:
My second question is, if I copied shader effects from pete OGL2 plugin and renamed them to *.fx file, is it gonna work or not, is it written in HLSL 1, 2, 3 or 4
It won't work. HLSL shaders are entirely different to GLSL shaders.
__________________


"Software is getting slower more rapidly than hardware becomes faster......"

-Niklaus Wirth
mudlord is offline   Reply With Quote
Old April 12th, 2008   #12 (permalink)
Smart Star
 
Rebel_X's Avatar
 
Join Date: Sep 2002
Location: Chicago, Oak Lawn
Posts: 698
any ideas how to convert them since I am interested in cartoon shader effects to run it on PC games..


Edit
second thing if you could do what my suggestion say "above" I think it's gonna increase the compatibility even if using SecuRom safedisc or packed exes..
although, I don't know if it's possible to modify any memory address if it was allocated in protected mode :/
__________________

"Logic is the Art of going wrong with confidence"
Rebel_X is offline   Reply With Quote
Old April 12th, 2008   #13 (permalink)
Emu author
 
mudlord's Avatar
 
Join Date: Feb 2007
Location: Wuzzleberg
Posts: 1,357
Quote:
any ideas how to convert them since I am interested in cartoon shader effects to run it on PC games..
There is nothing stopping interested people in learning HLSL syntax to port Guest's shaders to D3D's HLSL shader language. Though, I do have a basic shader for cel shading.

Quote:
second thing if you could do what my suggestion say "above" I think it's gonna increase the compatibility even if using SecuRom safedisc or packed exes..
although, I don't know if it's possible to modify any memory address if it was allocated in protected mode :/
I'm afraid I can't discuss any further about it, as since this forum is hosted in the USA, the DMCA is in effect there, and RE'ing of protections, even if for things like this, is possibly illegal.
__________________


"Software is getting slower more rapidly than hardware becomes faster......"

-Niklaus Wirth
mudlord is offline   Reply With Quote
Old April 12th, 2008   #14 (permalink)
Smart Star
 
Rebel_X's Avatar
 
Join Date: Sep 2002
Location: Chicago, Oak Lawn
Posts: 698
Quote:
Originally Posted by mudlord View Post
I'm afraid I can't discuss any further about it, as since this forum is hosted in the USA, the DMCA is in effect there, and RE'ing of protections, even if for things like this, is possibly illegal.

Man, we are not talking about Piracy or anything, you could say its for Educational purposes only..
Edit: What I am saying increase the chance of the program to run with those applications..

But anyhoo, don't stop to improve this little program, there is a lot of things can be done, don't abandon this project please
__________________

"Logic is the Art of going wrong with confidence"
Rebel_X is offline   Reply With Quote
Old April 12th, 2008   #15 (permalink)
Registered User
 
Join Date: Apr 2007
Location: indiana
Posts: 374
wow that music is obnoxious mudlord!
fried_egg is offline   Reply With Quote
Old April 12th, 2008   #16 (permalink)
Menthol Flavored
 
TheCloudOfSmoke's Avatar
 
Join Date: Mar 2005
Location: In your butt. If I'm not there, I'm in Maryland, USA.
Posts: 2,730
Quote:
Originally Posted by fried_egg View Post
wow that music is obnoxious mudlord!
It looks and sounds like a keygen. j/k
__________________
http://thecloudofsmoke.deviantart.com/
http://thecloudofsmoke.deviantart.com/gallery/

Quote:
Originally Posted by Ryu2 View Post
Unfortunately I'm back already with another dumb question. How do I activate the stylus? >_<

(I tried jabbing at the computer screen with the nds stylus but it didn't work).
TheCloudOfSmoke is offline   Reply With Quote
Old April 13th, 2008   #17 (permalink)
Smart Star
 
Rebel_X's Avatar
 
Join Date: Sep 2002
Location: Chicago, Oak Lawn
Posts: 698
Quote:
Originally Posted by TheCloudOfSmoke View Post
It looks and sounds like a keygen. j/k

I always liked Commodore 64 MOD music, they are awesome..

There was a site called KeyGenMusic.net But I don't know it's down since the first of this month.. Lucky me, I downloaded the Music Pack for all keygens, countless hours of Awesome music that blow my mind..
__________________

"Logic is the Art of going wrong with confidence"
Rebel_X is offline   Reply With Quote
Old April 13th, 2008   #18 (permalink)
Emu author
 
mudlord's Avatar
 
Join Date: Feb 2007
Location: Wuzzleberg
Posts: 1,357
Quote:
It looks and sounds like a keygen. j/k
Well, that is exactly what the point is.

It is meant to be like a crack.

Quote:
There was a site called KeyGenMusic.net But I don't know it's down since the first of this month.. Lucky me, I downloaded the Music Pack for all keygens, countless hours of Awesome music that blow my mind..
I prefer Modland
__________________


"Software is getting slower more rapidly than hardware becomes faster......"

-Niklaus Wirth
mudlord is offline   Reply With Quote
Old April 13th, 2008   #19 (permalink)
Smart Star
 
Rebel_X's Avatar
 
Join Date: Sep 2002
Location: Chicago, Oak Lawn
Posts: 698
Well, I wonder the RAR file less than 3MB, but the Music Pack from KeyGenMusic (RAR) till this January contains more than 1000 mods, and over 28MB.. from all KeyGen Crews from A-Z..


PS: I wonder why downloading AllMods file takes ages, 2KB/S, although I tried downloading something else it's over 100kb/s ... shoot..

Edit: Damn, it's just huge text file contains all music files and directory structures..
And it says also the ModLand server is slow for downloading and it's just mainly for uploading, and suggests to use mirrors.. thats why..
__________________

"Logic is the Art of going wrong with confidence"

Last edited by Rebel_X; April 13th, 2008 at 10:30.
Rebel_X is offline   Reply With Quote
Old April 13th, 2008   #20 (permalink)
Emu author
 
mudlord's Avatar
 
Join Date: Feb 2007
Location: Wuzzleberg
Posts: 1,357
Quote:
Damn, it's just huge text file contains all music files and directory structures..
And it says also the ModLand server is slow for downloading and it's just mainly for uploading, and suggests to use mirrors.. thats why..
Yes, the Modland server has around 70GB or more worth of public domain music.....
__________________


"Software is getting slower more rapidly than hardware becomes faster......"

-Niklaus Wirth
mudlord is offline   Reply With Quote
Reply

Thread Tools
Display Modes
Linear Mode Linear Mode
Threaded Mode