| 888 | } |
| 889 | |
| 890 | static void **InterestingDLLsAvailable() { |
| 891 | static const char *InterestingDLLs[] = { |
| 892 | "kernel32.dll", |
| 893 | "msvcr100.dll", // VS2010 |
| 894 | "msvcr110.dll", // VS2012 |
| 895 | "msvcr120.dll", // VS2013 |
| 896 | "vcruntime140.dll", // VS2015 |
| 897 | "ucrtbase.dll", // Universal CRT |
| 898 | // NTDLL should go last as it exports some functions that we should |
| 899 | // override in the CRT [presumably only used internally]. |
| 900 | "ntdll.dll", NULL}; |
| 901 | static void *result[ARRAY_SIZE(InterestingDLLs)] = { 0 }; |
| 902 | if (!result[0]) { |
| 903 | for (size_t i = 0, j = 0; InterestingDLLs[i]; ++i) { |
| 904 | if (HMODULE h = GetModuleHandleA(InterestingDLLs[i])) |
| 905 | result[j++] = (void *)h; |
| 906 | } |
| 907 | } |
| 908 | return &result[0]; |
| 909 | } |
| 910 | |
| 911 | namespace { |
| 912 | // Utility for reading loaded PE images. |