Getting into 4k demo making
category: code [glöplog]
I hacked together a quick proof-of-concept implementation of iq's "hook into DSound" idea by modifying kkapture. I disabled all the actual capturing; regardless of what you select in the GUI, the demo will always run normally, except that the DSBCAPS_TRUEPLAYPOSITION flag is injected in IDirectSound8::CreateSoundBuffer.
Source: https://github.com/kajott/kkapture/tree/dsfix-poc
Diff: https://github.com/kajott/kkapture/commit/7268fe5c76243601fda9295c24f924fe806016ad
Binary: https://www.emphy.de/~mfie/foo/dsfix-poc.zip
Caveats: 32-bit and DirectSound8 only at the moment
It would be nice if somebody could confirm whether this approach works. My system here plays fr-08 smooth as butter without any intervention, so I can't see a difference.
Source: https://github.com/kajott/kkapture/tree/dsfix-poc
Diff: https://github.com/kajott/kkapture/commit/7268fe5c76243601fda9295c24f924fe806016ad
Binary: https://www.emphy.de/~mfie/foo/dsfix-poc.zip
Caveats: 32-bit and DirectSound8 only at the moment
It would be nice if somebody could confirm whether this approach works. My system here plays fr-08 smooth as butter without any intervention, so I can't see a difference.
I just run fr-08 natively, and I couldn't not feel any stuttering neither. It could still be there, but I'm usually pretty sensitive to these things...
BUT, actually Windows 10 (Pro 10.0.19043) automatically run Compatibility Settings on the the intro for me. When I run the intro, it showed me a dialog letting me know that things were being patched for the execution. So maybe they are already doing the DSBCAPS_TRUEPLAYPOSITION for us after all, and maybe that's why I couldn't see any stuttering?
Related, after the demo run I was able to right click on it and see the "Compatibility" tab (between "General" and "Security") which I've never noticed before, and there I can pick whether I want to run fr-08.exe in Windows XP SP2 mode, Windows XP SP3 mode, Windows Vista mode, etc etc.
, which is neat. But again, I never noticed this tab before.
BUT, actually Windows 10 (Pro 10.0.19043) automatically run Compatibility Settings on the the intro for me. When I run the intro, it showed me a dialog letting me know that things were being patched for the execution. So maybe they are already doing the DSBCAPS_TRUEPLAYPOSITION for us after all, and maybe that's why I couldn't see any stuttering?
Related, after the demo run I was able to right click on it and see the "Compatibility" tab (between "General" and "Security") which I've never noticed before, and there I can pick whether I want to run fr-08.exe in Windows XP SP2 mode, Windows XP SP3 mode, Windows Vista mode, etc etc.
![BB Image](https://iquilezles.org/trastero/comp.png)
Good point with the compatibility mode, I'll re-check.
By the way, the fact that fr08v101.exe doesn't show the usual "it has been packed with kkrunchy, it's malware!!!11" warning and even has compatibility mode enabled by default may be a sign that fr-08 made it onto Microsoft's "old programs we should not break" list. Congratulations!
By the way, the fact that fr08v101.exe doesn't show the usual "it has been packed with kkrunchy, it's malware!!!11" warning and even has compatibility mode enabled by default may be a sign that fr-08 made it onto Microsoft's "old programs we should not break" list. Congratulations!
fr-08 predates kkrunchy; it's packed with a modified version of UPX.
FWIW, that tab has been there since at least Windows XP (maybe even 2000?) and is available for any executable, no matter if you have run it before or not.
Quote:
fr-08 predates kkrunchy; it's packed with a modified version of UPX.
Well, about that ...
Code:
00000000 4d 5a 66 61 72 62 72 61 75 73 63 68 50 45 00 00 |MZfarbrauschPE..|
00000010 4c 01 03 00 15 03 76 3a 00 00 00 00 00 00 00 00 |L.....v:........|
00000020 e0 00 0f 01 0b 01 06 00 00 00 01 00 00 10 00 00 |................|
00000030 00 90 31 00 b0 96 32 00 00 a0 31 00 0c 00 00 00 |..1...2...1.....|
00000040 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 |..@.............|
00000050 00 00 00 00 04 00 00 00 00 00 00 00 00 b0 32 00 |..............2.|
00000060 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 |................|
00000070 00 10 00 00 00 00 10 00 00 10 00 00 00 00 00 00 |................|
00000080 10 00 00 00 00 00 00 00 00 00 00 00 f8 a1 32 00 |..............2.|
00000090 30 01 00 00 00 a0 32 00 f8 01 00 00 00 00 00 00 |0.....2.........|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000100 00 00 00 00 72 79 67 73 20 61 6e 64 00 90 31 00 |....rygs and..1.|
00000110 00 10 00 00 00 00 00 00 00 02 00 00 74 6f 72 75 |............toru|
00000120 73 27 20 65 78 65 20 00 80 00 00 e0 70 61 63 6b |s' exe .....pack|
00000130 65 72 2e 20 00 00 01 00 00 a0 31 00 00 f8 00 00 |er. ......1.....|
00000140 00 02 00 00 66 61 72 62 72 61 75 73 63 68 21 00 |....farbrausch!.|
00000150 40 00 00 e0 2e 72 73 72 63 00 00 00 00 10 00 00 |@....rsrc.......|
00000160 00 a0 32 00 00 04 00 00 00 fa 00 00 66 61 72 62 |..2.........farb|
00000170 72 61 75 73 63 68 21 00 40 00 00 c0 00 00 00 00 |rausch!.@.......|
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001d0 00 00 00 00 00 66 61 72 62 72 61 75 73 63 68 00 |.....farbrausch.|
000001e0 32 30 30 31 0c 09 09 0a c8 c7 5f 6f d5 81 85 a5 |2001......_o....|
OK, I just noticed what you actually meant ... a modified version of UPX, and indeed it looks like it was modified to a point that the output EXE bears not much resemblance to either UPX nor later kkrunchy.
Sorry for the misunderstanding, Sesse!
Sorry for the misunderstanding, Sesse!
I tried to search the BBS but failed.
Anyone tried ziglang for sizecoding?
Anyone tried ziglang for sizecoding?
IIRC ryg mentioned those LZ based packers. Also some kkrunchy variants before the latest versions did LZ compression. But mentioning it.. I never had a look at the decompressor...