; Listing generated by Microsoft (R) Optimizing Compiler Version 19.28.29335.0 include listing.inc INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC g_ConOut PUBLIC g_ConIn PUBLIC g_ConsoleOutput PUBLIC g_BE _BSS SEGMENT g_ConOut DQ 01H DUP (?) g_ConIn DQ 01H DUP (?) g_ConsoleOutput DD 01H DUP (?) _BSS ENDS _DATA SEGMENT g_BE DW 0feffH _DATA ENDS PUBLIC cuiInitialize PUBLIC cuiPrintTextA PUBLIC cuiPrintTextW PUBLIC cuiPrintTextLastErrorA PUBLIC cuiPrintTextLastErrorW PUBLIC cuiClrScr PUBLIC ??_C@_02PCIJFNDE@?$AN?6@ ; `string' PUBLIC ??_C@_15JNBOKNOG@?$AA?$AN?$AA?6@ ; `string' EXTRN __imp_GetStdHandle:PROC EXTRN __imp_WriteFile:PROC EXTRN __imp_GetLastError:PROC EXTRN __imp_HeapAlloc:PROC EXTRN __imp_HeapFree:PROC EXTRN __imp_GetProcessHeap:PROC EXTRN __imp_FormatMessageA:PROC EXTRN __imp_FormatMessageW:PROC EXTRN __imp_GetConsoleMode:PROC EXTRN __imp_SetConsoleMode:PROC EXTRN __imp_WriteConsoleA:PROC EXTRN __imp_WriteConsoleW:PROC EXTRN __imp_FillConsoleOutputCharacterW:PROC EXTRN __imp_FillConsoleOutputAttribute:PROC EXTRN __imp_GetConsoleScreenBufferInfo:PROC EXTRN __imp_SetConsoleCursorPosition:PROC EXTRN _strcpy_a:PROC EXTRN _strcpy_w:PROC EXTRN _strcat_a:PROC EXTRN _strcat_w:PROC EXTRN _strlen_a:PROC EXTRN _strlen_w:PROC ; COMDAT pdata pdata SEGMENT $pdata$cuiInitialize DD imagerel $LN7 DD imagerel $LN7+173 DD imagerel $unwind$cuiInitialize pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$cuiPrintTextA DD imagerel $LN13 DD imagerel $LN13+207 DD imagerel $unwind$cuiPrintTextA pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$cuiPrintTextW DD imagerel $LN13 DD imagerel $LN13+215 DD imagerel $unwind$cuiPrintTextW pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$cuiPrintTextLastErrorA DD imagerel $LN4 DD imagerel $LN4+84 DD imagerel $unwind$cuiPrintTextLastErrorA pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$cuiPrintTextLastErrorW DD imagerel $LN4 DD imagerel $LN4+84 DD imagerel $unwind$cuiPrintTextLastErrorW pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$cuiClrScr DD imagerel $LN8 DD imagerel $LN8+173 DD imagerel $unwind$cuiClrScr pdata ENDS ; COMDAT ??_C@_15JNBOKNOG@?$AA?$AN?$AA?6@ CONST SEGMENT ??_C@_15JNBOKNOG@?$AA?$AN?$AA?6@ DB 0dH, 00H, 0aH, 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_02PCIJFNDE@?$AN?6@ CONST SEGMENT ??_C@_02PCIJFNDE@?$AN?6@ DB 0dH, 0aH, 00H ; `string' CONST ENDS ; COMDAT xdata xdata SEGMENT $unwind$cuiClrScr DD 040a01H DD 0e640aH DD 07006920aH xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$cuiPrintTextLastErrorW DD 030901H DD 0880109H DD 03002H xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$cuiPrintTextLastErrorA DD 030901H DD 0480109H DD 03002H xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$cuiPrintTextW DD 061801H DD 0a6418H DD 093418H DD 070145218H xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$cuiPrintTextA DD 061801H DD 0a6418H DD 093418H DD 070145218H xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$cuiInitialize DD 040a01H DD 09340aH DD 07006520aH xdata ENDS ; Function compile flags: /Ogspy ; COMDAT cuiClrScr _TEXT SEGMENT csbi$ = 48 coordScreen$ = 96 cCharsWritten$ = 104 cuiClrScr PROC ; COMDAT ; File J:\Workspace\drivers\TDL\Source\Furutaka\cui.c ; Line 69 $LN8: mov QWORD PTR [rsp+24], rsi push rdi sub rsp, 80 ; 00000050H ; Line 78 mov rcx, QWORD PTR g_ConOut lea rdx, QWORD PTR csbi$[rsp] xor esi, esi mov DWORD PTR coordScreen$[rsp], esi call QWORD PTR __imp_GetConsoleScreenBufferInfo test eax, eax je SHORT $LN1@cuiClrScr ; Line 81 movsx eax, WORD PTR csbi$[rsp] ; Line 83 lea edx, QWORD PTR [rsi+32] movsx edi, WORD PTR csbi$[rsp+2] mov r9d, esi mov rcx, QWORD PTR g_ConOut imul edi, eax lea rax, QWORD PTR cCharsWritten$[rsp] mov QWORD PTR [rsp+32], rax mov r8d, edi call QWORD PTR __imp_FillConsoleOutputCharacterW test eax, eax je SHORT $LN1@cuiClrScr ; Line 87 mov rcx, QWORD PTR g_ConOut lea rdx, QWORD PTR csbi$[rsp] call QWORD PTR __imp_GetConsoleScreenBufferInfo test eax, eax je SHORT $LN1@cuiClrScr ; Line 90 movzx edx, WORD PTR csbi$[rsp+8] lea rax, QWORD PTR cCharsWritten$[rsp] mov rcx, QWORD PTR g_ConOut mov r9d, esi mov r8d, edi mov QWORD PTR [rsp+32], rax call QWORD PTR __imp_FillConsoleOutputAttribute test eax, eax je SHORT $LN1@cuiClrScr ; Line 94 mov rcx, QWORD PTR g_ConOut mov edx, esi call QWORD PTR __imp_SetConsoleCursorPosition $LN1@cuiClrScr: ; Line 95 mov rsi, QWORD PTR [rsp+112] add rsp, 80 ; 00000050H pop rdi ret 0 cuiClrScr ENDP _TEXT ENDS ; Function compile flags: /Ogspy ; COMDAT cuiPrintTextLastErrorW _TEXT SEGMENT szTextBuffer$ = 64 UseReturn$ = 1104 cuiPrintTextLastErrorW PROC ; COMDAT ; File J:\Workspace\drivers\TDL\Source\Furutaka\cui.c ; Line 217 $LN4: push rbx sub rsp, 1088 ; 00000440H mov ebx, ecx ; Line 219 call QWORD PTR __imp_GetLastError ; Line 221 and QWORD PTR [rsp+48], 0 lea rcx, QWORD PTR szTextBuffer$[rsp] mov DWORD PTR [rsp+40], 512 ; 00000200H mov r9d, 1024 ; 00000400H mov QWORD PTR [rsp+32], rcx mov r8d, eax mov ecx, 4096 ; 00001000H xor edx, edx call QWORD PTR __imp_FormatMessageW ; Line 222 mov edx, ebx lea rcx, QWORD PTR szTextBuffer$[rsp] call cuiPrintTextW ; Line 223 add rsp, 1088 ; 00000440H pop rbx ret 0 cuiPrintTextLastErrorW ENDP _TEXT ENDS ; Function compile flags: /Ogspy ; COMDAT cuiPrintTextLastErrorA _TEXT SEGMENT szTextBuffer$ = 64 UseReturn$ = 592 cuiPrintTextLastErrorA PROC ; COMDAT ; File J:\Workspace\drivers\TDL\Source\Furutaka\cui.c ; Line 197 $LN4: push rbx sub rsp, 576 ; 00000240H mov ebx, ecx ; Line 199 call QWORD PTR __imp_GetLastError ; Line 201 and QWORD PTR [rsp+48], 0 lea rcx, QWORD PTR szTextBuffer$[rsp] mov DWORD PTR [rsp+40], 512 ; 00000200H mov r9d, 1024 ; 00000400H mov QWORD PTR [rsp+32], rcx mov r8d, eax mov ecx, 4096 ; 00001000H xor edx, edx call QWORD PTR __imp_FormatMessageA ; Line 202 mov edx, ebx lea rcx, QWORD PTR szTextBuffer$[rsp] call cuiPrintTextA ; Line 203 add rsp, 576 ; 00000240H pop rbx ret 0 cuiPrintTextLastErrorA ENDP _TEXT ENDS ; Function compile flags: /Ogspy ; COMDAT cuiPrintTextW _TEXT SEGMENT bytesIO$ = 64 lpText$ = 64 UseReturn$ = 72 cuiPrintTextW PROC ; COMDAT ; File J:\Workspace\drivers\TDL\Source\Furutaka\cui.c ; Line 154 $LN13: ; Line 159 test rcx, rcx je $LN11@cuiPrintTe mov QWORD PTR [rsp+16], rbx mov QWORD PTR [rsp+24], rsi push rdi sub rsp, 48 ; 00000030H ; Line 154 mov esi, edx mov rdi, rcx ; Line 162 call _strlen_w ; Line 163 lea r8, QWORD PTR [rax-1] cmp r8, 1039 ; 0000040fH ja $LN4@cuiPrintTe ; Line 166 lea rbx, QWORD PTR [rax*2+6] ; Line 167 call QWORD PTR __imp_GetProcessHeap mov r8, rbx mov edx, 8 mov rcx, rax call QWORD PTR __imp_HeapAlloc mov rbx, rax ; Line 168 test rax, rax je SHORT $LN4@cuiPrintTe ; Line 170 mov rdx, rdi mov rcx, rax call _strcpy_w ; Line 171 test esi, esi je SHORT $LN6@cuiPrintTe lea rdx, OFFSET FLAT:??_C@_15JNBOKNOG@?$AA?$AN?$AA?6@ mov rcx, rbx call _strcat_w $LN6@cuiPrintTe: ; Line 173 mov rcx, rbx call _strlen_w ; Line 175 and QWORD PTR [rsp+32], 0 lea r9, QWORD PTR bytesIO$[rsp] cmp DWORD PTR g_ConsoleOutput, 0 mov rdx, rbx mov rcx, QWORD PTR g_ConOut je SHORT $LN7@cuiPrintTe ; Line 176 mov r8d, eax call QWORD PTR __imp_WriteConsoleW ; Line 177 jmp SHORT $LN8@cuiPrintTe $LN7@cuiPrintTe: ; Line 179 lea r8d, DWORD PTR [rax+rax] call QWORD PTR __imp_WriteFile $LN8@cuiPrintTe: ; Line 181 call QWORD PTR __imp_GetProcessHeap mov r8, rbx xor edx, edx mov rcx, rax call QWORD PTR __imp_HeapFree $LN4@cuiPrintTe: ; Line 183 mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi $LN11@cuiPrintTe: ret 0 cuiPrintTextW ENDP _TEXT ENDS ; Function compile flags: /Ogspy ; COMDAT cuiPrintTextA _TEXT SEGMENT bytesIO$ = 64 lpText$ = 64 UseReturn$ = 72 cuiPrintTextA PROC ; COMDAT ; File J:\Workspace\drivers\TDL\Source\Furutaka\cui.c ; Line 110 $LN13: ; Line 115 test rcx, rcx je $LN11@cuiPrintTe mov QWORD PTR [rsp+16], rbx mov QWORD PTR [rsp+24], rsi push rdi sub rsp, 48 ; 00000030H ; Line 110 mov esi, edx mov rdi, rcx ; Line 118 call _strlen_a ; Line 119 lea r8, QWORD PTR [rax-1] cmp r8, 1039 ; 0000040fH ja $LN4@cuiPrintTe ; Line 122 lea rbx, QWORD PTR [rax+5] ; Line 123 call QWORD PTR __imp_GetProcessHeap mov r8, rbx mov edx, 8 mov rcx, rax call QWORD PTR __imp_HeapAlloc mov rbx, rax ; Line 124 test rax, rax je SHORT $LN4@cuiPrintTe ; Line 126 mov rdx, rdi mov rcx, rax call _strcpy_a ; Line 127 test esi, esi je SHORT $LN6@cuiPrintTe lea rdx, OFFSET FLAT:??_C@_02PCIJFNDE@?$AN?6@ mov rcx, rbx call _strcat_a $LN6@cuiPrintTe: ; Line 129 mov rcx, rbx call _strlen_a ; Line 131 and QWORD PTR [rsp+32], 0 lea r9, QWORD PTR bytesIO$[rsp] cmp DWORD PTR g_ConsoleOutput, 0 mov r8d, eax mov rcx, QWORD PTR g_ConOut mov rdx, rbx je SHORT $LN7@cuiPrintTe ; Line 132 call QWORD PTR __imp_WriteConsoleA ; Line 133 jmp SHORT $LN8@cuiPrintTe $LN7@cuiPrintTe: ; Line 135 call QWORD PTR __imp_WriteFile $LN8@cuiPrintTe: ; Line 137 call QWORD PTR __imp_GetProcessHeap mov r8, rbx xor edx, edx mov rcx, rax call QWORD PTR __imp_HeapFree $LN4@cuiPrintTe: ; Line 139 mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi $LN11@cuiPrintTe: ret 0 cuiPrintTextA ENDP _TEXT ENDS ; Function compile flags: /Ogspy ; COMDAT cuiInitialize _TEXT SEGMENT dummy$ = 64 InitInput$ = 64 IsConsoleOutput$ = 72 cuiInitialize PROC ; COMDAT ; File J:\Workspace\drivers\TDL\Source\Furutaka\cui.c ; Line 37 $LN7: mov QWORD PTR [rsp+16], rbx push rdi sub rsp, 48 ; 00000030H mov ebx, ecx mov rdi, rdx ; Line 40 mov ecx, -11 ; fffffff5H call QWORD PTR __imp_GetStdHandle mov QWORD PTR g_ConOut, rax ; Line 42 test ebx, ebx je SHORT $LN2@cuiInitial mov ecx, -10 ; fffffff6H call QWORD PTR __imp_GetStdHandle mov QWORD PTR g_ConIn, rax mov rax, QWORD PTR g_ConOut $LN2@cuiInitial: ; Line 44 mov edx, 7 mov rcx, rax call QWORD PTR __imp_SetConsoleMode ; Line 47 mov rcx, QWORD PTR g_ConOut lea rdx, QWORD PTR dummy$[rsp] mov DWORD PTR g_ConsoleOutput, 1 call QWORD PTR __imp_GetConsoleMode test eax, eax jne SHORT $LN3@cuiInitial ; Line 48 and DWORD PTR g_ConsoleOutput, eax ; Line 49 lea r9, QWORD PTR dummy$[rsp] and QWORD PTR [rsp+32], 0 lea r8d, QWORD PTR [rax+2] mov rcx, QWORD PTR g_ConOut lea rdx, OFFSET FLAT:g_BE call QWORD PTR __imp_WriteFile $LN3@cuiInitial: ; Line 52 test rdi, rdi je SHORT $LN4@cuiInitial ; Line 53 mov eax, DWORD PTR g_ConsoleOutput mov DWORD PTR [rdi], eax $LN4@cuiInitial: ; Line 56 mov rbx, QWORD PTR [rsp+72] add rsp, 48 ; 00000030H pop rdi ret 0 cuiInitialize ENDP _TEXT ENDS END