the function that will be mapped into the driver
| 36 | |
| 37 | // the function that will be mapped into the driver |
| 38 | NTSTATUS mapped( const data_t& data ) |
| 39 | { |
| 40 | void* from_process = nullptr, *to_process = nullptr; |
| 41 | |
| 42 | // obtain the process objects |
| 43 | if ( !NT_SUCCESS( data.ps_lookup_process_by_process_id( data.from_pid, from_process ) ) || !NT_SUCCESS( data.ps_lookup_process_by_process_id( data.to_pid, to_process ) ) ) |
| 44 | return STATUS_INVALID_PARAMETER; |
| 45 | |
| 46 | // copy the memory |
| 47 | std::size_t size; |
| 48 | if ( !NT_SUCCESS( data.mm_copy_virtual_memory( from_process, data.from_address, to_process, data.to_address, data.size, 1, size ) ) ) |
| 49 | return STATUS_INVALID_PARAMETER; |
| 50 | |
| 51 | // dereference the objects |
| 52 | data.obf_dereference_object( from_process ); |
| 53 | data.obf_dereference_object( to_process ); |
| 54 | |
| 55 | return STATUS_SUCCESS; |
| 56 | } |
| 57 | |
| 58 | int main( ) |
| 59 | { |
nothing calls this directly
no outgoing calls
no test coverage detected