Reading framebuffer at lowest level possible under X

Go To StackoverFlow.com

1

I want to read the framebuffer of the videocard at the lowest level possible for a security application I'm writing.
I want to be as sure as possible that what I'm reading is exactly what will be finally put on the bits of the hardware lighting the pixels of the screen,
and that no software layer is in the middle (or at least I want to have the lowest number possible of layers in the middle).

I've seen it's pretty easy to use X to grab the screen in a precise moment, but that call is still passing through the X server.
I would like to have something really more low level, even if this means messing up with some ioctl with the video card.
I've seen the existence of DRI and DRI2, but they are very very badly documented, especially the latter.
I can't really understand how they work. Do you have any idea, reference or starting point for a good research?

Anything would be appreciated!

2012-04-05 15:37
by O'Blivion
Be aware that in the case of certain types of overlay graphics (video in particular), the images may never actually be written into what you'd probably identify as "the framebuffer" but are just composited into the stream being output from the card. (This is the origin of lots of people complaining about various screen capture things just capturing a blank for their media player windows). Not sure how much that impacts what you're trying to do but it may be something to consider - timday 2012-04-12 21:27


0

I'm not sure how much reading the framebuffer will help you (even disregarding the issue pointed out by timday in his comment, deciding whether what you read there is what you want it to be may not be very easy), but if you are doing this on Linux you could map the kernel framebuffer devices, possibly using DirectFB to help you. Alternatively, if you are on a non-Linux PC platform you could use VESA (take a look at the VESA code in X.Org and the X.Org VESA driver (the actual code is split between the two). Be aware that you will probably also have some fun with things like multi-monitor setups.

2012-05-25 13:58
by michaeljt
Ads