Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. float ReadFloat(int processId, DWORD address)
  2. {
  3. ULONG ulPtr = NULL;
  4. DWORD dwBytesRead = 0;
  5. uint8_t buf[0x1000] = { 0 };
  6. COPY_MEMORY copyMem;// = new COPY_MEMORY();
  7. copyMem.pid = processId;
  8. copyMem.targetPtr = address;
  9. copyMem.localbuf = (ULONGLONG)buf;
  10. copyMem.size = 4;
  11. copyMem.write = FALSE;
  12.  
  13.  
  14. DeviceIoControl(hDevice, IOCTL_Memory, &copyMem, sizeof(copyMem), &ulPtr, sizeof(ulPtr), &dwBytesRead, NULL);
  15. //printf("Message received from kerneland : %x\n", ulPtr);
  16. //printf("Bytes read : %d\n", dwBytesRead);
  17. return *(float*)(&ulPtr);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement