Handling Character Display
in graphics mode Using
32 bit system call
ASJAD ALI
(p14-6100)
LIST OF TOICS
 Write Console
 GetStdHandle
 GetConsoleCursorInfo
 SetConsoleCursorInfo
 ConsoleScreenBufferInfo
 GetConsoleScreenBufferInfo
 SetConsoleScreenBufferSize
 SetConsoleTitle
 WriteConsoleOutputAttribute
 TYPE OF BUFFER:
 INPUT BUFFER:
 Input Buffer contain queue of inputs record
 E.g Mouse Click , Keyboard etc
 SECREEN BUFFER:
 2D array of Character and color data affecting
appearance of text
 INVOKE WriteConsole,
 eax, ; console output handle
 edx, ; string pointer
 ecx, ; string length
 ADDR bytesWritten,
 WriteConsole
(
_In_ HANDLE hConsoleOutput,
_In_ VOID *lpBuffer,
_In_ DWORD nNumberOfCharsToWrite,
_Out_ LPDWORD lpNumberOfCharsWritten,
);
 GetStdHandle
 GET the Control of the Screen Buffer
INVOKE GetStdHandle, STD_OUTPUT_HANDLE
mov outHandle,eax
 ;INVOKE GetConsoleCursorInfo, outHandle,
 ; ADDR cursorInfo
 ;mov eax, cursorInfo.dwSize
 typedef struct _CONSOLE_CURSOR_INFO
 {
 DWORD dwSize;
 BOOL bVisible;
 }
 ;mov cursorInfo.bVisible,1
 ;mov cursorInfo.dwSize,100
 ;INVOKE SetConsoleCursorInfo, outHandle,
 ; ADDR cursorInfo
 SetConsoleCursorInfo
 (
 HANDLE hConsoleOutput,
 CONSOLE_CURSOR_INFO *lpConsoleCursorInfo
 );
 CONSOLE_SCREEN_BUFFER_INFO
 {
 COORD dwSize;
COORD dwCursorPosition;
WORD wAttributes; SMALL_RECT
srWindow;
COORD dwMaximumWindowSize;
 }
 INVOKE GetConsoleScreenBufferInfo,
outHandle,
 ADDR consoleInfo
 GetConsoleScreenBufferInfo
 (
 HANDLE hConsoleOutput, (input)
 PCONSOLE_SCREEN_BUFFER_INFO
*lpConsoleScreenBufferInfo (Output)
 );
 mov scrSize.x, 80
 mov scrSize.y, 25
 INVOKE SetConsoleScreenBufferSize,
 outHandle,scrSize
INVOKE SetConsoleTitle,
ADDR titleStr
 INVOKE WriteConsoleOutputAttribute,
 outHandle, ADDR attributes,
 BufSize, xyPos,
 ADDR cellsWritten
 WriteConsoleOutputAttribute
 (
 _In_ HANDLE hConsoleOutput,
 _In_ WORD *lpAttribute,
 _In_ DWORD nLength,
 _In_ COORD dwWriteCoord,
 _Out_ LPDWORD lpNumberOfAttrsWritten
 );
Graphics 32 bit

Graphics 32 bit

  • 1.
    Handling Character Display ingraphics mode Using 32 bit system call ASJAD ALI (p14-6100)
  • 2.
    LIST OF TOICS Write Console  GetStdHandle  GetConsoleCursorInfo  SetConsoleCursorInfo  ConsoleScreenBufferInfo  GetConsoleScreenBufferInfo  SetConsoleScreenBufferSize  SetConsoleTitle  WriteConsoleOutputAttribute
  • 3.
     TYPE OFBUFFER:  INPUT BUFFER:  Input Buffer contain queue of inputs record  E.g Mouse Click , Keyboard etc  SECREEN BUFFER:  2D array of Character and color data affecting appearance of text
  • 4.
     INVOKE WriteConsole, eax, ; console output handle  edx, ; string pointer  ecx, ; string length  ADDR bytesWritten,  WriteConsole ( _In_ HANDLE hConsoleOutput, _In_ VOID *lpBuffer, _In_ DWORD nNumberOfCharsToWrite, _Out_ LPDWORD lpNumberOfCharsWritten, );
  • 5.
     GetStdHandle  GETthe Control of the Screen Buffer INVOKE GetStdHandle, STD_OUTPUT_HANDLE mov outHandle,eax
  • 6.
     ;INVOKE GetConsoleCursorInfo,outHandle,  ; ADDR cursorInfo  ;mov eax, cursorInfo.dwSize  typedef struct _CONSOLE_CURSOR_INFO  {  DWORD dwSize;  BOOL bVisible;  }
  • 7.
     ;mov cursorInfo.bVisible,1 ;mov cursorInfo.dwSize,100  ;INVOKE SetConsoleCursorInfo, outHandle,  ; ADDR cursorInfo  SetConsoleCursorInfo  (  HANDLE hConsoleOutput,  CONSOLE_CURSOR_INFO *lpConsoleCursorInfo  );
  • 8.
     CONSOLE_SCREEN_BUFFER_INFO  { COORD dwSize; COORD dwCursorPosition; WORD wAttributes; SMALL_RECT srWindow; COORD dwMaximumWindowSize;  }
  • 9.
     INVOKE GetConsoleScreenBufferInfo, outHandle, ADDR consoleInfo  GetConsoleScreenBufferInfo  (  HANDLE hConsoleOutput, (input)  PCONSOLE_SCREEN_BUFFER_INFO *lpConsoleScreenBufferInfo (Output)  );
  • 10.
     mov scrSize.x,80  mov scrSize.y, 25  INVOKE SetConsoleScreenBufferSize,  outHandle,scrSize
  • 11.
  • 12.
     INVOKE WriteConsoleOutputAttribute, outHandle, ADDR attributes,  BufSize, xyPos,  ADDR cellsWritten  WriteConsoleOutputAttribute  (  _In_ HANDLE hConsoleOutput,  _In_ WORD *lpAttribute,  _In_ DWORD nLength,  _In_ COORD dwWriteCoord,  _Out_ LPDWORD lpNumberOfAttrsWritten  );