Dark Bit Factory & Gravity

PROGRAMMING => Other languages => ASM => Topic started by: Rbz on March 11, 2009

Title: 1kPack - Packer for Windows 1K intro effects
Post by: Rbz on March 11, 2009
For those into 1kb coding, there's a new method to pack 1kb intros developed by hitchhikr (http://www.pouet.net/user.php?who=5308) that outmatch the public version of crinkler 1.1a.

I did my contribution to this project testing it in 3 different OS's (Win2000/WinXP/Vista) and even with a code that reduced it's size in about 12 bytes, you can check it in the "framework.asm"

Pouet thread:
http://www.pouet.net/topic.php?which=6233&page=3

Download here:
ftp://ftp.untergrund.net/users/hitchhikr/1kpack_v0.6.zip


Quote
1kPack v0.6 - An experimental packer for Windows 1k effects
Written by Franck "hitchhikr" Charlet / Neural

-------

How to use:

All you have to worry about is to insert your code in the framework.asm
file than assemble it with nasm and pack it with 1kpack.

-------

About:

The basic principle is to use the zlib embedded inside each d3dx9 dlls
(via the png library) to depack a compressed stream (tweaked via 7zip).

The depacker/importer/stream header itself is relatively small
as it only takes 220 bytes (including the complete PE structure).

The imported dll (d3dx) is also used to extract the few APIs we need
in order to import the necessary functions to open a window and initialize
DirectX (the provided framework.asm file takes advantage of that
by peeking the functions addresses directly from the dll).

The functions in the framework.asm aren't imported by any hash method
because the code of such importer (+ the hash data) would take more
size than the way it is done now.

The result should work on Windows 2000, XP and Vista and give slightly better
results than the public version of crinkler.

Just keep in mind that this wasn't *thoroughly tested* & is *experimental* software.

f.
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Rbz on March 11, 2009
New v.0.7 is out:
ftp://ftp.untergrund.net/users/hitchhikr/1kpack_v0.7.zip
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Jim on March 14, 2009
The test didn't work on a clean install of Windows 7, for some reason it doesn't have any historic versions of d3dx9 dll installed.  I'll need to see what happens if I install the dx redist.

Jim
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Rbz on March 14, 2009
I hope it works on Win7 :)

Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Shockwave on March 15, 2009
Fucking crazy crunching the whole PE structure down to such a small size, it really is great.
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: va!n on March 15, 2009
Tested on public 64 bit beta version of Win7 with installed latest DX9 redis pack... Crashes here with an init error (0xc0000017)!
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Rbz on March 16, 2009
New version 0.9:
http://pagesperso-orange.fr/franck.charlet/1kpack.zip

Tested on public 64 bit beta version of Win7 with installed latest DX9 redis pack... Crashes here with an init error (0xc0000017)!
That's bad, more work to hitchhikr then :)
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Jim on March 16, 2009
Downloading the redist gets me the dll I need :)
It crashes, still, but that could be down to the nature of the actual test code - what is it trying to do?

Nevertheless it's a great bit of work.  I'm curious as to why the zip lib from directx is used...I think there are at least 2 more instances of it in the shell32.dll (explorer zip folders) and in the .net runtime libraries which might also be made to work.

Jim
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Rbz on March 17, 2009
Quote
It crashes, still, but that could be down to the nature of the actual test code - what is it trying to do?
Jim, test app just open and fill screen with a white color.

Quote
I'm curious as to why the zip lib from directx is used...
Because it got all necessary zlib functions to unpack the intro and plus LoadLibrary/GetProcAddress, which is used to retrieve other functions address, like in user32.dll / d3d9.dll / kernel32.dll, not to mention that you got all functions to compiler your shader program.

It use absolute offsets into d3dx9_30.dll which could be the problem with windows 7 or perhaps something changed in the win7 exe loader.

Btw, can you check if your Win7 d3dx9_30.dll file is the same used on WinXP ?
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Jim on March 17, 2009
If you make a test app that just does 'ret' we can see if it's the compressor or the OS.
I think :)

Jim
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Rbz on March 17, 2009
Jim, check this one, it should load and exit.

What error message you got, is this one ->  "Not a valid Win32 Application", if yes, I think the problem is with the new win7 exe loader :/
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Jim on March 18, 2009
The excellent news is that one works :)   The error with the previous tests was definitely a crash, not an invalid exe.

Jim
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Rbz on March 20, 2009
Nice :)
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: Rbz on March 01, 2010
It is now compatible with windows 7, anyone able to test it?

http://www.pouet.net/prod.php?which=52796

http://pagesperso-orange.fr/franck.charlet/1kpack.zip
Title: Re: 1kPack - Packer for Windows 1K intro effects
Post by: maracuja on May 11, 2011
Cuuuuuttte !