Author Topic: [IN PROGRESS] 512b GDI FrameWork  (Read 8043 times)

0 Members and 1 Guest are viewing this topic.

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
[IN PROGRESS] 512b GDI FrameWork
« on: March 19, 2011 »
Heres a gdi based 512b framework I've been working on. I haven't done much header mangling yet but I've marked out most of the feilds that are safe to play with on my system. It would be a great help if some people could test to see if I have already broken the clean version and if the dirty version is too optimistic. If all goes well you should see a greyscale.

Using this framework I hope to be able to release win32 demos on par with the average 128b DOS releases.

Edit 1 - (OLD) Added current version (352 bytes) tested only on XP
Edit 2 - (OLD) Added example of raycasting in 512 bytes
Edit 3 - (OLD) version 347b
Edit 4 - Latest version 295b
« Last Edit: August 09, 2014 by rain_storm »

Challenge Trophies Won:

Offline LittleWhite

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 418
  • Karma: 31
  • It's me!
    • View Profile
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #1 on: March 19, 2011 »
At first look, it will not run on Windows 64bits ? (I just guessing since I don't have a Windows actually)

Secondly ... can you give information on how to compile ... or maybe you don't want us to reuse it ? :D (I am not use to ASM ... so I guess it's MASM with some option simply)

I will try to test it soon, but I think it's a great job (It has to be great it's ASM :D)
The demoscene will never die, never!

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #2 on: March 19, 2011 »
Both versions run fine on XP (32 bit).
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17374
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #3 on: March 19, 2011 »
It wont run on Windows 7 64 bit here either which is no surprise to me.

I know that I could run it under dosbox, but you know, I feel that <1kb dos intros are fantastic.  With people moving over to systems that have no native support for VGA modes, <1kb dos intros will probably become an even more exclusive art.

Do any of the dos display modes work with 64 bit windows?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2696
  • Karma: 483
    • View Profile
    • http://www.rbraz.com/
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #4 on: March 19, 2011 »
@Rain: Both .exe's doesn't work here on Windows 7 32 bits, dirty.exe crashes with "invalid win32 application" and "gdi_fw_512b.exe" just load and exit without any error message.

I'm not sure, but maybe you can find some help looking in 1kpack pe fix for win7.
Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #5 on: March 19, 2011 »
I thought I did post it on here but to my surprize....it isnt ....I have to post again....

It wont run on Window 32bit :(....does it mean have to run in old window or dosbox?  ???

Offline LittleWhite

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 418
  • Karma: 31
  • It's me!
    • View Profile
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #6 on: March 19, 2011 »
I guess it will run in Windows XP 32 bits (nearly only ... or at least ... only on older thing (did you trash your pentium II ? :D) ... so ... we have to set our Virtual Machines :p
The demoscene will never die, never!

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #7 on: March 19, 2011 »
I might be taking you guys up wrong but I get the impression that half of you think this is a VGA demo. Its not DOS its a Windows framework using gdi32 to render to a pixel buffer.

To compile you need to use the latest version of FASM. No commandline switches necessary.

When Vista decided to drop all pretences of backwards compatibility with VGA I decided I had to take a new approach at the microscopic categories. This is what I came up with. Software rendering in 512b without the 200 byte overhead that a decompressor requires.

@rbz: Its definately not the DLLCharacteristics I made sure of that, it must be the way the PE and Optional headers are overlapped.

I used the tinype template which was designed to simply get the header as small as possible. Theres plenty of spare bytes to use for code / data but they're spread out all over the place, trying to make use of dead bytes in this headers is like trying to fill a bucket using a thimble. (!practical)

I'm gonna have to take a deeper look at crinklers file header. Its obviously the way to go if you want to use as many of those dead bytes as possible.

Edit : Just found out that on Windows 7 theres an extra loophole to jump through in order to import by hash. But its not even getting that far. So this problem is a 64 bit issue.
« Last Edit: March 19, 2011 by rain_storm »

Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 977
  • Karma: 258
    • View Profile
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #8 on: March 19, 2011 »
Works fine on Windows XP Home 32 Bit with NVidia GeForce.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17374
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #9 on: March 19, 2011 »
Do you think it can be made to work for 64 bit without too much of a file size overhead ?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #10 on: March 19, 2011 »
I'm gonna pump Crinkler for the information I need to make this work. Thats one thing you learn from programming 256b dos, reverse engineering such a small prod is a piece of cake. Reversing a 1kb crinkler file header should be no match for me.

Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #11 on: March 22, 2011 »
Okay I managed to get step 1, windows 7 version of get kernel32 image base, done in the first 49 bytes of a crinkler style header. I need to find out if this runs on Vista / Windows 7 before I can make any further progress. Again its a grey scale image that Im hoping you will see.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17374
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #12 on: March 22, 2011 »
Sorry to report that it won't run on my box (Windows 7 64 bit), both as is and in compatibility mode.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1393
  • Karma: 108
    • View Profile
    • http://www.secretly.de
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #13 on: March 22, 2011 »
@rainstorm:
Dont work on Win7! Afaik retrieving the adress of kernel32.dll dont work under Windows7! For Windows 7 it will give back the adresss of the KernelBase.dll - maybe this helps you to fix your framework for Windows7.

[Edited - added:
I am sure this is something for you:
http://blog.harmonysecurity.com/2009/06/retrieving-kernel32s-base-address.html
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2696
  • Karma: 483
    • View Profile
    • http://www.rbraz.com/
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #14 on: March 22, 2011 »
Indeed, it's not working on win7, too bad, I can't help you now, I'm very busy trying to code a destructive intro for dbf compo.
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #15 on: March 23, 2011 »
@va!n Yeah I caught that one. I'm using the updated version that walks the PEB it's suppose to work on 2K -> Windows 7

Looks like I'm gonna have to beg the brother in law to let me commandeer his PC this week. Just out of interest is anyone getting a "not a valid win32 executable" error? or is it just crashing silently?

Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1393
  • Karma: 108
    • View Profile
    • http://www.secretly.de
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #16 on: March 23, 2011 »
@rain_storm:
Here at Win7 x64 it crashes and a system requester appears with following detailed infos:

Code: [Select]
Problemsignatur:
  Problemereignisname: APPCRASH
  Anwendungsname: pe_01.exe
  Anwendungsversion: 0.0.0.0
  Anwendungszeitstempel: 30408b64
  Fehlermodulname: pe_01.exe
  Fehlermodulversion: 0.0.0.0
  Fehlermodulzeitstempel: 30408b64
  Ausnahmecode: c0000005
  Ausnahmeoffset: 00010014
  Betriebsystemversion: 6.1.7601.2.1.0.256.1
  Gebietsschema-ID: 1031
  Zusatzinformation 1: 0a9e
  Zusatzinformation 2: 0a9e372d3b4ad19135b953a78882e789
  Zusatzinformation 3: 0a9e
  Zusatzinformation 4: 0a9e372d3b4ad19135b953a78882e789

Lesen Sie unsere Datenschutzbestimmungen online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0407

Wenn die Onlinedatenschutzbestimmungen nicht verfügbar sind, lesen Sie unsere Datenschutzbestimmungen offline:
  C:\Windows\system32\de-DE\erofflps.txt
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #17 on: March 23, 2011 »
Thanks va!n that means that its executing so the header is getting my foot in the door. I neglected to zero eax.

Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1150
  • Karma: 174
    • View Profile
    • Raizor's Dev Blog
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #18 on: March 23, 2011 »
rain_storm

pe_01.exe crashes silently for me on Win7 x64. I've tried it with various compatibility settings and the result is the same.
raizor

Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: [IN PROGRESS] 512b GDI FrameWork
« Reply #19 on: March 24, 2011 »
Thanks for testing guys, I've managed to get hold of a 64bit Windows 7 system and tested a few versions.

With a standard header and an import section it works perfect. Then I tried a version that imported by hash with a mangled header... it runs, creates a fullscreen window, All you see is a little white bar across the top of the screen. And it exited cleanly on escape key down. It doesn't bitblit to the screen.

I've seen this symptom before its got to do with either GetClientRect or StretchDIBits. I think I'm getting hash collisions on one of those. If its GetClientRect then I can just use GetWindowRect but otherwise I'm going to have to change my hash meathod.

I hate to ask but if I can get a test of this it would really mean a lot to me.

Challenge Trophies Won: