| 82 | } |
| 83 | |
| 84 | static int ps3mapi_get_memory(u32 pid, u32 address, char *mem, u32 size) |
| 85 | { |
| 86 | if(pid == LV1) |
| 87 | { |
| 88 | peek_chunk_lv1((address | BASE_MEMORY), size, (u64*)mem); |
| 89 | } |
| 90 | else if(pid == LV2) |
| 91 | { |
| 92 | peek_chunk_lv2((address | BASE_MEMORY), size, (u64*)mem); |
| 93 | } |
| 94 | else if(pid == FLASH) |
| 95 | { |
| 96 | peek_chunk_flash(address, size, (u64*)mem); |
| 97 | } |
| 98 | else if(pid < PID) |
| 99 | { |
| 100 | u64 device = (pid >= 10) ? (0x103000000000000ULL | pid): // USB |
| 101 | (0x101000000000000ULL | pid); // HDD |
| 102 | peek_chunk_device(device, address, size, (u64*)mem); |
| 103 | } |
| 104 | #ifdef PS3MAPI |
| 105 | else |
| 106 | { |
| 107 | #define PS3MAPI_OPCODE_GET_PROC_MEM 0x0031 |
| 108 | |
| 109 | system_call_6(SC_COBRA_SYSCALL8, SYSCALL8_OPCODE_PS3MAPI, PS3MAPI_OPCODE_GET_PROC_MEM, (u64)pid, (u64)address, (u64)(u32)mem, size); |
| 110 | return (int)p1; |
| 111 | } |
| 112 | #endif |
| 113 | return 0; |
| 114 | } |
| 115 | |
| 116 | static void ps3mapi_dump_process(const char *dump_file, u32 pid, u32 address, u32 size) |
| 117 | { |
no test coverage detected