* @brief Implementation of eq function (Physical Memory) * * @param Address * @param Value * @param HasError * @return BOOLEAN */
| 162 | * @return BOOLEAN |
| 163 | */ |
| 164 | BOOLEAN |
| 165 | ScriptEngineFunctionEqPa(UINT64 Address, QWORD Value, BOOL * HasError) |
| 166 | { |
| 167 | UNREFERENCED_PARAMETER(HasError); |
| 168 | |
| 169 | #ifdef SCRIPT_ENGINE_KERNEL_MODE |
| 170 | |
| 171 | if (!CheckAddressPhysical(Address)) |
| 172 | { |
| 173 | // |
| 174 | // Instead of indicating an error, just return false |
| 175 | // to assign it as a return result to a variable |
| 176 | // |
| 177 | // *HasError = TRUE; |
| 178 | |
| 179 | return FALSE; |
| 180 | } |
| 181 | |
| 182 | #endif // SCRIPT_ENGINE_KERNEL_MODE |
| 183 | |
| 184 | #ifdef SCRIPT_ENGINE_USER_MODE |
| 185 | |
| 186 | ShowMessages("err, using physical address functions (eq_pa) is not possible in user-mode\n"); |
| 187 | return FALSE; |
| 188 | |
| 189 | #endif // SCRIPT_ENGINE_USER_MODE |
| 190 | |
| 191 | #ifdef SCRIPT_ENGINE_KERNEL_MODE |
| 192 | MemoryMapperWriteMemorySafeByPhysicalAddress(Address, (UINT64)&Value, sizeof(QWORD)); |
| 193 | #endif // SCRIPT_ENGINE_KERNEL_MODE |
| 194 | |
| 195 | return TRUE; |
| 196 | } |
| 197 | |
| 198 | /** |
| 199 | * @brief Implementation of ed function (Physical Memory) |
no test coverage detected