I want to run a program that needs d3d8.dll. Using winedump I see there are only 5 functions exported.
Yes, but if the program really needs D3D8, just stubbing these function will not help you much... The problem is that D3D (and the whole DirectX) is implemented using COM : there is only a bunch of functions exported from the DLL but that hides a LOT of code as function pointers in the COM object.
So it's definitely NOT trivial to stub (except if you plan to return 'not supported' :-) ).
Lionel