| 799 | } |
| 800 | |
| 801 | bool ProcessAccessHelp::createBackupFile(const WCHAR * filePath) |
| 802 | { |
| 803 | size_t fileNameLength = wcslen(filePath) + 5; //.bak + null |
| 804 | BOOL retValue = 0; |
| 805 | |
| 806 | WCHAR * backupFile = new WCHAR[fileNameLength]; |
| 807 | |
| 808 | wcscpy_s(backupFile, fileNameLength, filePath); |
| 809 | wcscat_s(backupFile, fileNameLength, L".bak"); |
| 810 | retValue = CopyFile(filePath, backupFile, FALSE); |
| 811 | |
| 812 | if (!retValue) |
| 813 | { |
| 814 | #ifdef DEBUG_COMMENTS |
| 815 | Scylla::debugLog.log(L"createBackupFile :: CopyFile failed with error 0x%X", GetLastError()); |
| 816 | #endif |
| 817 | } |
| 818 | |
| 819 | delete [] backupFile; |
| 820 | |
| 821 | return retValue != 0; |
| 822 | } |
| 823 | |
| 824 | DWORD ProcessAccessHelp::getModuleHandlesFromProcess(const HANDLE hProcess, HMODULE ** hMods) |
| 825 | { |