The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: white scorpion on April 11, 2005, 07:22:10 PM

Title: Driver and exe joining
Post by: white scorpion on April 11, 2005, 07:22:10 PM
Hi All,

Currently i'm learning to write kernel drivers (in masm) and i wondered if it was possible to add the driver to the executable which will start it for distribution. meaning:

driver + executable = executable to be distributed.

i've once read it should be possible using the resources but i can't find any documentation about this on the net...
Anyone can help me with this?

Thanks in advance!
Title: Re: Driver and exe joining
Post by: Brett Kuntz on April 11, 2005, 08:31:50 PM
Just add it into the .data section using some built-in masm function that'll let you open a file and auto-convert it to a db format. Then once you have it there, use CreateFile and WriteFile (or whatever) to file output the data into a file, then load it up from there.
Title: Re: Driver and exe joining
Post by: Opcode on April 11, 2005, 09:18:45 PM
Hi,

There is a excellent example inside
the KMDKIT version 1.8 in the sample HiddenDriver.
It is in the path \KmdKit\examples\basic\HiddenDriver
inside the zip file.

Regards,
Opcode
Title: Re: Driver and exe joining
Post by: Opcode on April 11, 2005, 09:19:50 PM
Oops,

You can find the Kmdkit v.1.8 at
http://www.freewebs.com/four-f/   :U
Title: Re: Driver and exe joining
Post by: pbrennick on April 12, 2005, 12:39:42 AM
Adding it as a resource is a nice way of doing it.  four-f sure did a nice job.

Paul
Title: Re: Driver and exe joining
Post by: white scorpion on April 12, 2005, 11:00:24 AM
Thanks for your responses... i have a copy of the KMDkit 1.8 and i know which program you mean, but to be honest i forgot all about it completely.. i think that program is all i need to figure it out... Thanks for reminding me ;-)))

Kind regards!

Mark V.
(White Scorpion).
Title: Re: Driver and exe joining
Post by: thomasantony on April 15, 2005, 04:31:52 AM
Hi,
    Join the file as an RTDATA resource into the file. Then use, FindResource, LoadResource,LockResource, CreateFile, etc. (I don't know how you load a driver file). I have done this with exe files, MIDI files etc. with no problems. :U

Thomas  :U
Title: Re: Driver and exe joining
Post by: hutch-- on April 15, 2005, 09:03:29 AM
If you want to avoid messing around with resources, have a look at the toy I posted a while ago called FDA.EXE. I posted the source for it shortly after. Takes any file including a binary file and creates an object file that you can link directly into your EXE/DLL and write it to disk when you need to do so. If the driver is not particularly large, (< 1 meg) you can use a toy in MASM32 called BINTODB.EXE to convert the binary file into DB format.
Title: Re: Driver and exe joining
Post by: white scorpion on April 16, 2005, 12:13:30 PM
Thomas > i'm already using that, i've done it in an app i released recently, works like a charm :lol:
HiddenDriver from Four-F gave me that solution (as stated above) opcode came with the idea...

Hutch > i can't seem to find that program, all searches on this forum come out empty :(

Title: Re: Driver and exe joining
Post by: pbrennick on April 16, 2005, 12:47:48 PM
White Scorpion,
You can find it in the following topic:

http://www.masmforum.com/simple/index.php?topic=1132.msg8285#msg8285

It is in a zip attached to his post.  I got the same results you got but already knew where it was.  Evidently, searches do not include words in Topics or filenames of attachments.  That is why you could not find it, pretty funny, eh?

Paul
Title: Re: Driver and exe joining
Post by: white scorpion on April 16, 2005, 09:21:34 PM
Thanks for your reply, i will go and check it out :lol:
Title: Re: Driver and exe joining
Post by: thomasantony on April 18, 2005, 03:48:44 PM
Hi,
I found the bintodb.exe file in my masm32 directory :dance: :boohoo: :dance:

Thomas :U
Title: Re: Driver and exe joining
Post by: white scorpion on April 18, 2005, 05:23:14 PM
QuoteIf the driver is not particularly large, (< 1 meg) you can use a toy in MASM32 called BINTODB.EXE to convert the binary file into DB format.
apparently it is there indeed thomasanthony :lol:

i like Hutch's program as well, but i think i will stick to the resources as well since it is more convinient for distribution if you include a batch file which will assemble and link the program.