MCPcopy Index your code
hub / github.com/CCob/BOF.NET / initAppDomain

Function initAppDomain

bofs/bofnet_execute.cpp:36–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34__attribute__((section(".data"))) ICorRuntimeHost* icrh = nullptr;
35
36mscorlib::_AppDomain* initAppDomain(ICorRuntimeHost* icrh, const wchar_t* appDomainName){
37
38 BOF_LOCAL(OLE32, CLSIDFromString);
39
40 GUID CLSID_AppDomain;
41 HRESULT hr;
42 IUnknown* iu = nullptr;
43 mscorlib::_AppDomain* appDomain = nullptr;
44 CLSIDFromString(L"{05F696DC-2B29-3663-AD8B-C4389CF2A713}", &CLSID_AppDomain);
45
46 hr = icrh->CreateDomain(appDomainName, nullptr, &iu);
47
48 if(iu == nullptr){
49 log("[!] Failed to create AppDomain: 0x%x", hr);
50 return nullptr;
51 }
52
53 hr = iu->QueryInterface(CLSID_AppDomain, (LPVOID*)&appDomain);
54
55 if(appDomain == nullptr){
56 log("[!] Failed to query AppDomain interface: 0x%x", hr);
57 }
58 iu->Release();
59
60 return appDomain;
61}
62
63
64mscorlib::_AppDomain* getAppDomain(ICorRuntimeHost* icrh, const wchar_t* appDomainName){

Callers 1

getAppDomainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected