Re: Dynamically loading binaries in Kernel mode.
- From: Luis Miguel Huapaya <LuisMiguelHuapaya@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Mar 2006 09:17:02 -0800
Well, we've considered the "separate driver" solution, but it will not do the
trick for the goals we have in mind. So without too many details here is what
we need to achieve:
1) Allocate kernel level memory (system memory) that is big enough to
receive the binary image (and related static data) of the dynamic code that
we want to run.
2) Load the code into memory. I won't get into details, but we can't have
the kernel level code reading it from disk.
3) Do whatever address fixups, etc.. required before "executing" the code.
4) Execute the code.
Our dynamically linked code would publish a GetProcAddress() type function
capable of reporting back on the entry points of every other function in the
dynamic code. The GetProcAddress() function would undoubdetly be at a fixed
offset in the binary code. We would have to figure a mechanism to report back
on other functions in the binaries based on the load address.
The dynamic code must be loadable/unloadable on demand.
I can't think of any other way to achieve our intended goal. It sucks
because I prefer simple solutions, but in this particular case, I don't think
there is any other choice.
cheers,
Luis Miguel Huapaya
"Don Burn" wrote:
Actually, the group will answer the question without going into the details.
of you project. What we are looking for are the goals of you need to load
binaries. There are a number of solutions including do not do that, but
without understanding the reasoning behind the need a lot of us find we are
helping people shoot the system in the foot.
For instance in you situation, there are multiple methods you can use,
kernel mode DLL's, a seperate driver with an interface handled in many ways,
etc. The problem is that many people come to us with "I want to do X, how
can I accomplish it", when if they stepped back one level the answer is "Use
standard mechanism A".
A common example of this are people asking many different ways to have the
driver communicate with the application. Once we understand that the
question "how do I map a user space code section into the kernel?" is really
"how do I call up to an application with an action to do?" the answer
becomes obvious.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
"Luis Miguel Huapaya" <LuisMiguelHuapaya@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:52930D30-4618-4C8B-BDEF-6BE5FDE193C5@xxxxxxxxxxxxxxxx
Hi again,
I understand where you are coming from. Unfortunately there are legal
reasons pertaining to ongoing patent work that would prevent me from
disclosing the reasons why we (I) need to dynamically load code at the
kernel
level. It's unfortunately one of those situations where telling anyone
about
our master plan basically screws us :-)
So it sounds to me like I need to take this offline with a consultant, get
an NDA signed and proceed with some technical questions since for the most
part, the participants on this forum feel ill at ease with answering my
questions without prior full disclosure (which won't happen anytime soon).
cheers,
Luis Miguel Huapaya
- Follow-Ups:
- Re: Dynamically loading binaries in Kernel mode.
- From: Carl Woodward
- Re: Dynamically loading binaries in Kernel mode.
- From: Ray Trent
- Re: Dynamically loading binaries in Kernel mode.
- References:
- Re: Dynamically loading binaries in Kernel mode.
- From: Tim Roberts
- Re: Dynamically loading binaries in Kernel mode.
- From: r_konjeti
- Re: Dynamically loading binaries in Kernel mode.
- From: Mark Roddy
- Re: Dynamically loading binaries in Kernel mode.
- From: Luis Miguel Huapaya
- Re: Dynamically loading binaries in Kernel mode.
- From: Don Burn
- Re: Dynamically loading binaries in Kernel mode.
- Prev by Date: Re: Windows XP x64 and WM_DEVICECHANGE
- Next by Date: Re: Wdf Workitem
- Previous by thread: Re: Dynamically loading binaries in Kernel mode.
- Next by thread: Re: Dynamically loading binaries in Kernel mode.
- Index(es):
Relevant Pages
|