[Source] Anti DLL Injection

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Apprentice eBoxEvo is offline
    MemberRank
    Apr 2011 Join Date
    BrasilLocation
    11Posts

    [Source] Anti DLL Injection

    Code:
    #include <windows.h>
    
    DWORD g_dwLoadLibraryAJMP;
    
    /* HOOK FUNCTION */
    
    DWORD WINAPI jumphook( DWORD AddressToPerformJump, DWORD AddressOfMyFunction, DWORD LenghOfTheAreaToPerformTheJump	)
    {
    	if( LenghOfTheAreaToPerformTheJump < 5 )
    		return 0;
    
    	DWORD RelativeJump, 
    		  NextInstructionAddress,
    		  Flag;
    
    	if ( ! VirtualProtect((LPVOID)AddressToPerformJump, LenghOfTheAreaToPerformTheJump, PAGE_EXECUTE_READWRITE, &Flag) )
    		return 0;
    
    	NextInstructionAddress = AddressToPerformJump + LenghOfTheAreaToPerformTheJump;
    
    	*(BYTE*)AddressToPerformJump = 0xE9;
    
    	for( DWORD i = 5; i < LenghOfTheAreaToPerformTheJump; i++)
    		*(BYTE*)(AddressToPerformJump+i) = 0x90;
    
    	RelativeJump = AddressOfMyFunction - AddressToPerformJump - 0x5;
    
    	*(DWORD*)(AddressToPerformJump + 0x1) = RelativeJump;
    
    	VirtualProtect((LPVOID)AddressToPerformJump, LenghOfTheAreaToPerformTheJump, Flag, &Flag);
    
    	return NextInstructionAddress; 
    }
    
    /* END HOOK FUNCTION */
    
    HMODULE WINAPI hLoadLibraryA( LPCSTR lpLibFileName )
    {	
    	__asm
    	{
    		mov eax, dword ptr ss:[esp + 0x18]
    		cmp dword ptr ds:[eax-0x12], 0x8B55FF8B
    		je erro
    	}
    	
    
    	if( lpLibFileName )
    	{
    		if( !strcmp( lpLibFileName, "twain_32.dll" ) )
    			__asm jmp g_dwLoadLibraryAJMP
    	}			
    
    	return LoadLibraryExA( lpLibFileName, 0, 0 );
    
    erro:
    
    	/* dll injetada */
    
    
    	ExitProcess( 0 );
    
    	return 0;
    }
    
    void ZPerformHooks()
    {
    	g_dwLoadLibraryAJMP = (DWORD)GetModuleHandle( "kernel32" ) + 0x6E2A1;
    
    	jumphook( (DWORD)LoadLibraryA, (DWORD)&hLoadLibraryA, 57 );
    }


  2. #2
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: [Source] Anti DLL Injection

    Details such as 07, 08, and such?

  3. #3
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [Source] Anti DLL Injection

    I don't think it wud matter what version of gunz you have, anti dll injection checks the process instead of the runnable I THINK, though im not 100% sure, so yea lol w/e ...

  4. #4
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: [Source] Anti DLL Injection

    i'm 99,99% sure this can be used on all versions. This will block LoadLiberyA.
    But its easy to bypass for advance people.

  5. #5
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: [Source] Anti DLL Injection

    Quote Originally Posted by Rotana View Post
    i'm 99,99% sure this can be used on all versions. This will block LoadLiberyA.
    But its easy to bypass for advance people.

    Wouldn't blocking LoadLibraryA be a bad thing? Since other dlls use it?

    or couldn't you change it to be a different one?

  6. #6
    Ecchi addicted adz28 is offline
    MemberRank
    Nov 2008 Join Date
    IkebukuroLocation
    524Posts

    Re: [Source] Anti DLL Injection

    Like kernel blocking, i guess youre right, this would crash the game, i guess.

  7. #7
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: [Source] Anti DLL Injection

    After this dll is loaded it will block the fuction for the process.
    Other dlls such as fmod.dll must be loaded first then inject this to prevent errors.

    So you can bypass it by hook your hack/addon on fmod or an d3d9.dll
    Last edited by Rotana; 10-08-11 at 02:31 PM. Reason: added some bypass info

  8. #8
    Proficient Member steven1234 is offline
    MemberRank
    Jan 2010 Join Date
    186Posts

    Re: [Source] Anti DLL Injection

    md5 check them lol thanks for this

  9. #9
    Apprentice eBoxEvo is offline
    MemberRank
    Apr 2011 Join Date
    BrasilLocation
    11Posts

    Re: [Source] Anti DLL Injection

    Quote Originally Posted by ForeanXz View Post
    Details such as 07, 08, and such?
    works on 07 & 08.

  10. #10
    Freelance GunZ Developer Touchwise is offline
    MemberRank
    Aug 2009 Join Date
    The NetherlandsLocation
    754Posts

    Re: [Source] Anti DLL Injection

    Nice but you shouldn't use it as your whole antihack...
    Atleast put a MD5 check on it and well with some extra work on this this could grow out to something

  11. #11
    Apprentice xuxero is offline
    MemberRank
    Dec 2010 Join Date
    U.S.ALocation
    19Posts

    Re: [Source] Anti DLL Injection

    Nice (Y)
    Last edited by xuxero; 10-08-11 at 10:37 PM.

  12. #12
    Enthusiast espanish is offline
    MemberRank
    Aug 2010 Join Date
    36Posts

    Re: [Source] Anti DLL Injection

    LOL This is my code, of my guard named Condom Guard, how this will appear here. o_o

  13. #13
    Banned mhmd135 is offline
    BannedRank
    Jul 2010 Join Date
    437Posts

    Re: [Source] Anti DLL Injection

    does it block dlls like fmod.dll and other ?

  14. #14
    GunZ Developer dacharles is offline
    MemberRank
    Oct 2006 Join Date
    476Posts

    Re: [Source] Anti DLL Injection

    and what is this?
    Code:
    mov eax, dword ptr ss:[esp + 0x18]
    cmp dword ptr ds:[eax-0x12], 0x8B55FF8B
    why he compares that? what is on eax-0x12?

  15. #15
    I like pie OJuice is offline
    MemberRank
    Jul 2011 Join Date
    205Posts

    Re: [Source] Anti DLL Injection

    great release thanks =)



Page 1 of 2 12 LastLast

Advertisement