Results 1 to 3 of 3
  1. #1
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    6,285
    Reputation
    435
    Thanks
    3,715
    My Mood
    Doh

    Some help for the section, HideDLL, FindDevice, Encrypt/Decrypt, Full vTable and more

    got an old base (i have like 60 of em, so i never know what i'll find LOL).

    I have a feeling that a lot of people "coding" in this section (use the word coding very loosely) don't know much about the vTable, so i did some research, and created a "defines list" for you guys

    vTable d3d9 defines
    Code:
    #define QUERYINTERFACE  0
    #define ADDREF  1
    #define RELEASE  2
    #define TESTCOOPERATIVELEVEL  3
    #define GETAVAILABLETEXTUREMEM  4
    #define EVICTMANAGEDRESOURCES  5
    #define GETDIRECT3D  6
    #define GETDEVICECAPS  7
    #define GETDISPLAYMODE  8
    #define GETCREATIONPARAMETERS  9
    #define SETCURSORPROPERTIES  10
    #define SETCURSORPOSITION  11
    #define SHOWCURSOR  12
    #define CREATEADDITIONALSWAPCHAIN  13
    #define GETSWAPCHAIN  14
    #define GETNUMBEROFSWAPCHAINS  15
    #define RESET  16
    #define PRESENT  17
    #define GETBACKBUFFER  18
    #define GETRASTERSTATUS  19
    #define SETDIALOGBOXMODE  20
    #define SETGAMMARAMP  21
    #define GETGAMMARAMP  22
    #define CREATETEXTURE  23
    #define CREATEVOLUMETEXTURE  24
    #define CREATECUBETEXTURE  25
    #define CREATEVERTEXBUFFER  26
    #define CREATEINDEXBUFFER  27
    #define CREATERENDERTARGET  28
    #define CREATEDEPTHSTENCILSURFACE  29
    #define UPDATESURFACE  30
    #define UPDATETEXTURE  31
    #define GETRENDERTARGETDATA  32
    #define GETFRONTBUFFERDATA  33
    #define STRETCHRECT  34
    #define COLORFILL  35
    #define CREATEOFFSCREENPLAINSURFACE  36
    #define SETRENDERTARGET  37
    #define GETRENDERTARGET  38
    #define SETDEPTHSTENCILSURFACE  39
    #define GETDEPTHSTENCILSURFACE  40
    #define BEGINSCENE  41
    #define ENDSCENE  42
    #define CLEAR  43
    #define SETTRANSFORM  44
    #define GETTRANSFORM  45
    #define MULTIPLYTRANSFORM  46
    #define SETVIEWPORT  47
    #define GETVIEWPORT  48
    #define SETMATERIAL  49
    #define GETMATERIAL  50
    #define SETLIGHT  51
    #define GETLIGHT  52
    #define LIGHTENABLE  53
    #define GETLIGHTENABLE  54
    #define SETCLIPPLANE  55
    #define GETCLIPPLANE  56
    #define SETRENDERSTATE  57
    #define GETRENDERSTATE  58
    #define CREATESTATEBLOCK  59
    #define BEGINSTATEBLOCK  60
    #define ENDSTATEBLOCK  61
    #define SETCLIPSTATUS  62
    #define GETCLIPSTATUS  63
    #define GETTEXTURE  64
    #define SETTEXTURE  65
    #define GETTEXTURESTAGESTATE  66
    #define SETTEXTURESTAGESTATE  67
    #define GETSAMPLERSTATE  68
    #define SETSAMPLERSTATE  69
    #define VALIDATEDEVICE  70
    #define SETPALETTEENTRIES  71
    #define GETPALETTEENTRIES  72
    #define SETCURRENTTEXTUREPALETTE  73
    #define SETSCISSORRECT  75
    #define GETSCISSORRECT  76
    #define SETSOFTWAREVERTEXPROCESSING  77
    #define GETSOFTWAREVERTEXPROCESSING  78
    #define SETNPATCHMODE  79
    #define GETNPATCHMODE  80
    #define DRAWPRIMITIVE  81
    #define DRAWINDEXEDPRIMITIVE  82
    #define DRAWPRIMITIVEUP  83
    #define DRAWINDEXEDPRIMITIVEUP  84
    #define PROCESSVERTICES  85
    #define CREATEVERTEXDECLARATION  86
    #define SETVERTEXDECLARATION  87
    #define GETVERTEXDECLARATION  88
    #define SETFVF  89
    #define GETFVF  90
    #define CREATEVERTEXSHADER  91
    #define SETVERTEXSHADER  92
    #define GETVERTEXSHADER  93
    #define SETVERTEXSHADERCONSTANTF  94
    #define GETVERTEXSHADERCONSTANTF  95
    #define SETVERTEXSHADERCONSTANTI  96
    #define GETVERTEXSHADERCONSTANTI  97
    #define SETVERTEXSHADERCONSTANTB  98
    #define GETVERTEXSHADERCONSTANTB  99
    #define SETSTREAMSOURCE  100
    #define GETSTREAMSOURCE  101
    #define SETSTREAMSOURCEFREQ  102
    #define GETSTREAMSOURCEFREQ  103
    #define SETINDICES  104
    #define GETINDICES  105
    #define CREATEPIXELSHADER  106
    #define SETPIXELSHADER  107
    #define GETPIXELSHADER  108
    #define SETPIXELSHADERCONSTANTF  109
    #define GETPIXELSHADERCONSTANTF  110
    #define SETPIXELSHADERCONSTANTI  111
    #define GETPIXELSHADERCONSTANTI  112
    #define SETPIXELSHADERCONSTANTB  113
    #define GETPIXELSHADERCONSTANTB  114
    #define DRAWRECTPATCH  115
    #define DRAWTRIPATCH  116
    #define DELETEPATCH  117
    #define CREATEQUERY  118


    This is the Helper file i mentioned in the title, might help some of you, although i know a lot of you don't really need it, its good for the people actually trying to learn

    cHelpers.h
    Code:
    #ifndef _CHELPERS_H
    #define _CHELPERS_H
    
    #include <windows.h>
    #include <wininet.h>
    #include <winsock.h>
    #include <urlmon.h>
    #pragma comment(lib, "wininet.lib")
    #pragma comment(lib, "wsock32.lib")
    #pragma comment(lib, "urlmon.lib")
    
    	class cHelper
    	{
    	public:
    		DWORD_PTR * FindDevice(DWORD Base,DWORD Len);
    		VOID HideDLL(HINSTANCE hModule);
    		VOID StarLog(HMODULE hDll);
    		VOID __cdecl cHelper::WriteLog (const char *fmt, ...);
    		CHAR* Decrypt(const char* plaintext);
    		CHAR* Encrypt(const char* plaintext);
    		CHAR * GetTime();
    		BOOL CheckVersion();
    		INT URLGetPage(char *link, char *buffer, int maxsize);
    		BOOL cHelper::_cCompareHost( char *HostName );
    	private:
    		CHAR * GetDirectoryFile(char *filename);
    	};
    
    #endif
    cPragma.h
    Code:
    #ifndef _CPRAGMA_H
    #define _CPRAGMA_H
    
    #pragma warning(disable:4244)
    #pragma warning(disable:4102)
    #pragma warning(disable:4996)
    #pragma warning(disable:4800)
    #pragma warning(disable:4305)
    
    #endif
    cHelpers.cpp
    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <string.h>
    #include <fstream>
    #include <stdio.h>
    #include <time.h>
    #include "cHelpers.h"
    #include "cPragma.h"
    #include "cPragma.h"
    
    
    using namespace std;
    
    void cHelper::HideDLL(HINSTANCE hModule)
    {
    	DWORD dwPEB_LDR_DATA = 0;
    	_asm
    	{
    		pushad;
    		pushfd;
    		mov eax, fs:[30h]             
    		mov eax, [eax+0Ch]               
    		mov dwPEB_LDR_DATA, eax	
    
    		InLoadOrderModuleList:
    			mov esi, [eax+0Ch]	     
    			mov edx, [eax+10h]	     
    
    		LoopInLoadOrderModuleList: 
    		    lodsd		         
    			mov esi, eax	
    			mov ecx, [eax+18h]  
    			cmp ecx, hModule	
    			jne SkipA		 
    		    mov ebx, [eax]	  
    		    mov ecx, [eax+4]  
    		    mov [ecx], ebx    
    		    mov [ebx+4], ecx	  
    			jmp InMemoryOrderModuleList 
    
    		SkipA:
    			cmp edx, esi     
    			jne LoopInLoadOrderModuleList
    
    		InMemoryOrderModuleList:
    			mov eax, dwPEB_LDR_DATA
    			mov esi, [eax+14h]
    			mov edx, [eax+18h]
    
    		LoopInMemoryOrderModuleList: 
    			lodsd
    			mov esi, eax
    			mov ecx, [eax+10h]
    			cmp ecx, hModule
    			jne SkipB
    			mov ebx, [eax] 
    			mov ecx, [eax+4]
    			mov [ecx], ebx
    			mov [ebx+4], ecx
    			jmp InInitializationOrderModuleList
    
    		SkipB:
    			cmp edx, esi
    			jne LoopInMemoryOrderModuleList
    
    		InInitializationOrderModuleList:
    			mov eax, dwPEB_LDR_DATA
    			mov esi, [eax+1Ch]	  
    			mov edx, [eax+20h]	  
    
    		LoopInInitializationOrderModuleList: 
    			lodsd
    			mov esi, eax		
    			mov ecx, [eax+08h]
    			cmp ecx, hModule		
    			jne SkipC
    			mov ebx, [eax] 
    			mov ecx, [eax+4]
    			mov [ecx], ebx
    			mov [ebx+4], ecx
    			jmp Finished
    
    		SkipC:
    			cmp edx, esi
    			jne LoopInInitializationOrderModuleList
    
    		Finished:
    			popfd;
    			popad;
    	}
    }
    
    DWORD * cHelper::FindDevice(DWORD Base,DWORD Len)
    {
    	unsigned long i = 0, n = 0;
    
    	for( i = 0; i < Len; i++ )
    	{
            if(*(BYTE *)(Base+i+0x00)==0xC7)n++;
    	    if(*(BYTE *)(Base+i+0x01)==0x06)n++;
    	    if(*(BYTE *)(Base+i+0x06)==0x89)n++;
    	    if(*(BYTE *)(Base+i+0x07)==0x86)n++;	
            if(*(BYTE *)(Base+i+0x0C)==0x89)n++;
    	    if(*(BYTE *)(Base+i+0x0D)==0x86)n++;
    
    	    if(n == 6) return (DWORD_PTR *)
    			(Base + i + 2);n = 0;
    	}
    	return(0);
    }
    
    CHAR* cHelper::Encrypt(const char* plaintext)
    {
    	int len = strlen(plaintext);
    	char* cyphertext = new char[len+1];
    	for(int i=0 ; i<len ; ++i)
    	{
    		cyphertext[i] = plaintext[i] + 8 - 6;
    	}
    	cyphertext[len] = 0; 
    	return cyphertext;
    }
    
    CHAR* cHelper::Decrypt(const char* plaintext)
    {
    	int len = strlen(plaintext);
    	char* cyphertext = new char[len+1];
    	for(int i=0 ; i<len ; ++i)
    	{
    		cyphertext[i] = plaintext[i] - 8 + 6;
    	}
    	cyphertext[len] = 0; 
    	return cyphertext;
    }
    
    ofstream ofile;
    char dlldir[320];
    
    CHAR * cHelper::GetDirectoryFile(char *filename){
    	static char path[320];
    	strcpy(path, dlldir);
    	strcat(path, filename);
    	return path;
    }
    
    VOID __cdecl cHelper::WriteLog (const char *fmt, ...){
    	if(ofile != NULL)
    	{
    	if(!fmt) { return; }
    	va_list va_alist;
    	char logbuf[255] = {0};
    	va_start (va_alist, fmt);
    	_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);
    	va_end (va_alist);
    	ofile << logbuf << endl;
    	}
    }
    
    VOID cHelper::StarLog(HMODULE hDll)
    {
    	GetModuleFileName(hDll, dlldir, 512);
    	for(int i = strlen(dlldir); i > 0; i--) { if(dlldir[i] == '\\') { dlldir[i+1] = 0; break; } }
    	DeleteFile(GetDirectoryFile("[mpgh]SuperLoggerz Log.txt"));
    	ofile.open(GetDirectoryFile("[mpgh]SuperLoggerz Log.txt"), ios::app);
    }
    credits for most of this go to xKarraKa

    commando: You're probably the best non-coder coder I know LOL


  2. The Following 3 Users Say Thank You to supercarz1991 For This Useful Post:

    arun823 (07-17-2012),Otaviomorais (12-27-2012),XxkyorakuxX (07-17-2012)

  3. #2
    XxkyorakuxX's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Perth, Australia MATE!!
    Posts
    168
    Reputation
    10
    Thanks
    18
    My Mood
    Drunk
    thanks for this man. ill check itout once ive done a few more chapters inmy C++ for dummies

  4. #3
    demtrios's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    MPGH.Net
    Posts
    870
    Reputation
    10
    Thanks
    1,056
    My Mood
    Amused
    full of complications Xor prefer the more practical

Similar Threads

  1. [Help Request] I need help for the MiniHackPack ! It doesnt work :/ (RoundSkipper)
    By lnfinityx3 in forum Alliance of Valiant Arms (AVA) Help
    Replies: 1
    Last Post: 07-17-2012, 08:51 AM
  2. [Help Request] Need help for the Add gun CE
    By yoti33 in forum Alliance of Valiant Arms (AVA) Help
    Replies: 6
    Last Post: 07-14-2012, 11:22 AM
  3. [Help]Well could i get some help for a loader like the **** loader
    By qddW$#%^jtyjtyj in forum Visual Basic Programming
    Replies: 20
    Last Post: 06-24-2010, 10:07 PM
  4. Some questions for the vip hack
    By KyleForrest in forum Combat Arms Hacks & Cheats
    Replies: 5
    Last Post: 10-24-2008, 02:33 PM
  5. Need some help gettin the Korean Language pack
    By Kingleo33 in forum WarRock Korea Hacks
    Replies: 7
    Last Post: 05-21-2008, 05:14 PM