MCPcopy Create free account
hub / github.com/Compiled-Code/eac-mapper / mapped

Function mapped

core.cpp:38–56  ·  view source on GitHub ↗

the function that will be mapped into the driver

Source from the content-addressed store, hash-verified

36
37// the function that will be mapped into the driver
38NTSTATUS 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
58int main( )
59{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected