Guest User

Untitled

a guest
Aug 6th, 2014
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1.     /* Get symbol */
  2.     case 2: ;
  3.       /* Identify the RPL name and symbol name */
  4.       char *rplname = (char*) &buffer[3];
  5.       char *symname = (char*) ((unsigned char*)&buffer[0]) + buffer[2];
  6.  
  7.       /* Get the symbol and store it in the buffer */
  8.       unsigned int module_handle, function_address;
  9.       OSDynLoad_Acquire(rplname, &module_handle);
  10.       /* Only handles MEMAllocFromDefaultHeapEx... edit as needed. */
  11.       if (symname = "MEMAllocFromDefaultHeapEx") {     
  12.         unsigned int *ptr;
  13.         void* (*MEMAllocFromDefaultHeapEx)(unsigned int size, unsigned int align);
  14.         OSDynLoad_FindExport(module_handle, 1, "MEMAllocFromDefaultHeapEx", &ptr);
  15.         MEMAllocFromDefaultHeapEx = *ptr;
  16.         buffer[1]=*ptr;
  17.         }
  18.       else {
  19.         OSDynLoad_FindExport(module_handle, 0, symname, &function_address);
  20.         buffer[1] = function_address;
  21.         }
  22.       /* Send the buffer back */
  23.       send(rpc, buffer, 512, 0);
  24.  
  25.       break;
Advertisement
Add Comment
Please, Sign In to add comment