Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Get symbol */
- case 2: ;
- /* Identify the RPL name and symbol name */
- char *rplname = (char*) &buffer[3];
- char *symname = (char*) ((unsigned char*)&buffer[0]) + buffer[2];
- /* Get the symbol and store it in the buffer */
- unsigned int module_handle, function_address;
- OSDynLoad_Acquire(rplname, &module_handle);
- /* Only handles MEMAllocFromDefaultHeapEx... edit as needed. */
- if (symname = "MEMAllocFromDefaultHeapEx") {
- unsigned int *ptr;
- void* (*MEMAllocFromDefaultHeapEx)(unsigned int size, unsigned int align);
- OSDynLoad_FindExport(module_handle, 1, "MEMAllocFromDefaultHeapEx", &ptr);
- MEMAllocFromDefaultHeapEx = *ptr;
- buffer[1]=*ptr;
- }
- else {
- OSDynLoad_FindExport(module_handle, 0, symname, &function_address);
- buffer[1] = function_address;
- }
- /* Send the buffer back */
- send(rpc, buffer, 512, 0);
- break;
Advertisement
Add Comment
Please, Sign In to add comment