WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Forum
   Search    Users    Calendar    Board Help  

  Reply to this topicStart new topicStart Poll

Produce an extremely small executable, sized 1 KB, With VC++ 2005 Express Edition

Vortex
Posted: Nov 6 2006, 10:49 AM
Quote Post


Very Active Member
****

Group: Moderators
Posts: 76
Member No.: 8
Joined: 13-May 04


Here is a small VC++ executable coded with VC++ 2005 Express Edition. The size of the final executable displaying a simple dialog box is only 1 KB.

CODE

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

extern char Dlgbox[];

BOOL CALLBACK DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
 {
 case WM_CLOSE:
  EndDialog(hwnd,0);    
  break;
 default:
  return FALSE;
  }
return TRUE;
}

int start()
{
return(DialogBoxIndirectParam(GetModuleHandle(0),(LPCDLGTEMPLATE)Dlgbox,0,DlgProc,0));
}


CODE

cl /c /Oty2 /Zl /Gs /GS- /FoSmallDlg.OBJ SmallDlg.c
link /SUBSYSTEM:WINDOWS /NODEFAULTLIB /ENTRY:start /MERGE:.rdata=.data /MERGE:.data=.text SmallDlg.obj Rsrc.obj kernel32.lib user32.lib


Attached File ( Number of downloads: 30 )
Attached File  SmallDlg.zip

PMEmail PosterUsers Website
Top
Vortex
Posted: Aug 30 2007, 05:16 AM
Quote Post


Very Active Member
****

Group: Moderators
Posts: 76
Member No.: 8
Joined: 13-May 04


Here is an example of building a small C executable with Vista SDK. Depending on your Vista SDK installation, you need to modify Variables.cmd and SetVars.bat to reflect the correct paths.

Attached File ( Number of downloads: 11 )
Attached File  VistaSDKdemo.zip
PMEmail PosterUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll