Author Topic: ucrt  (Read 394 times)

TimoVJL

  • Member
  • ***
  • Posts: 476
ucrt
« on: October 15, 2019, 07:26:34 PM »
How common ucrt is in normal PC's ?
Does it come for some programs by windows updates ?

EDIT:
- Windows 10 basic feature
- Windows 7 SP1 - 8x cumulative updates ?

Maybe a ucrt.lib or ucrtbase.lib could be added to masm32/64 lib-folder too.
« Last Edit: October 15, 2019, 10:38:36 PM by TimoVJL »
May the source be with you

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6768
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: ucrt
« Reply #1 on: October 15, 2019, 09:22:38 PM »
Timo,

This is all I get on Win 10 64 pro.

14/03/2019  07:37 PM         1,171,568 ucrtbase.dll
18/03/2019  07:43 PM         1,517,000 ucrtbased.dll
28/03/2019  05:35 PM           702,400 ucrtbase_clr0400.dll
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

Vortex

  • Member
  • *****
  • Posts: 2032
Re: ucrt
« Reply #2 on: October 16, 2019, 04:31:03 AM »
The package of X-Firefox Portable Version 58 contains ucrtbase.dll :

Version 10.0.16299.15 ( (WinBuild.160101.0800) )

AW

  • Member
  • *****
  • Posts: 2442
  • Let's Make ASM Great Again!
Re: ucrt
« Reply #3 on: October 16, 2019, 06:37:05 PM »
ucrtbase.dll=123
ucrt*.lib = 48


Vortex

  • Member
  • *****
  • Posts: 2032
Re: ucrt
« Reply #4 on: October 17, 2019, 04:59:52 AM »
ucrtbase.dll is another effort of M$ trying to complicate things :

Code: [Select]
\PellesC\bin\podump.exe /IMPORTS ucrtbase.dll | findstr ".dll"

Dump of ucrtbase.dll

        api-ms-win-core-string-l1-1-0.dll
        api-ms-win-core-errorhandling-l1-1-0.dll
        api-ms-win-core-file-l1-1-0.dll
        api-ms-win-core-timezone-l1-1-0.dll
        api-ms-win-core-namedpipe-l1-1-0.dll
        api-ms-win-core-handle-l1-1-0.dll
        api-ms-win-core-file-l2-1-0.dll
        api-ms-win-core-heap-l1-1-0.dll
        api-ms-win-core-libraryloader-l1-1-0.dll
        api-ms-win-core-synch-l1-1-0.dll
        api-ms-win-core-processthreads-l1-1-0.dll
        api-ms-win-core-processenvironment-l1-1-0.dll
        api-ms-win-core-localization-l1-2-0.dll
        api-ms-win-core-datetime-l1-1-0.dll
        api-ms-win-core-sysinfo-l1-1-0.dll
        api-ms-win-core-synch-l1-2-0.dll
        api-ms-win-core-console-l1-1-0.dll
        api-ms-win-core-debug-l1-1-0.dll
        api-ms-win-core-processthreads-l1-1-1.dll
        api-ms-win-core-file-l1-2-0.dll
        api-ms-win-core-profile-l1-1-0.dll
        api-ms-win-core-memory-l1-1-0.dll
        api-ms-win-core-util-l1-1-0.dll
        api-ms-win-core-rtlsupport-l1-1-0.dll
        api-ms-win-core-interlocked-l1-1-0.dll

Code: [Select]
\PellesC\bin\podump.exe /IMPORTS C:\WINDOWS\system32\msvcrt.dll | findstr ".dll"

Dump of C:\WINDOWS\system32\msvcrt.dll

        KERNEL32.dll
        ntdll.dll

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: ucrt
« Reply #5 on: October 17, 2019, 06:26:26 AM »
ucrtbase_clr0400.dll don't use those stubs/forwarders.
May the source be with you

Vortex

  • Member
  • *****
  • Posts: 2032
Re: ucrt
« Reply #6 on: October 17, 2019, 07:38:06 AM »
Hi Timo,

Thanks. How can I get that Dll?

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: ucrt
« Reply #7 on: October 17, 2019, 07:59:24 AM »
It come with NetFramework 4.8 ?

https://dotnet.microsoft.com/download/dotnet-framework/net48 runtime

Offline installer, netfx_Full.mzz

PS: check *_clr0400.dll

EDIT: startup code for ucrtbase.dll
Code: [Select]
extern int*    __cdecl __p___argc (void);
extern char*** __cdecl __p___argv (void);
extern char*** __cdecl __p__environ (void);
//extern wchar_t*** __cdecl __p___wargv(void);
extern int _configure_narrow_argv(int);
//extern int _configure_wide_argv(int);

int main(int argc, char **argv);

void __cdecl mainCRTStartup(void)
{
_configure_narrow_argv(1);
int __argc = *__p___argc();
char** __argv = *__p___argv();
//char**__env = *__p__environ();
exit(main(__argc, __argv));
}
« Last Edit: October 17, 2019, 11:45:11 PM by TimoVJL »
May the source be with you

Vortex

  • Member
  • *****
  • Posts: 2032
Re: ucrt
« Reply #8 on: October 18, 2019, 07:50:57 AM »
Thanks for your suggestion. Installing .Net Framework 4.8 on a test computer, I managed to retrieve the DLL.

Building an experimental import library :

Code: [Select]
\PellesC\bin\polib /MACHINE:x86 /OUT:ucrtbase_clr0400.lib ucrtbase_clr0400.dll
A test application :

Code: [Select]
.386
.model flat,stdcall
option casemap:none

include     \masm32\include\windows.inc
include     \masm32\include\kernel32.inc

includelib  \masm32\lib\kernel32.lib
includelib  ucrtbase_clr0400.lib

puts        PROTO C :DWORD
_strupr     PROTO C :DWORD

.data

str1        db 'ucrtbase_clr0400.dll test.'

.code

start:

    invoke  _strupr,ADDR str1
   
    invoke  puts,eax

    invoke  ExitProcess,0

END start

The api-ms-win-core*.dll set became a part of the latest M$ operating systems if I am not wrong.