Results 1 to 5 of 5
  1. #1
    teh1337pr0's Avatar
    Join Date
    Apr 2009
    Posts
    13
    Reputation
    10
    Thanks
    5

    punkbuster blackscreenshot!

    Hey all,

    Punkbuster have changed their screenshot routine a few months back (I think), they are no longer using GetForegroundWindow() so the older methods don't work. To fix this, I hook the api function GetWindowThreadProcessId by modifing the IAT of the PBCL module and redirecting the function to our own. Then, we return null to get a blank. Tested on COD2/COD4, worked fine. Code below:

    Code:
    #include <windows.h>
    #include <stdio.h>
    
    // credits to osGB writers / temp2 for highlighting the func 
    DWORD xx IATHook(charxx DllWhichImports, charxx DllImportsFrom, charxx OldFunctionName)
    {
        DWORD dwIndex;
        DWORD dwOffset;
        HMODULE hDllWhichImports;
        PIMAGE_DATA_DIRECTORY pDataDirectory;
        PIMAGE_DOS_HEADER pDosHeader;
        PDWORD pdwIAT;
        PDWORD pdwINT;
        PIMAGE_IMPORT_DESCRIPTOR pImportDescriptor;
        PIMAGE_IMPORT_BY_NAME pImportName;
        PIMAGE_OPTIONAL_HEADER pOptionalHeader;
        PIMAGE_NT_HEADERS pPeHeader;
        PSTR strCurrent;
        hDllWhichImports = GetModuleHandleA(DllWhichImports);
    
        if(!hDllWhichImports) return NULL;
              
        pDosHeader = PIMAGE_DOS_HEADER(hDllWhichImports);
        dwOffset = pDosHeader->e_lfanew;
        pPeHeader = PIMAGE_NT_HEADERS(long(hDllWhichImports) + dwOffset);
        pOptionalHeader = &pPeHeader->OptionalHeader;
        pDataDirectory = pOptionalHeader->DataDirectory;
        dwOffset = pDataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
        pImportDescriptor = PIMAGE_IMPORT_DESCRIPTOR(long(hDllWhichImports) + dwOffset);
        for(dwIndex = 0; true; dwIndex++)
        {
            dwOffset = pImportDescriptor[dwIndex].Name;
            if (!dwOffset) return NULL;
            strCurrent = PSTR(long(hDllWhichImports) + dwOffset);
            if(stricmp(strCurrent, DllImportsFrom) == 0) break;
        } 
        dwOffset = pImportDescriptor[dwIndex].FirstThunk;
        pdwIAT = PDWORD(long(hDllWhichImports) + dwOffset);
        dwOffset = pImportDescriptor[dwIndex].OriginalFirstThunk;
        pdwINT = PDWORD(long(hDllWhichImports) + dwOffset);
        for(dwIndex = 0; true; dwIndex++)
        {
            dwOffset = pdwINT[dwIndex];
            if (!dwOffset) return NULL;
            pImportName = PIMAGE_IMPORT_BY_NAME(long(hDllWhichImports) + dwOffset);
            strCurrent = PSTR(pImportName->Name);
            if(stricmp(strCurrent, OldFunctionName) == 0)
            {
                return &pdwIAT[dwIndex];
            }
        }
        return NULL;
    }  
    
    /xx Our cloned func, we direct the calls to this and return null for blankies xx/ 
    DWORD MyGetWindowThreadProcessId(HWND hWnd,LPDWORD lpdwProcessId)
    {
      return NULL; 
    }
    
    /xx DLL Main, Hook is performed here... xx/ 
    BOOL APIENTRY DllMain(HMODULE hDll, DWORD dwReason, PVOID lpReserved) 
    {
        if(dwReason == DLL_PROCESS_ATTACH)
        {
            DisableThreadLibraryCalls(hDll);
    
            DWORD dwBackup;
            DWORD dwOffset;
            DWORD xxdwAddress = IATHook("pbcl.dll", "user32.dll", "GetWindowThreadProcessId");
    
            if (dwAddress)
            {
                VirtualProtect(dwAddress, sizeof(DWORD), PAGE_READWRITE, &dwBackup);
                xxdwAddress = PtrToUlong((DWORD)&MyGetWindowThreadProcessId);
                VirtualProtect(dwAddress, sizeof(DWORD), dwBackup, &dwOffset);
                dwAddress = NULL;
            }
    
    
        }
        return 0x1; 
    }

  2. The Following User Says Thank You to teh1337pr0 For This Useful Post:

    LGB (09-20-2009)

  3. #2
    PlSlYlClHlO's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Posts
    52
    Reputation
    10
    Thanks
    2
    Mine works too.

    Did it a bit differently.. i dont really wanna post the source for it.. kinda working on a full-on Bonafide PB Bypass.

    I'll probably make my Bypass Public when im finished..

    What i did in mine, is basically just NOP'd the screenshot process.


    But Great post, and thank's for sharing.

    Edit: I'm also quite fond of just Hooking the process.
    Last edited by PlSlYlClHlO; 06-04-2009 at 03:53 AM.

  4. #3
    geebes888's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    144
    Reputation
    10
    Thanks
    17
    My Mood
    Sneaky
    cool good 1
    [IMG]https://i644.photobucke*****m/albums/uu165/geebes888/V1.png[/IMG]

    -Advertisements(Permanent ban)
    -Flaming(1+ day ban)
    -Nazi or Racist content/comments ( 5+ day ban)
    -Bumping old threads 1 week or older( 3 day ban)
    -Using outside download sources "Links"( 3+ day ban)
    -Spamming( 1+ day ban) -Begging for hacks ( 1 day ban)-
    No virus scan( 1 day ban)
    -Fake VirusScan ( 7+ day ban) -Posting Viruses,keyloggers (permanent ban) -
    Disrespect of Staff members (5+ day ban)




    OMfG i hate hate noobs that ask for hacks they shuld just go in a hole and die

    Thank me if i helped, or just thank me anyway


    [Respect list]

    Toymaker- for his crack hacking team.

    [MPGH]-XpliCitt-

    [MPGH]User1

    [MPGH]Liz

    [MPGH]Whitten

  5. #4
    LGB's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    1
    My Mood
    Tired
    hey people could you please teach me how to use that code?
    idk where to put it please

  6. #5
    Tierrize's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    C:\MPGH\General
    Posts
    1,020
    Reputation
    -6
    Thanks
    90
    My Mood
    Amused
    Look At The Date Guy ^^^^
    [IMG]https://i324.photobucke*****m/albums/k357/Win32Trojan/Untitled-1-4.gif[/IMG][IMG]https://i324.photobucke*****m/albums/k357/Win32Trojan/Untitled-1-4.gif[/IMG][IMG]https://i324.photobucke*****m/albums/k357/Win32Trojan/Untitled-1-4.gif[/IMG]

    Hazedup is the best there ever was

Similar Threads

  1. Punkbuster ONOZ!
    By NukeAssault in forum WarRock - International Hacks
    Replies: 20
    Last Post: 06-25-2007, 08:06 PM
  2. Punkbuster Has Arrived (BYPASS)
    By DanangKid in forum WarRock - International Hacks
    Replies: 49
    Last Post: 05-09-2007, 10:15 AM
  3. What r we gonna do when Punkbuster comes out
    By whatthe in forum WarRock - International Hacks
    Replies: 25
    Last Post: 07-09-2006, 10:09 PM
  4. NFV2 Bypass --> WHAT ABOUT PUNKBUSTER??!??
    By menenl in forum WarRock - International Hacks
    Replies: 2
    Last Post: 06-10-2006, 08:29 PM
  5. Punkbuster for warrock is here!
    By Woodly in forum WarRock - International Hacks
    Replies: 4
    Last Post: 06-06-2006, 06:48 PM

Tags for this Thread