| 32 | } |
| 33 | |
| 34 | bool kdmUtils::CreateFileFromMemory(const std::wstring& desired_file_path, const char* address, size_t size) { |
| 35 | std::ofstream file_ofstream(desired_file_path.c_str(), std::ios_base::out | std::ios_base::binary); |
| 36 | |
| 37 | if (!file_ofstream.write(address, size)) { |
| 38 | file_ofstream.close(); |
| 39 | return false; |
| 40 | } |
| 41 | |
| 42 | file_ofstream.close(); |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | uint64_t kdmUtils::GetKernelModuleAddress(const std::string& module_name) { |
| 47 | void* buffer = nullptr; |