コード例 #1
0
void ConsumerParserClass::Print(const wchar_t* outlog, const wchar_t* path, const wchar_t* szNamespace, const wchar_t* szType, const wchar_t* szInstance) {
  FILE* out = CreateLogFile(outlog, L"at, ccs=UNICODE");
  std::vector<DWORD> *allocMap = Map.GetDataAllocMap();
  if (allocMap) {
    MyPrintFunc(out, L"==== %s\\%s\\%s====\n", szNamespace, szType, szInstance);
    std::vector<InstanceStruct>::iterator it = Consumers.begin();
    for (; it != Consumers.end(); ++it) {
      MyPrintFunc(out, L"[%S]:\nConsumer:(%.8X.%.8X.%.8X)\n", it->InstanceID, it->Location.LogicalID, it->Location.RecordID, it->Location.Size);
      EventConsumer* p = EventConsumer::Create(m_ObjFile, *allocMap, *it, szType, m_bXP);
      if (p) {
        p->Print(m_ObjFile, out);
        delete p;
        if (szType && szInstance) {
          std::vector<InstanceStruct> bindings;
          if (GetConsumerBinding(path, szNamespace, szType, *allocMap, *it, bindings)) {
            std::vector<InstanceStruct>::iterator bindit = bindings.begin();
            for (; bindit != bindings.end(); ++bindit) {
              MyPrintFunc(out, L"[%S]:\nBinding:(%.8X.%.8X.%.8X)\n", bindit->InstanceID, bindit->Location.LogicalID, bindit->Location.RecordID, bindit->Location.Size);
              FilterToConsumerBindingClass*b = FilterToConsumerBindingClass::Create(m_ObjFile, *allocMap, *bindit, m_bXP);
              if (b) {
                b->Print(m_ObjFile, out);
                delete b;
              }
            }
          }
        }
      }
    }
    MyPrintFunc(out, L"=============================================================================\n");
    if (out)
      ::fclose(out);
  }
}
コード例 #2
0
void EventConsumer::Print(HANDLE hFile, FILE *out) {
  __super::Print(hFile, out);
  MyPrintFunc(out, L"CreatorSID: ");
  CreatorSID.Print(hFile, out);
  MyPrintFunc(out, L"MachineName: ");
  MachineName.Print(hFile, out);
  MyPrintFunc(out, L"MaximumQueueSize: ");
  MaximumQueueSize.Print(out);
}
コード例 #3
0
ファイル: Namespace.cpp プロジェクト: 0xF2EDCA5A/flare-wmi
void WMINamespaceClass::Print(const wchar_t *outlog) {
  FILE* out = CreateLogFile(outlog, L"at, ccs=UNICODE");
  MyPrintFunc(out, L"===============================Namespaces=========================\n");
  std::vector<std::wstring>::iterator it = NamespaceNames.begin();
  std::wstring strID;
  for (; it != NamespaceNames.end(); ++it) {
    GetWStrId(strID, *it, m_bXP);
    MyPrintFunc(out, L"%s (NS_%s)\n", it->c_str(), strID.c_str());
  }
  MyPrintFunc(out, L"==================================================================\n");
  if (out)
    ::fclose(out);
}
コード例 #4
0
ファイル: WMIParser.cpp プロジェクト: fireeye/flare-wmi
void PrintCommand(const wchar_t *path, const wchar_t * cmd) {
  if (path && *path && cmd && *cmd) {
    FILE *f = CreateLogFile(path, L"at, ccs=UNICODE");
    if (f) {
      MyPrintFunc(f, L"\r\nCommand > %s\r\n", cmd);
      ::fclose(f);
    }
    else
      wprintf_s(L"PrintCommand failed to PrintCommand cmd (%s) to log file (%s)\r\n", cmd, path);
  }
}
コード例 #5
0
ファイル: WMIParser.cpp プロジェクト: fireeye/flare-wmi
void CreateOutputLog(const wchar_t *path) {
  if (path && *path) {
    FILE *f = CreateLogFile(path, L"wt, ccs=UNICODE");
    if (f) {
      MyPrintFunc(f, L"Log Created : %s\r\n", path);
      ::fclose(f);
    }
    else
      wprintf_s(L"CreateOutputLog failed to create log file (%s)\r\n", path);
  }
}
コード例 #6
0
void ConsumerParserClass::Print(const wchar_t* outlog, const wchar_t* szNamespace, const wchar_t* szType) {
  FILE* out = CreateLogFile(outlog, L"at, ccs=UNICODE");
  std::vector<DWORD> *allocMap = Map.GetDataAllocMap();
  if (allocMap) {
    if (szType)
      MyPrintFunc(out, L"==== %s in namespace %s ====\n", szType, szNamespace);
    else
      MyPrintFunc(out, L"==== Consumers in namespace %s ====\n", szNamespace);
    std::vector<InstanceStruct>::iterator it = Consumers.begin();
    for (; it != Consumers.end(); ++it) {
      MyPrintFunc(out, L"[%S]:\nConsumer:(%.8X.%.8X.%.8X)\n", it->InstanceID, it->Location.LogicalID, it->Location.RecordID, it->Location.Size);
      EventConsumer* p = EventConsumer::Create(m_ObjFile, *allocMap, *it, szType, m_bXP);
      if (p) {
        p->Print(m_ObjFile, out);
        delete p;
      }
    }
    MyPrintFunc(out, L"=============================================================================\n");
    if (out)
      ::fclose(out);
  }
}