📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  Convert kernel object to usermode handle

Topic created on: September 3, 2008 09:14 CDT by Blurk .

Hello!
This might be a silly question..
But i wonder, is it possible to Convert Kernel objects to Usermode handles?
Lets say, i hook an usermode app that calls KeSetEvent and i want to use NtSetEvent instead, like this:


LONG
NTAPI
MyKeSetEvent (
    PKEVENT Event,
    LONG Increment,
    BOOLEAN Wait
)
{
    NTSTATUS Status = NtSetEvent((HANDLE)Event, NULL);  // Umm..

    if(!NT_SUCCESS(Status)) {
        print("NtSetEvent Failed! Status = 0x%.08X\n", Status);
    }

    return Something;  // ?
}


Would that be possible in some way?

NOTE: This is just "Psuedo-talk", it ain't true in "real life"!!
      I Know it's impossible for an user mode app to call KeSetEvent,
      But here, let's say it's possible.

So, if it's possible in some way, How to do it?

  Blurk   September 12, 2008 22:02.11 CDT
Wow! this thread was quite popular [irony] :p

I'll explain a little better:

I Currently work on the open source xbox emulator, Cxbx
and i've done quite some progress on it!
But there's a few things that stops me from here on, like, for example, the example i gave above.

So, how is it possible to "convert" eg PKEVENT struct to a handle so i can use it with NtSetEvent?

In case you are interested:
I've got Avalaunch to run quite good (Yes, the dashboard)
File browsing work pretty good, and disk space is correctly showing. +++..
I've also got Buffy to run and Reboot function to work! ;)
Also, a bunch of samples work pretty good.
Fahrenheit is also showing up now, but goes in a infinite loop after the menu (working on it..).
And also nearly there with a bunch of other games.
A bunch of HLE db's are also added, parameters fixed, structs fixed etc..+++..

I'll talk to caustik and post on cxbx forums after i've sorted out a few more things.

So, help me to get stuff better here please ;)
C'mon! where did the Pro's go? :p

  moyix   October 17, 2008 00:42.42 CDT
Take a look at ObInsertObject. It takes a kernel object and inserts it into the handle table of a process, and fills in the passed-in handle argument with a handle to that object. It's reserved for system use, so don't blame MS if you shoot yourself in the foot with it ;)

  Blurk   October 17, 2008 11:28.44 CDT
Thank you for your reply! :)

Yes, that's true. But then i'll have to create a driver.
I Was hoping to avoid that.
Isn't there any way around?
I don't mind if it's ugly or messy, as long as it'll work. ;)

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit