How to directly write to the frame buffer in windows driver

Actually, even if he is writing a “secret” message from the kernel, it
isn’t secret. PrintScreen should capture it to the clipboard, at which
point I would paste it into Paint, analyze it, and some small number of
minutes later have a user app that spoofed the message. I could also
capture it from the desktop DC using a program.

The fact that this can be “done” in linux proves nothing; I suspect a
couple linux security experts I know could both spoof te message and
capture the message with about the same effort I would use in Windows.

Managers are very good at saying, “I once did this in name here> and therefore I see no reason you can’t do it in system name here>”. This can generally be understood to be a demostration
of their competence to deal with obsolete systems, and should not be
construed as demonstrating that it can be done in anything resembling a
real system.

For example: does the linux code run strictly on a linux console, or does
it run under X-windows? I could do things in MS-DOS (like build device
driver code and interrupt handlers into apps, reprogram the counter/timer
chip, etc.) that I have not been able to do since I started using Windows,
and, frankly, I don’t miss these. I used to be able to reprogram the
bitmaps of the VGA character generator to support international fonts, and
now I have Unicode, which is vastly superior.

So what are we comparing here? A 1960s operating system on 1980s
hardware, or a 2012 operating system hosted on 2012 hardware?

It should be well-known that the A00000 address is dead. It has been for
decades. The fact that someone could once do this using antique equipment
(such as a display card in VGA mode) only proves that this person knows
how to program dead hardware. Not interesting. Except possibly as a
metric demostrating questionable skill levels.
joe
> xxxxx@gmail.com wrote:
>> Actually my driver wants to show the secret message on the screen,
>> telling the user that the protection starts. And i also want the user
>> space application cant get this message in case that the application can
>> fake this message.
>
> That doesn’t make any sense. It’s actually EASIER for a user-mode
> application to write to the screen than it is for a kernel driver. A
> user-mode app can just do GetDC(0) and TextOut to draw anywhere on the
> desktop. You cannot prevent that.
>
>> My senior has successfully display the message with Linux, and the
>> physical address he use is 0xA0000. I have checked the physical address
>> of my graphics with device manager, and i discovered that it has 4
>> memory regions, one region is 0xA0000~0xBFFFF.
>
> Your “senior” is using a console, not a hi-resolution graphics screen.
> Take a few minutes to think about this logically, will you? Say your
> desktop is 1024x768 true color. That’s a 3MB frame buffer. How do you
> think that’s going to be squeezed into a 128kB region in low memory?
>
>> By the way, do you have any suggestions on how to do this? I only want
>> to display the secret message on the screen in the kernel space, the
>> user space can’t get this information.
>
> If you need to display messages to the screen, write a user-mode service
> that gets signals from your driver. You do need to be aware that
> anything you write to the screen can be spoofed by an application. I
> would HOPE that was obvious.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

I’ve built a lot of server-style applications over the years, from IBM
mainframes onward. One thing I learned from the IBM experience
(1967-1970) was that relying on “the operator” was always a mistake.

The IBM instruction set was so rich and baroque that it was easy to
parody. The parodies included such lovely instructions as HCF (halt and
catch fire) BPO (branch if power off) and BOA (branch if operator asleep).
And BHC (branch and hang CPU).

I worked with someone who programmed a machine with a genuine BPO
instruction. You executed it in the non-maskable interrupt handler, and
you had 20ms of reserve power in the capacitors to do something.
joe

What are you going to do for systems without the hardware? Over the
years I have cursed idiots who do this, since you can have headless
windows with no display. For that matter what will you do with “lights
out” operations? I know of a software company whose clever software put
up a display on a server, and hung waiting for input in certain special
cases, a large firm bought the software and only got the problem on one
server in a field office, that typically did not have a keyboard, mouse
or monitor even connected and no on site IT guy. The firm sued the
software company when they found the “feature” and demanded their money
back.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@gmail.com” wrote in message
> news:xxxxx@ntdev:
>
>> I am writing the driver that can directly write data to the frame
>> buffer, so that I can show the secret message on the screen while the
>> applications in user space can’t get it. Below is my code that trying to
>> write the value to the frame buffer, but after I write the value to the
>> frame buffer, the values i retrieved from the frame buffer are all 0.
>>
>> I am puzzled, anyone knows the reason? Or anyone knows how to display a
>> message on the screen while the applications in the user space can’t get
>> the content of the message? Thanks a lot!
>>
>> #define FRAME_BUFFER_PHYSICAL_ADDRESS 0xA0000
>> #define BUFFER_SIZE 0x20000
>>
>> void showMessage()
>> {
>> int i;
>> int *vAddr;
>> PHYSICAL_ADDRESS pAddr;
>>
>> pAddr.QuadPart = FRAME_BUFFER_PHYSICAL_ADDRESS;
>> vAddr = (int *)MmMapIoSpace(pAddr, BUFFER_SIZE, MmNonCached);
>> KdPrint((“Virtual address is %p”, vAddr));
>>
>> for(i = 0; i < BUFFER_SIZE / 4; i++)
>> {
>> vAddr[i] = 0x11223344;
>> }
>>
>> for(i = 0; i < 0x80; i++)
>> {
>> KdPrint((“Value: %d”, vAddr[i])); // output are all zero
>> }
>> MmUnmapIoSpace(vAddr, BUFFER_SIZE);
>> }
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

>The IBM instruction set was so rich and baroque that it was easy to parody.

I used to work with PDP-11/LSI-11 soviet-made clones. They had MARK command. I’d be lying if I said I was able to understand its purpose.