MCPcopy Create free account
hub / github.com/Norbyte/ositools / ExtendStoryHeader

Method ExtendStoryHeader

OsiInterface/CustomFunctions.cpp:374–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374void CustomFunctionInjector::ExtendStoryHeader(std::wstring const & headerPath)
375{
376 extendingStory_ = true;
377
378 std::ifstream f(headerPath.c_str(), std::ios::in | std::ios::binary);
379 f.seekg(0, std::ios::end);
380 auto length = f.tellg();
381 f.seekg(0, std::ios::beg);
382 std::string s(length, '\0');
383 f.read(const_cast<char *>(s.data()), length);
384 f.close();
385
386 auto headers = functions_.GenerateHeaders();
387 Debug("CustomFunctionInjector::ExtendStoryHeader(): Appending to header:\r\n");
388 // TODO - if debug?
389 OutputDebugStringA(headers.c_str());
390 std::cout << headers << std::endl;
391 s += headers;
392
393 std::ofstream wf(headerPath.c_str(), std::ios::out | std::ios::binary);
394 wf.write(s.data(), s.size());
395 wf.close();
396
397 extendingStory_ = false;
398}
399
400void CustomFunctionInjector::OnCreateFile(LPCWSTR lpFileName,
401 DWORD dwDesiredAccess,

Callers

nothing calls this directly

Calls 2

DebugFunction · 0.85
GenerateHeadersMethod · 0.80

Tested by

no test coverage detected