Results 1 to 1 of 1
  1. #1
    Dwar
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,222
    Thanks Thanks Given 
    211
    Thanks Thanks Received 
    2,230
    Thanked in
    292 Posts
    Rep Power
    10

    [Snippet] Calculating DMA

    DWORD GHL::GetPointer(LPVOID lpAddress, const DWORD *dwOffsetArray, const unsigned int uiArraySize)
    {
    DWORD dwOldProtect, dwTemp;
    for (unsigned int i = 0; i<uiArraySize; i++)
    {
    VirtualProtect(lpAddress, uiArraySize, PAGE_EXECUTE_READWRITE, &dwOldProtect);

    __try
    {
    dwTemp = *(DWORD*)(lpAddress);
    }
    __except (EXCEPTION_EXECUTE_HANDLER)
    {
    dwTemp = NULL;
    lpAddress = NULL;
    return 0;
    }

    VirtualProtect(lpAddress, uiArraySize, dwOldProtect, &dwOldProtect);
    lpAddress = (LPVOID)(dwTemp + dwOffsetArray[i]);
    }
    return (DWORD)lpAddress;
    }

    Author: PoZHx
    Please, post your questions on forum, not by PM or mail

    I spend my time, so please pay a little bit of your time to keep world in equilibrium

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •