Question for the .LIB or .OBJ guys

Everything else that doesn't fall into one of the other PB categories.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Question for the .LIB or .OBJ guys

Post by Codemonger »

OK I'm a virgin when it comes to lib's or obj's. I don't know anything about the subject, so if this doesn't make sense, then oh well. I was wandering if you could change the symbols ?? or the function names ??

the reason I ask, is I would like to convert some premade lib's to PB user libraries. These lib's are not mine and I do not have the source. Could I use a dissasembler to change the names of the functions ? I'm guessing it's much more complex.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Post by Danilo »

LIBs are libraries. A .lib is a container/archive, and in the .lib
are the .OBJect files.
You can extract the .OBJs with LIB and disassemble the objects
then, thats right.

Want to do that with the MS DirectX9 Libs? Dont do that.
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

Actually I just wanted to do it with the D3DX helper library ... as their texture routines handle volume and cube textures. The math routines are easy because the SDK outlines the formulas used, so I have been converting those manually to PB code.

I am trying to rid the use of the d3dx.dll. It is only the texture functions I am interested in. The DX libs are distributed for anyone to use, except PB only uses self written .libs so I can't integrate them as PB commands :cry: , anyway not the end of the world. Thanks Danilo.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Post by Danilo »

The problem is the PB linker, because it handles only OMF objects
but the DX libs are COFF Objects.

If you want to write a commercial 3D-Engine, i would suggest
you to use MSVC++ or the Intel C++ compiler.
PB cant compete with the speed optimizations these compilers
can do, especially the Intel compiler.

If you write your Engine as a .DLL, you can use it with every
language out there - even better.

Anyway... if you want to use PB, whats the problem to use
the D3DX.DLL ??
Calling a function in a DLL with CallFunctionFast shouldnt be slow
because it calls the function in the DLL directly.

Disassemble stuff to include it in your own work is a no no anyway,
but i think you know that yourself. Dont be lame.
(and its illegal in many countries...)
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

The only problem is distributing a dll with the engine, which isn't a huge problem, but can be annoying. Otherwise CallFunction fast is really fast ... fast enough anyways. As far as C++ goes, I personally can't stand C++. I think I have a C++ learning disability. I would rather use PB, I consider it C-Basic :lol:
Disassemble stuff to include it in your own work is a no no anyway,
but i think you know that yourself. Dont be lame.
(and its illegal in many countries...)
It is pretty lame, but the d3dx .lib is free to include in your projects anyway. I know you should not change the .lib's, but I just wanted to add the PB extension on the functions due to PB's standard for user libraries. Sort of a gray area. I guess it would be the same as changing the name of a DLL, not really illegal, but not really legal ??
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Post by Danilo »

Codemonger wrote:The only problem is distributing a dll with the engine, which isn't
a huge problem, but can be annoying.
What about compressing it and including it in the .EXE?
Codemonger wrote:It is pretty lame, but the d3dx .lib is free to include in your
projects anyway. I know you should not change the .lib's,
but I just wanted to add the PB extension on the functions
due to PB's standard for user libraries.
You have to assemble it to OMF objects then. Dont forget the
D3DX.lib depends on some other libraries too. Good luck!
Codemonger wrote:Sort of a gray area. I guess it would be the same as changing
the name of a DLL, not really illegal, but not really legal ??
The DLL that comes with the DirectX SDK is only the DEBUG version.

Somebody compiled all the D3DX functions in a .DLL, so you can
use it with PureBasic, Borland Compilers etc...

You can find the DLL on this site: http://clootie.narod.ru/ (slow site, but nice stuff!)
The D3DX9ab.dll is: http://clootie.narod.ru/delphi/DX90/Clo ... 0_dlls.zip

I´ve used this DLL with PB and it works fine.... also compressed
with UPX.
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
Seldon
Enthusiast
Enthusiast
Posts: 405
Joined: Fri Aug 22, 2003 7:12 am
Location: Italia

Post by Seldon »

What is that DLL from russian site meant for ? Doesn't DirectX DLLs come with the DirectX/3D package/archive ?

There is a tool that converts a DLL in a COFF object.. are you sure it can't be used with PB ? Why at the beginning of the assembly file generated by PB is written then : format MS COFF :?: Just curious.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

Seldon wrote:What is that DLL from russian site meant for ? Doesn't DirectX DLLs come with the DirectX/3D package/archive ?

There is a tool that converts a DLL in a COFF object.. are you sure it can't be used with PB ? Why at the beginning of the assembly file generated by PB is written then : format MS COFF :?: Just curious.
Microsoft DirectX does not come with a pre-built D3DX dll (DirectX helper functions). You have to build one using the .lib files and a dll skeleton. Normally you would include it in your C++ project, so it would be compiled with your code.

Danillo was saying that the format of the DirectX Libs/objs are MS COFF format and the format that PB uses for user libs/objs is OMF (Intel Format). So I would first have to convert the COFF to OMF format and then do what I wanted to do.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Seldon
Enthusiast
Enthusiast
Posts: 405
Joined: Fri Aug 22, 2003 7:12 am
Location: Italia

Post by Seldon »

Thank you.. I am really not into Direct-X world.

Ok.. the OMF is used for Libs, but the main PB object seems to be COFF, so it should be possible to include a COFF object in a project done with PB, declaring the extern functions on the PB generated assembly file and passing the COFF object to Lcclnk (this feature will be added in next release of PB-Compiler).
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

That sounds like it would work for what I want to do, but I don't know how to add external functions in assembly (don't know assembly)... I'll have to look it up.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Post Reply