1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
#include <windows.h>
#include "Code.c"
#include "defined.h"
char GetMachineCode[2048];
char Little_Trick[2];
int i = 0;
char *_8digit, _Bin[7];
FILE *_export_exe, *_bin_source_code;
char *registers = "00000000 ax => MOV AX,something => B8 something AX\n"
"00100000 cx => MOV CX,something => B9 something CX\n"
"01000000 dx => MOV DX,something => BA something DX\n"
"01100000 bx => MOV BX,something => BB something BX\n"
"10000000 sp\n"
"10100000 bp\n"
"11000000 si\n"
"11100000 di\n";
char *BIN_EXAMPLE = "\n10111000\n" // MOV B8
"00010011\n" // 13h
"00000000\n" // AX register
"11001101\n" // INT
"00010000\n" // 10h
"10110100\n" // MOV B4
"00000010\n" // 02h write a character on screen
"10110010\n" // MOV B2
"01000001\n" // A
"11001101\n" // INT
"00100001\n" // 21
"10111000\n" // MOV B8
"00000000\n" // 0
"00000000\n" // AX register
"11001101\n" // INT
"00010110\n" // 16
"11001101\n" // INT
"00100000\n" // 20
"\nshow 'A' on screen\n"
"\nCreated By :\nThe Hidden Ghost\n";
/* Display A Character On Screen in Assembly Code :
MOV AX,13h
INT 10h
MOV AH,02h
MOV AL,41h
INT 21h
MOV AX,00h
INT 16h
INT 20h
This is an example to show the 'A' on FullScreen Mode */
LPSTR TheHiddenGhost = "This litte program is\n"
"designed By :\n\n"
"The Hidden Ghost\n\n"
"The prominent aim\n"
"for this application is\n"
"to show how to build\n"
"an executable file \n"
"without any compiler \n"
"or any assembler...\n\n"
"All Rights Reserved\n\n"
"By : Hamza Qdider\n\n";
LRESULT CALLBACK GENERATORDLG( HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lparam )
{
switch( umsg )
{
case WM_COMMAND:
{
switch( LOWORD( wparam ) )
{
case GEN_BUTTON:
GetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( LARGE_EDIT_BOX ),GetMachineCode,sizeof( GetMachineCode ) );
if( GetMachineCode[1] == 0 ) {
MessageBoxA( hwnd,"There are no Machine Codes in the TextBox Sir !!!","An Error Is Occured !",MB_OK | MB_ICONERROR );
return 0;
}
MessageBoxA( hwnd,GetMachineCode,"Your Machine Code Is : ",MB_OK );
_export_exe = fopen( "Generated.exe","wb" );
_bin_source_code = fopen("Generated.bin","w");
_8digit = &GetMachineCode;
while( *_8digit++ )
{
if( *_8digit != '\n' && *( _8digit - 1 ) != ' ' ) {
if( *( _8digit - 1 ) == '\n' )
*_8digit++;
_Bin[i++] = *( _8digit - 1 );
if( i == 8 ) {
i = 0;
fprintf(_export_exe,"%c",__BINARY( _Bin ) );
fprintf(_bin_source_code,"%s\n",_Bin );
}
}
}
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_STEPS ),"Checking MachineCode." );
Sleep( 900 );
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_STEPS ),"Checking Machine Code.." );
Sleep( 900 );
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_STEPS ),"Checking Machine Code..." );
Sleep( 1000 );
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_STEPS ),"Generating Executable File." );
Sleep( 900 );
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_STEPS ),"Generating Executable File.." );
Sleep( 900 );
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_STEPS ),"Generating Executable File..." );
Sleep( 1000 );
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_STEPS ),"Executable is Generated ... Let's Go !!!" );
fclose( _export_exe );
fclose( _bin_source_code );
break;
case CLR_BUTTON:
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( LARGE_EDIT_BOX ),"" );
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_EXAMPLE ),"PUT YOUR MACHINE CODE HERE, BUT EACH LINE MUST CONTAIN JUST 8 NUMBERS NO MORE.( 0's AND 1's)" );
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_STEPS ),"" );
break;
case REG_BUTTON:
MessageBoxA( hwnd,registers,"Registers in Machine Code : ",MB_OK | MB_ICONINFORMATION );
break;
case EXM_BUTTON:
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_EXAMPLE ),BIN_EXAMPLE );
break;
case ABOUT_BUTTON:
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_EXAMPLE ),TheHiddenGhost );
break;
}
}
break;
case WM_CLOSE:
EndDialog( hwnd,0 );
break;
default:
GetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( LARGE_EDIT_BOX ),Little_Trick,sizeof( Little_Trick ) );
if( Little_Trick[0] != 0 )
SetDlgItemText( hwnd,( int ) MAKEINTRESOURCE( SW_EXAMPLE ),"" );
break;
}
return 0;
}
INT WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int ShowCmd )
{
DialogBoxParam( hInstance,MAKEINTRESOURCE( GEN_DLG ),0,( DLGPROC )GENERATORDLG,0 );
return 0;
} |
Partager