VOGONS

Common searches


First post, by Gamecollector

User metadata
Rank Oldbie
Rank
Oldbie

Well, I know how to quicktest the glide API (2.20 and later) presence in a game/program. The glide API always use the grGlideInit function so this function is imported and there is "grGlideInit" string in the code.
Same for ddraw, ddraw7, d3d8 and d3d9. Always starts from "DirectDrawCreate", "DirectDrawCreateEx", "Direct3DCreate8" and "Direct3dCreate9".
But - is there an easy method to detect the d3d7/d3d6/d3d5/d3d3 initialization (QueryInterface with the IDirect3D7 / IDirect3D3 / IDirect3D2 / IDirect3D parameter)?

Last edited by Gamecollector on 2016-12-11, 17:40. Edited 1 time in total.

Asus P4P800 SE/Pentium4 3.2E/2 Gb DDR400B,
Radeon HD3850 Agp (Sapphire), Catalyst 14.4 (XpProSp3).
Voodoo2 12 MB SLI, Win2k drivers 1.02.00 (XpProSp3).

Reply 1 of 7, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie

D3D1:
DirectDrawCreate() -> IDirectDraw
IDirectDraw.QueryInterface() -> IDirect3D

D3D2:

DirectDrawCreate() -> IDirectDraw
IDirectDraw.QueryInterface() -> IDirect3D2

D3D3:

DirectDrawCreate() -> IDirectDraw
IDirectDraw.QueryInterface() -> IDirectDraw4
IDirectDraw4.QueryInterface() -> IDirect3D3

D3D7:

DirectDrawCreateEx() -> IDirectDraw7
IDirectDraw7.QueryInterface() -> IDirect3D7

D3D8:

Direct3DCreate8() -> IDirect3D8

D3D9:

Direct3DCreate9() -> IDirect3D9

D3D9Ex:

Direct3DCreate9Ex() -> IDirect3D9Ex

D3D10:

D3D10CreateDevice() -> ID3D10Device

D3D10.1:

D3D10CreateDevice1() -> ID3D10Device1

D3D11:

D3D11CreateDevice() -> ID3D11Device

D3D12:

D3D12CreateDevice() -> ID3D12Device

There was never IDirect3D4, 5, or 6.

Reply 3 of 7, by Interlace

User metadata
Rank Newbie
Rank
Newbie

If you're developing a game/program that needs direct3d you can probably use those functions to check if it works, to give an error if it fails, or to even make your own check to see if a card or system supports DirectX12/11/10/etc

Reply 4 of 7, by Gamecollector

User metadata
Rank Oldbie
Rank
Oldbie

@Azarien: you not understood my question.
I know how the intialization of direct3d must be done.
I just want to know - is there an easy method to detect this initialization with any hex editor?
If the game uses DirectDraw7 - it always imports the DirectDrawCreateEx function and always has the "DirectDrawCreateEx" string in the file. And vice versa.
This method not works for IDirect3D7 (a COM interface), CreateDevice and QueryInterface (COM interface methods) etc.

Asus P4P800 SE/Pentium4 3.2E/2 Gb DDR400B,
Radeon HD3850 Agp (Sapphire), Catalyst 14.4 (XpProSp3).
Voodoo2 12 MB SLI, Win2k drivers 1.02.00 (XpProSp3).

Reply 5 of 7, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie

What is it you are trying to achieve with this information?

Are you wanting to check if a binary (dll or exe) uses a specific version of D3D (pre D3D7)? If so, then don't think so, because the D3D function interrogated by string is the same (DirectDrawCreate), the routine checks compatibility by validating the result of a returned interface.

The rest of the interaction with the interface would no doubt be compiled into machine code so you would need some extra skills in the hex editor to find out what the conditionals etc in the code are doing after it 'Queries Interface'. This area of code might be near the function name definition (the char array in the code), but probably not, so much more difficult to locate in a binary via a hex editor. Especially if there is any more business logic surrounding the imported function call. h 😵

Reply 7 of 7, by Scali

User metadata
Rank l33t
Rank
l33t
Gamecollector wrote:

This method not works for IDirect3D7 (a COM interface), CreateDevice and QueryInterface (COM interface methods) etc.

Perhaps your best bet is to find the IIDs for the different interfaces (IDirect3D2, IDirect3D3 etc), and scan for those with a hex editor?
The IIDs have to be in the binary somehow, because they have to be passed as argument to QueryInterface().
Of course that would fall down if a binary includes IIDs for versions of interfaces that it never actually uses. But I wonder if that is ever the case. That would mean that they included IIDs from a newer version of the libraries than the ones they're actually using. Games probably tried to use the latest D3D in those early days (it was purely an API, no specific drivers or hardware features were required until D3D8).

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/