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

    [C++] Simple Scanning Memory and Reading

    A simple function to search through a defined section of memory. This should not be used for large memory searches. This code assumes you are injected into the process.

    Простой пример поиск определенного значения в памяти

     DWORD __inline MemorySearch(DWORD dwSearchStart, int iSearchLength, BYTE *search, int iSearchSize)
    {

    unsigned char *ptr = (unsigned char *)dwSearchStart;
    unsigned char *ss;
    for (int i=0; i< (int) iSearchLength;i++)
    {
    if (memcmp(ptr+i,search,iSearchSize) == 0) {
    return (i);
    }
    }
    return NULL;
    }



    Simple code bit to retrieve a value using a pointer + offset model. This code assumes you are injected into the process.

    Пример кода получения определенного значения из памяти через указатель
     int static GetDword(DWOR charPtr, DWORD offset)
    {
    try{
    DWORD *ptr = NULL;
    ptr = (DWORD *)(charPtr+offset);
    return *ptr;
    }
    catch( char * str ) {
    return 1; // Return whatever error value you want.
    }
    }
    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
  •