| 213 | PRINT(" Password: %s\n", password); |
| 214 | } |
| 215 | void ReadStringTodesk(HANDLE hProcess, TodeskString string, int64_t address) { |
| 216 | unsigned char* buf = (unsigned char*)malloc(string.len + 1); |
| 217 | if (string.len < 0x10) { |
| 218 | if (buf == 0 || !ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(address), buf, string.len + 1, nullptr)) { |
| 219 | PRINT("Failed to read todesk value"); |
| 220 | free(buf); |
| 221 | return; |
| 222 | } |
| 223 | } |
| 224 | else { |
| 225 | if (buf == 0 || !ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(string.string_part_1), buf, string.len + 1, nullptr)) { |
| 226 | PRINT("Failed to read todesk value"); |
| 227 | free(buf); |
| 228 | return; |
| 229 | } |
| 230 | } |
| 231 | PRINT("%s\n", buf); |
| 232 | } |
| 233 | void ReadStringTodeskPath(HANDLE hProcess, TodeskString string) { |
| 234 | unsigned char* buf = (unsigned char*)malloc(string.len + 1); |
| 235 | if (buf == 0 || !ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(string.string_part_1), buf, string.len + 1, nullptr)) { |
no outgoing calls
no test coverage detected