Masm32 SDK description, downloads and other helpful links

Main Menu

ApiSet Stub ???

Started by TimoVJL, April 13, 2019, 03:58:58 AM

Previous topic - Next topic


Windows 8.1 API Sets
What is the real purbose of this new DLL-hell ?
includelib "api-ms-win-core-processthreads-l1-1-0_64.lib"
includelib "api-ms-win-core-console-l1-1-0_64.lib"
includelib "api-ms-win-core-processenvironment-l1-1-0_64.lib"

extern __imp_ExitProcess :proc
extern __imp_GetStdHandle :proc
extern __imp_WriteConsoleA :proc
public mainCRTStartup

msg db "Hello World",13,10,0
sub rsp, 28h
mov ecx, 0FFFFFFF5h
call qword ptr [__imp_GetStdHandle]
mov rcx, rax
xor eax, eax
mov qword ptr [rsp+20h], rax
xor r9, r9
mov r8d, 0Ch
lea rdx, [msg]
call qword ptr [__imp_WriteConsoleA]
xor ecx, ecx
call qword ptr [__imp_ExitProcess]
add rsp, 28h

EDIT: The API Set Schema
May the source be with you




Quote from: TimoVJL on April 13, 2019, 03:58:58 AMEDIT: The API Set Schema

Quotethese failing implementations have not all received great care: see for instance that CreateFileW in API-MS-Win-Core-File-L1-1-0.dll returns a hard-coded NULL (0) instead of INVALID_HANDLE_VALUE (-1)


Those stubs are interesting, like x64 version, only one stub function usedpFile Data Description Value
000004A8 00001060 Function RVA 0001 AllocConsole
000004AC 00001060 Function RVA 0002 GetConsoleCP
000004B0 00001060 Function RVA 0003 GetConsoleMode
000004B4 00001060 Function RVA 0004 GetConsoleOutputCP
000004B8 00001060 Function RVA 0005 GetNumberOfConsoleInputEvents
000004BC 00001060 Function RVA 0006 PeekConsoleInputA
000004C0 00001060 Function RVA 0007 ReadConsoleA
000004C4 00001060 Function RVA 0008 ReadConsoleInputA
000004C8 00001060 Function RVA 0009 ReadConsoleInputW
000004CC 00001060 Function RVA 000A ReadConsoleW
000004D0 00001060 Function RVA 000B SetConsoleCtrlHandler
000004D4 00001060 Function RVA 000C SetConsoleMode
000004D8 00001060 Function RVA 000D WriteConsoleA
000004DC 00001060 Function RVA 000E WriteConsoleW
x86pFile Data Description Value
000004C8 0000105C Function RVA 0001 AllocConsole
000004CC 0000105C Function RVA 0002 GetConsoleCP
000004D0 0000106E Function RVA 0003 GetConsoleMode
000004D4 0000105C Function RVA 0004 GetConsoleOutputCP
000004D8 0000106E Function RVA 0005 GetNumberOfConsoleInputEvents
000004DC 00001064 Function RVA 0006 PeekConsoleInputA
000004E0 00001078 Function RVA 0007 ReadConsoleA
000004E4 00001064 Function RVA 0008 ReadConsoleInputA
000004E8 00001064 Function RVA 0009 ReadConsoleInputW
000004EC 00001078 Function RVA 000A ReadConsoleW
000004F0 0000106E Function RVA 000B SetConsoleCtrlHandler
000004F4 0000106E Function RVA 000C SetConsoleMode
000004F8 00001078 Function RVA 000D WriteConsoleA
000004FC 00001078 Function RVA 000E WriteConsoleW
0000005C  xor eax, eax
0000005E  ret

00000064  xor eax, eax
00000066  ret 10h

0000006E  xor eax, eax
00000070  ret 8h

00000078  xor eax, eax
0000007A  ret 14h

May the source be with you