Results 1 to 8 of 8
  1. #1
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty

    Any Reason this might not be working

    So I was working on a bypass for Project Blackout's Hackshield. I'm trying to just stop if from being initialized, since the main executable has no protection I thought I would start with that. However I loaded PBlackout.exe up in Olly and noticed the addresses I coded to change, were not being changed at all. Is this just something with Olly, or is this code just wrong?
    Code:
    #include <windows.h>
    BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
    {
    	unsigned char* Patch1 = (unsigned char*)(LPVOID)0x402D5F;
    	unsigned char* Patch2 = (unsigned char*)(LPVOID)0x402D66;
    	unsigned char* Patch3 = (unsigned char*)(LPVOID)0x402DA2;
    	DWORD* OldProtect = NULL;
    	switch(fdwReason)
    	{
    		case DLL_PROCESS_ATTACH:
    			
    			while(!GetModuleHandleA("PBlackout.exe"))
    			VirtualProtect((LPVOID)0x402D5F, 0x100, PAGE_EXECUTE_READWRITE, OldProtect);
    			Patch1[0] = 0x90; Patch1[1] = 0x90; Patch1[2] = 0x90; Patch1[3] = 0x90; Patch1[4] = 0x90; //NOP call
    			Patch2[0] = 0xEB; //Always jump
    			Patch3[0] = 0xEB; //Always jump
    			VirtualProtect((LPVOID)0x402D5F, 0x100, *OldProtect, NULL);
    			break;
    
    		case DLL_PROCESS_DETACH:
    			break;
    	}
    	return true;
    }

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Did you attach olly before or after modifying it?
    Ah we-a blaze the fyah, make it bun dem!

  3. #3
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    well before because if If I did it after Themida would detect me, because it didn't work

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  4. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    __asm INT3; and use olly to see if it's writing properly or not?
    Ah we-a blaze the fyah, make it bun dem!

  5. The Following User Says Thank You to Hell_Demon For This Useful Post:

    why06 (03-16-2011)

  6. #5
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Quote Originally Posted by why06 View Post
    well before because if If I did it after Themida would detect me, because it didn't work
    Can you access the memory at all? Try checking your return values. Maybe the game has it's own SEH and windows will therefore not report any access violations.

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  7. The Following User Says Thank You to .::SCHiM::. For This Useful Post:

    why06 (03-16-2011)

  8. #6
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Thanks for the advice guys, I did the next best thing to an INT3, and set a MessageBox, which froze the program at Dll Entry, looks like I have an access violation, I wonder why though, since I used Virtual Protect.

    EDIT: Okay looked over the API, loosk like Im using VP wrong my bad, seems like if you put a NULL value in for DWORD* for OldProtect the function fails. So I declared OldProtect like so: DWORD OldProtect; and am just referencing it now. I also fixed the second VirtualProtect too, lets see if this works now. =)

    EDIT: Aww damn it was working, but something weird happened. The Patch Succeeded and everything, but then the DLL got a second DLL_ATTACH message, then Hackshield loaded up, maybe something detecting it idk...
    Last edited by why06; 03-15-2011 at 02:31 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  9. #7
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by why06 View Post
    Thanks for the advice guys, I did the next best thing to an INT3, and set a MessageBox, which froze the program at Dll Entry, looks like I have an access violation, I wonder why though, since I used Virtual Protect.

    EDIT: Okay looked over the API, loosk like Im using VP wrong my bad, seems like if you put a NULL value in for DWORD* for OldProtect the function fails. So I declared OldProtect like so: DWORD OldProtect; and am just referencing it now. I also fixed the second VirtualProtect too, lets see if this works now. =)

    EDIT: Aww damn it was working, but something weird happened. The Patch Succeeded and everything, but then the DLL got a second DLL_ATTACH message, then Hackshield loaded up, maybe something detecting it idk...
    You get a DLL Attach message whenever a DLL is attached (loaded). You can use DisableThreadLibraryCalls() to disable these notifications to your module. I think that's the function name anyway.

  10. The Following 2 Users Say Thank You to freedompeace For This Useful Post:

    Hell_Demon (03-16-2011),why06 (03-16-2011)

  11. #8
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by freedompeace View Post


    You get a DLL Attach message whenever a DLL is attached (loaded). You can use DisableThreadLibraryCalls() to disable these notifications to your module. I think that's the function name anyway.
    Yep, it is

    DisableThreadLibraryCalls(hModule); where hModule is the HMODULE argument of DllMain
    Ah we-a blaze the fyah, make it bun dem!