thank you.
What function can i use ?
I use RtlCreateUserThread with LdrUnloadDll
this does not work.
My code is
Code: Select allPVOID searchDllProcess(const wchar_t* nameDll,DWORD pid)
{
HANDLE snapshotModule = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,pid);
MODULEENTRY32 structmodsnapshot = {0};
structmodsnapshot.dwSize = sizeof(MODULEENTRY32);
if(snapshotModule == INVALID_HANDLE_VALUE)return NULL;
if(Module32First( snapshotModule , &structmodsnapshot ) == FALSE)return NULL;
while(Module32Next(snapshotModule , &structmodsnapshot))
{
if(!wcscmp(structmodsnapshot.szModule,nameDll))
{
CloseHandle(snapshotModule);
return (PVOID)structmodsnapshot.modBaseAddr;
}
}
CloseHandle(snapshotModule);
return NULL;
}
...
PVOID addrDllParametre = searchDllProcess(nameDll,pid);
...
addrUnloadDll = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll.dll"),"LdrUnloadDll");
...
RtlCreateUserThread(handleProcess,NULL,false,0,0,0,(PUSER_THREAD_START_ROUTINE)addrUnloadDll,addrDllParametre,&hThread,NULL);
can you help me please.