MCPcopy Create free account
hub / github.com/T3nb3w/ComDotNetExploit / GetStaticMethod

Method GetStaticMethod

Bypass_COM_PPL/dotnet_interop.cpp:10–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8}
9
10mscorlib::_MethodInfoPtr DotNetInterop::GetStaticMethod(mscorlib::_TypePtr type, LPCWSTR methodName, int pcount) {
11
12 LPSAFEARRAY methods = type->GetMethods_2();
13 mscorlib::_MethodInfoPtr ret;
14 LONG methodCount = GetSafeArrayLen(methods);
15
16 for (long i = 0; i < methodCount; ++i)
17 {
18 IUnknown* v = nullptr;
19
20 if (SUCCEEDED(SafeArrayGetElement(methods, &i, &v)))
21 {
22 mscorlib::_MethodInfoPtr method = v;
23 bstr_t name = method->Getname();
24 LPSAFEARRAY params = method->GetParameters();
25 long paramCount = GetSafeArrayLen(params);
26
27 if (method->IsStatic && wcscmp(name.GetBSTR(), methodName) == 0 && paramCount == pcount)
28 {
29 ret = method;
30 break;
31 }
32 }
33 }
34
35 SafeArrayDestroy(methods);
36
37 return ret;
38 }
39
40mscorlib::_MethodInfoPtr DotNetInterop::GetStaticMethodLoad(mscorlib::_TypePtr type, LPCWSTR methodName, int pcount) {
41

Callers

nothing calls this directly

Calls 1

GetSafeArrayLenFunction · 0.85

Tested by

no test coverage detected