pasterbig.blogg.se

Winalign 9.0 cd
Winalign 9.0 cd











  1. Winalign 9.0 cd cracker#
  2. Winalign 9.0 cd code#
  3. Winalign 9.0 cd windows#

#pragma comment(linker,"/merge.reloc=.data") #pragma comment(linker,"/merge.text=.data") #pragma comment(linker,"/merge.rdata=.data") If this is desirable, define _MERGE_RDATA_ in your project. rdata section will result in LARGER exe's if you using /Og (global optimizations), /Os (favor small code), /Oy (no frame pointers) padding from 4k to 1/2k, which results in a much smaller exe - anywhere from 20%-75% The "trick" for this is to use the undocumented FILEALIGN linker parm to change the Microsoft's system exes and dlls are not tuned like this, and using 4k causes serious will re-align the programs on this boundary. the virtual memory manager, and that WinAlign (an end-user tuning tool for Win98) The reason (from what I understand) is that 4k is the chunk size of Under VC6, the program instead uses 4k, which is the same as the With Visual C++ 5, the program uses a file alignement of 512 bytes, which results To use this feature, define _MERGE_DATA_ in your project or before this header is used.

winalign 9.0 cd

results with merging the readonly (.rdata) section - the exe may grow larger. Note that if you're using MFC static or some other 3rd party libs, you may get poor strings - padded out, this could be 12k of runtime, for 1094 bytes of stuff! exes, since you could have only 700 bytes of data, 300 bytes of code, 94 bytes of since each section is padded out to 4k chunks. Each section merged can save 4k in exe space,

Winalign 9.0 cd code#

The relocation, read-only (constants) data, and code section (.text) The other two "tricks" are telling the Linker to merge all data-type segments together In one single 500k dll, I managed to cut out 120k by not using the /O1 or /O2 option - if you do, you implicitly use /Gy, which pads The "trick" is to tell the compiler to not pad out the function calls this is done This header file will kick in settings for Visual C++ 5 and 6 that will (usually) That is also available at that link, but here it is. You'll note the "AggressiveOptimize.h" header file included above. HWnd=CreateWindowEx(0,szClassName,szClassName,WS_OVERLAPPEDWINDOW,75,75,320,305,HWND_DESKTOP,0,hIns,0) Īnd here's a link to the article I used to manage this all. Wc.hbrBackground=(HBRUSH)COLOR_BTNSHADOW wc.cbWndExtra=0 Wc.hIconSm=LoadIcon(NULL, IDI_APPLICATION) wc.hCursor=LoadCursor(NULL,IDC_ARROW) Wc.hIcon=LoadIcon(NULL,IDI_APPLICATION) wc.hInstance=hIns Wc.cbSize=sizeof (WNDCLASSEX) wc.style=CS_BYTEALIGNCLIENT|CS_BYTEALIGNWINDOW Wc.lpszClassName=szClassName wc.lpfnWndProc=fnWndProc Int WINAPI WinMain(HINSTANCE hIns, HINSTANCE hPrevIns, LPSTR lpszArgument, int iShow) Return (DefWindowProc(hwnd, msg, wParam, lParam)) Wea.hWnd=hwnd, Wea.lParam=lParam, Wea.wParam=wParam LRESULT CALLBACK fnWndProc(HWND hwnd, unsigned int msg, WPARAM wParam, LPARAM lParam)įor(unsigned int i=0 ihInstance Long fnWndProc_OnCreate(WndEventArgs& Wea)

winalign 9.0 cd

cl Main.cpp libctiny.lib Kernel32.lib User32.lib Gdi32.lib /O1 /FeForm1.exe

Winalign 9.0 cd cracker#

I'm getting the same results whether I use my message cracker scheme with function pointers and the for loop in the WndProc, or the slightly less verbose standard WndProc with switch. However, if you use the technique I'm going to describe next, I've been able to get a VC6 or VC9 GUI template down to 3584 bytes or 4096 on disk. The latest Microsoft compiler I have is VC9, and the executables are pretty large. And of course every new edition of any of the compilers just makes things worse. Even with the old VC 6 its hard to get GUI templates down below 30 K. In terms of exe sizes, I've always had better luck with the older GCC compiler suite than with Microsoft compilers. In my C or C++ work I usually just make sure I'm doing a Release build, I set the compiler to use size optimization, and I flick whatever switches are necessary to remove debug info from the executables.

winalign 9.0 cd

I've always been intrigued by trying to get my programs as small and efficient as possible, but I've never gone to what I'd consider extraordinary pains to do so. But anyway, his posting of that caused me to look into the issue further. I wasn't able to achieve that, but I'm not sure what compiler switches and optimizations he used.

Winalign 9.0 cd windows#

Hutch recently posted a Windows GUI template program in the PowerBASIC forums ( a C program) which he says compiles to 1.5 K.













Winalign 9.0 cd