> For the complete documentation index, see [llms.txt](https://malwaresourcecode.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malwaresourcecode.com/home/fingerprinting/getnumberoflinkeddlls.md).

# GetNumberOfLinkedDlls

```
DWORD GetNumberOfLinkedDlls(VOID)
{
	PPEB Peb = GetPeb();
	PLDR_MODULE Module = NULL;
	DWORD dwIndexHash = 0;
	DWORD dwCount = 0;

	Module = (PLDR_MODULE)((PBYTE)Peb->LoaderData->InMemoryOrderModuleList.Flink - 16);

	for (; TRUE; dwCount++)
	{
		Module = (PLDR_MODULE)((PBYTE)Module->InMemoryOrderModuleList.Flink - 16);
		if (Module->BaseDllName.Buffer == NULL)
			break;
	}

	return dwCount;
}
```
