Basic Opengl header funcs

(+)_

Coders
Here's a basic way to wrap or whatever the header functions of Opengl32 .

You can call these instead of the original functions .

( Update your video driver first .)

I will add more .

Code:
DWORD DGL = NULL;
DWORD GLU32 = NULL;
double The_Double = 0.5000000000000000;


GLU32 = (DWORD)GetModuleHandleA("glu32.dll");
DGL = (DWORD)GetModuleHandleA("opengl32.dll");


extern "C" __declspec( naked )
void __stdcall pglGetIntegerv( GLenum pname, GLint *params )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x41C]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x41C]
    }
}
extern "C" __declspec( naked )
void __stdcall pglBegin( GLenum mode )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x7CC]
    }
}

extern "C" __declspec( naked )
void __stdcall pglBitmap( GLsizei width, GLsizei height, GLfloat xorig,
    GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x20]
        jmp1:  PUSH DWORD PTR DS:[ECX+0x9FF68]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x20]
    }
}

extern "C" __declspec( naked )
void __stdcall pglListBase( GLuint base )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x18]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x18]
    }
}

extern "C" __declspec( naked )
void __stdcall pglCallLists( GLsizei n, GLenum type, const GLvoid *lists )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x7C8]
    }
}

extern "C" __declspec( naked )
void __stdcall pglPopAttrib( void )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x99C]
    }
}

extern "C" __declspec( naked )
BOOL __stdcall pwglUseFontBitmapsA(HDC hDC , DWORD Arg1, DWORD Arg2, DWORD Arg3 )
{
    __asm
    {
        MOV EDI,EDI
        PUSH EBP
        MOV EBP,ESP
        PUSH 0x0                                   // /Arg5 = 00000000
        PUSH DWORD PTR SS:[EBP+0x14]               // |Arg4
        PUSH DWORD PTR SS:[EBP+0x10]               // |Arg3
        PUSH DWORD PTR SS:[EBP+0xC]                // |Arg2
        PUSH DWORD PTR SS:[EBP+0x8]                // |Arg1
        MOV ECX, DWORD PTR DS:[DGL]                   // | ...
        LEA EDX, DWORD PTR DS:[ECX+0x3B9F9]        // | ...
        CALL EDX                                   // \opengl32.5FCCB9F9
        POP EBP
        RETN 0x10
    }
}

extern "C" __declspec( naked )
HDC __stdcall pwglGetCurrentDC( void )
{
    __asm
    {
        MOV EDI,EDI
        PUSH EBP
        MOV EBP,ESP
        PUSH ECX
        MOV EAX,DWORD PTR FS:[0xBEC]
        MOV DWORD PTR SS:[EBP-0x4],EAX
        MOV EAX,DWORD PTR SS:[EBP-0x4]
        TEST EAX,EAX
        JE jmp1
        MOV EAX,DWORD PTR DS:[EAX+0x20]
        LEAVE
        RETN
        jmp1: XOR EAX,EAX
        LEAVE
        RETN
    }
}

extern "C" __declspec( naked )
GLuint __stdcall pglGenLists( GLsizei range )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x14]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x14]
    }
}

extern "C" __declspec( naked )
void __stdcall pglViewport( GLint x, GLint y, GLsizei width, GLsizei height )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x4C4]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x4C4]
    }
}

extern "C" __declspec( naked )
void __stdcall pglVertex3fv( const GLfloat *v )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x950]
    }
}

extern "C" __declspec( naked )
void __stdcall pglVertex2f( GLfloat x, GLfloat y )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x92C]
    }
}

extern "C" __declspec( naked )
void __stdcall pglClear( GLbitfield mask )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x32C]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x32C]
    }
}

extern "C" __declspec( naked )
void __stdcall pglTranslatef( GLfloat x, GLfloat y, GLfloat z )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0xA00]
    }
}

extern "C" __declspec( naked )
void __stdcall pglFinish( void )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x360]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x360]
    }
}

extern "C" __declspec( naked )
void __stdcall pwglSwapBuffers(HDC hDC)
{
    __asm
    {
        MOV EDI,EDI
        PUSH EBP
        MOV EBP,ESP
        SUB ESP,0x10
        PUSH EBX
        PUSH EDI
        MOV EDI,DWORD PTR SS:[EBP+0x8]
        PUSH EDI
        XOR EBX,EBX
        MOV EDX, DWORD PTR DS:[DGL]
        LEA ECX, DWORD PTR DS:[EDX+0x3B3AB]
        CALL ECX
        TEST EAX,EAX
        JE jmp1
        PUSH 0x1
        jmp5:  CALL DWORD PTR DS:[SetLastError]
        XOR EAX,EAX
        JMP jmp2
        jmp1:  PUSH EDI  
        MOV EDX, DWORD PTR DS:[DGL]
        LEA ECX, DWORD PTR DS:[EDX+0x3B8F3]
        CALL ECX              
        CMP EAX,0x3
        JE jmp3
        CMP EAX,0x0A
        JE jmp4
        PUSH 0x6
        JMP jmp5
        jmp4:  XOR EAX,EAX
        INC EAX
        JMP jmp2
        jmp3:  PUSH ESI
        LEA EAX,DWORD PTR SS:[EBP-0x10]
        PUSH EAX
        PUSH EDI
        MOV EDX, DWORD PTR DS:[DGL]
        LEA ECX, DWORD PTR DS:[EDX+0x391E0]
        CALL ECX
        LEA EAX,DWORD PTR SS:[EBP-0x10]
        PUSH EAX        
        MOV EDX, DWORD PTR DS:[DGL]
        LEA ECX, DWORD PTR DS:[EDX+0x44F79]
        CALL ECX                
        MOV ESI,EAX
        TEST ESI,ESI
        JE jmp6
        MOV EAX,DWORD PTR DS:[ESI+0x3C]
        TEST EAX,EAX
        JLE jmp7
        CMP EAX,DWORD PTR DS:[ESI+0x48]
        JG jmp8
        PUSH 0x1                                  
        PUSH EDI        
        MOV EDX, DWORD PTR DS:[DGL]
        LEA ECX, DWORD PTR DS:[EDX+0x3C768]
        CALL ECX                  
        MOV EBX,EAX
        JMP jmp7
        jmp8:  CALL DWORD PTR DS:[pglFinish]
        PUSH 0x0                                  
        PUSH ESI                  
        MOV EDX, DWORD PTR DS:[DGL]
        LEA ECX, DWORD PTR DS:[EDX+0x44FB2]
        CALL ECX                
        PUSH ESI                              
        PUSH EDI      
        MOV EDX, DWORD PTR DS:[DGL]
        LEA ECX, DWORD PTR DS:[EDX+0x467FA]
        CALL ECX
        PUSH 0x0                                  
        PUSH ESI                                
        MOV EBX,EAX            
        MOV EDX, DWORD PTR DS:[DGL]
        LEA ECX, DWORD PTR DS:[EDX+0x4516B]
        CALL ECX
        jmp7:  SUB ESI,-0x80
        PUSH ESI                                
        CALL DWORD PTR DS:[InterlockedDecrement]
        JMP jmp9
        jmp6:  PUSH 0x6                                  
        CALL DWORD PTR DS:[SetLastError]
        jmp9:  MOV EAX,EBX
        POP ESI
        jmp2:  POP EDI
        POP EBX
        LEAVE
        RETN 0x4
    }
}

extern "C" __declspec( naked )
void __stdcall pglPushMatrix( void )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x9E8]
    }
}

extern "C" __declspec( naked )
void __stdcall pglVertex3f( GLfloat x, GLfloat y, GLfloat z )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x94C]
    }
}

extern "C" __declspec( naked )
void __stdcall pglPopMatrix( void )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x9E4]
    }
}

extern "C" __declspec( naked )
void __stdcall pglEnable( GLenum cap )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x998]
    }
}

extern "C" __declspec( naked )
void __stdcall pglReadPixels( GLint x, GLint y, GLsizei width,
                              GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x400]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x400]
    }
}

extern "C" __declspec( naked )
void __stdcall pglLoadIdentity( void )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x9CC]
    }
}

extern "C" __declspec( naked )
void __stdcall pglDisable( GLenum cap )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x994]
    }
}

extern "C" __declspec( naked )
void __stdcall pglColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x820]
    }
}

extern "C" __declspec( naked )
void __stdcall pglLineWidth( GLfloat width )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x2A0]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x2A0]
    }
}

extern "C" __declspec( naked )
void __stdcall pglBlendFunc( GLenum sfactor, GLenum dfactor )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x3C4]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x3C4]
    }
}

extern "C" __declspec( naked )
void __stdcall pglEnd( void )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x858]
    }
}

extern "C" __declspec( naked )
void __stdcall pglGetDoublev( GLenum pname, GLdouble *params )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x410]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x410]
    }
}

Edit :

Okay this should be enough samples .

Code:
extern "C" __declspec( naked )
GLint __stdcall d_gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, 
					const GLdouble *model, const GLdouble *proj, const GLint *view, 
						 GLdouble* winX, GLdouble* winY, GLdouble* winZ)
{
	__asm
	{
		MOV EDI,EDI
		PUSH EBP
		MOV EBP,ESP
		PUSH ECX
		SUB ESP,0x40
		FLD QWORD PTR SS:[EBP+0x8]
		LEA EAX,DWORD PTR SS:[EBP-0x40]
		FSTP QWORD PTR SS:[EBP-0x20]
		PUSH EAX								// /Arg3
		FLD QWORD PTR SS:[EBP+0x10]				// |
		LEA EAX,DWORD PTR SS:[EBP-0x20]			// |
		FSTP QWORD PTR SS:[EBP-0x18]			// |
		PUSH EAX								// |Arg2
		FLD QWORD PTR SS:[EBP+0x18]				// |
		PUSH DWORD PTR SS:[EBP+0x20]			// |Arg1
		FSTP QWORD PTR SS:[EBP-0x10]			// |
		FLD1									// |
		FSTP QWORD PTR SS:[EBP-0x8]				// |
		CALL PartB								// \glu32.
		LEA EAX,DWORD PTR SS:[EBP-0x20]
		PUSH EAX								// /Arg3
		LEA EAX,DWORD PTR SS:[EBP-0x40]			// |
		PUSH EAX								// |Arg2
		PUSH DWORD PTR SS:[EBP+0x24]			// |Arg1
		CALL PartB								// \glu32.
		FLDZ
		FLD QWORD PTR SS:[EBP-0x8]
		FUCOM ST(0x1)
		FSTSW AX
		FSTP ST(0x1)
		TEST AH,0x44
		JPE jmp1
		FSTP ST
		XOR EAX,EAX
		JMP jmp2
		jmp1: FLD QWORD PTR SS:[EBP-0x20]
		MOV EAX,DWORD PTR SS:[EBP+0x28]
		FDIV ST,ST(0x1)
		FLD QWORD PTR SS:[EBP-0x18]
		FDIV ST,ST(0x2)
		FLD QWORD PTR SS:[EBP-0x10]
		FDIVRP ST(0x3),ST
		FLD QWORD PTR DS:[The_Double]
		FMUL ST(0x2),ST
		FADD ST(0x2),ST
		FMUL ST(0x1),ST
		FADD ST(0x1),ST
		FMUL ST(0x3),ST
		FADDP ST(0x3),ST
		FILD DWORD PTR DS:[EAX+0x8]
		FMULP ST(0x2),ST
		FILD DWORD PTR DS:[EAX]
		FADDP ST(0x2),ST
		FIMUL DWORD PTR DS:[EAX+0xC]
		FIADD DWORD PTR DS:[EAX+0x4]
		MOV EAX,DWORD PTR SS:[EBP+0x2C]
		FXCH ST(0x1)
		FSTP QWORD PTR DS:[EAX]
		MOV EAX,DWORD PTR SS:[EBP+0x30]
		FSTP QWORD PTR DS:[EAX]
		MOV EAX,DWORD PTR SS:[EBP+0x34]
		FSTP QWORD PTR DS:[EAX]
		XOR EAX,EAX
		INC EAX
		jmp2: LEAVE
		RETN 0x30

PartB:
		MOV EDI,EDI
		PUSH EBP
		MOV EBP,ESP
		MOV EAX,DWORD PTR SS:[EBP+0x8]
		MOV ECX,DWORD PTR SS:[EBP+0xC]
		XOR EDX,EDX
		ADD EAX,0x40
		PUSH ESI
		jmpa: FLD QWORD PTR DS:[EAX-0x40]
		MOV ESI,DWORD PTR SS:[EBP+0x10]
		FMUL QWORD PTR DS:[ECX]
		FLD QWORD PTR DS:[EAX-0x20]
		FMUL QWORD PTR DS:[ECX+0x8]
		FADDP ST(0x1),ST
		FLD QWORD PTR DS:[EAX]
		ADD EAX,0x8
		FMUL QWORD PTR DS:[ECX+0x10]
		FADDP ST(0x1),ST
		FLD QWORD PTR DS:[EAX+0x18]
		FMUL QWORD PTR DS:[ECX+0x18]
		FADDP ST(0x1),ST
		FSTP QWORD PTR DS:[ESI+EDX*0x8]
		INC EDX
		CMP EDX,0x4
		JL jmpa
		POP ESI
		POP EBP
		RETN 0x0C
	}
}

extern "C" __declspec( naked )
void __stdcall pglGetIntegerv( GLenum pname, GLint *params )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x41C]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x41C]
    }
}

extern "C" __declspec( naked )
void __stdcall pglClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x338]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x338]
    }
}

extern "C" __declspec( naked )
void __stdcall pglColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x838]
    }
}

extern "C" __declspec( naked )
void __stdcall pglColor3f( GLfloat red, GLfloat green, GLfloat blue )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x7E0]
    }
}

extern "C" __declspec( naked )
void __stdcall pglGetFloatv( GLenum pname, GLfloat *params )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x418]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x418]
    }
}

extern "C" __declspec( naked )
void __stdcall pglRasterPos2i( GLint x, GLint y )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x108]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x108]
    }
}

extern "C" __declspec( naked )
void __stdcall pglDrawPixels( GLsizei width, GLsizei height,
                    GLenum format, GLenum type, const GLvoid *pixels )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x404]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x404]
    }
}

extern "C" __declspec( naked )
void __stdcall pglPushAttrib( GLbitfield mask )
{
    __asm
    {
        MOV EAX,DWORD PTR FS:[0x18]
        JMP DWORD PTR DS:[EAX+0x9A0]
    }
}

extern "C" __declspec( naked )
void __stdcall pglTexEnvi( GLenum target, GLenum pname, GLint param )
{
    __asm
    {
        MOV EDX,DWORD PTR FS:[0x18]
        MOV ECX, DWORD PTR DS:[DGL]
        CMP DWORD PTR DS:[ECX+0xA102C],0x40
        JNB jmp1
        MOV EAX,EDX
        ADD EDX,DWORD PTR DS:[ECX+0xA100C]
        MOV EDX,DWORD PTR DS:[EDX]
        JMP DWORD PTR DS:[EDX+0x2E8]
        jmp1: PUSH DWORD PTR DS:[ECX+0xA102C]
        CALL DWORD PTR DS:[TlsGetValue]
        XCHG EAX,EDX
        JMP DWORD PTR DS:[EDX+0x2E8]
    }
}

Edit :

Some functions that might be useful :

strcat extracted directly from msvcrt.dll . Tested and working .

Code:
extern "C" __declspec( naked )
char * __cdecl pStrCat( char * Dest, const char * Source )
{
	__asm
	{
		MOV ECX,DWORD PTR SS:[ESP+0x4]
		PUSH EDI
		TEST ECX,0x3
		JNZ Sub1
		jmp2: MOV EAX,DWORD PTR DS:[ECX]
		MOV EDX,0x7EFEFEFF
		ADD EDX,EAX
		XOR EAX,0xFFFFFFFF
		XOR EAX,EDX
		ADD ECX,0x4
		TEST EAX,0x81010100
		JE jmp2
		MOV EAX,DWORD PTR DS:[ECX-0x4]
		TEST AL,AL
		JNZ Sub2
		LEA EDI,DWORD PTR DS:[ECX-0x4]
		jmp1: MOV ECX,DWORD PTR SS:[ESP+0xC]
		TEST ECX,0x3
		JNZ jmp4
		jmp6: MOV EDX,0x7EFEFEFF
		MOV EAX,DWORD PTR DS:[ECX]
		ADD EDX,EAX
		XOR EAX,0xFFFFFFFF
		XOR EAX,EDX
		MOV EDX,DWORD PTR DS:[ECX]
		ADD ECX,0x4
		TEST EAX,0x81010100
		JNZ jmp5
		jmp10: MOV DWORD PTR DS:[EDI],EDX
		ADD EDI,0x4
		JMP jmp6
		jmp5: TEST DL,DL
		JE jmp7
		TEST DH,DH
		JE jmp8
		TEST EDX,0x0FF0000
		JNZ jmp9
		MOV WORD PTR DS:[EDI],DX
		MOV EAX,DWORD PTR SS:[ESP+0x8]
		MOV BYTE PTR DS:[EDI+0x2],0x0
		POP EDI
		RETN
		jmp8: MOV WORD PTR DS:[EDI],DX
		MOV EAX,DWORD PTR SS:[ESP+0x8]
		POP EDI
		RETN
		jmp9: TEST EDX,0xFF000000
		JNZ jmp10
		MOV DWORD PTR DS:[EDI],EDX
		MOV EAX,DWORD PTR SS:[ESP+0x8]
		POP EDI
		RETN
		jmp7: MOV BYTE PTR DS:[EDI],DL
		MOV EAX,DWORD PTR SS:[ESP+0x8]
		POP EDI
		RETN
		jmp4: MOV DL,BYTE PTR DS:[ECX]
		ADD ECX,0x1
		TEST DL,DL
		JE jmp7
		MOV BYTE PTR DS:[EDI],DL
		ADD EDI,0x1
		TEST ECX,0x3
		JE jmp6
		JMP jmp4

	Sub1:

		MOV AL,BYTE PTR DS:[ECX]
		ADD ECX,0x1
		TEST AL,AL
		JE Sub1_Sub1
		TEST ECX,0x3
		JNZ Sub1
		MOV EDI,EDI
		JMP jmp2

	Sub1_Sub1:

		LEA EDI,DWORD PTR DS:[ECX-0x1]
		JMP jmp1

	Sub2:

		TEST AH,AH
		JE Sub2_Sub1
		TEST EAX,0x0FF0000
		JE Sub2_Sub2
		TEST EAX,0xFF000000
		JNZ jmp2
		LEA EDI,DWORD PTR DS:[ECX-0x1]
		JMP jmp1

	Sub2_Sub1:

		LEA EDI,DWORD PTR DS:[ECX-0x3]
		JMP jmp1

	Sub2_Sub2:

		LEA EDI,DWORD PTR DS:[ECX-0x2]
		JMP jmp1
	}
}

strlen extracted directly from msvcrt.dll . Tested and working .

Code:
extern "C" __declspec( naked )
size_t  __cdecl pStrLen( const char * _Str )
{
	__asm
	{
		MOV ECX,DWORD PTR SS:[ESP+0x4]
		TEST ECX,0x3
		JE jmp1
		jmp3: MOV AL,BYTE PTR DS:[ECX]
		ADD ECX,0x1
		TEST AL,AL
		JE jmp2
		TEST ECX,0x3
		JNZ jmp3
		ADD EAX,0x0
		LEA ESP,DWORD PTR SS:[ESP]
		LEA ESP,DWORD PTR SS:[ESP]
		jmp1: MOV EAX,DWORD PTR DS:[ECX]
		MOV EDX,0x7EFEFEFF
		ADD EDX,EAX
		XOR EAX,0xFFFFFFFF
		XOR EAX,EDX
		ADD ECX,0x4
		TEST EAX,0x81010100
		JE jmp1
		MOV EAX,DWORD PTR DS:[ECX-0x4]
		TEST AL,AL
		JE jmp4
		TEST AH,AH
		JE jmp5
		TEST EAX,0x0FF0000
		JNZ jmp6
		LEA EAX,DWORD PTR DS:[ECX-0x2]
		MOV ECX,DWORD PTR SS:[ESP+0x4]
		SUB EAX,ECX
		RETN
		jmp6: TEST EAX,0xFF000000
		JNZ jmp1
		jmp2: LEA EAX,DWORD PTR DS:[ECX-0x1]
		MOV ECX,DWORD PTR SS:[ESP+0x4]
		SUB EAX,ECX
		RETN
		jmp4: LEA EAX,DWORD PTR DS:[ECX-0x4]
		MOV ECX,DWORD PTR SS:[ESP+0x4]
		SUB EAX,ECX
		RETN
		jmp5: LEA EAX,DWORD PTR DS:[ECX-0x3]
		MOV ECX,DWORD PTR SS:[ESP+0x4]
		SUB EAX,ECX
		RETN
	}
}

strstr taken straight from msvcrt.dll .

Code:
extern "C" __declspec( naked )
inline char * __cdecl pStrStr( char * _Str, const char * _SubStr )
{
	__asm
	{
		MOV ECX,DWORD PTR SS:[ESP+0x8]
		PUSH EDI
		PUSH EBX
		PUSH ESI
		MOV DL,BYTE PTR DS:[ECX]
		MOV EDI,DWORD PTR SS:[ESP+0x10]
		TEST DL,DL
		JE Sub1
		MOV DH,BYTE PTR DS:[ECX+0x1]
		TEST DH,DH
		JE Sub2
		jmp10: MOV ESI,EDI
		MOV ECX,DWORD PTR SS:[ESP+0x14]
		MOV AL,BYTE PTR DS:[EDI]
		ADD ESI,0x1
		CMP AL,DL
		JE jmp1
		TEST AL,AL
		JE jmp2
		jmp3: MOV AL,BYTE PTR DS:[ESI]
		ADD ESI,0x1
		jmp4: CMP AL,DL
		JE jmp1
		TEST AL,AL
		JNZ jmp3
		jmp2: POP ESI
		POP EBX
		POP EDI
		XOR EAX,EAX
		RETN
		jmp1: MOV AL,BYTE PTR DS:[ESI]
		ADD ESI,0x1
		CMP AL,DH
		JNZ jmp4
		LEA EDI,DWORD PTR DS:[ESI-0x1]
		JMP jmp5
		jmp11: LEA EAX,DWORD PTR DS:[EDX-0x3]
		POP ESI
		POP EDI
		POP EBX
		RETN
		jmp6: TEST AH,AH
		JNZ Sub3_jmp1
		JMP Sub3_jmp2
		jmp12: TEST AL,AL
		JE Sub3_jmp2
		CMP AH,BL
		JNZ jmp6
		POP ESI
		POP EDI
		LEA EAX,DWORD PTR DS:[EDX-0x1]
		POP EBX
		RETN
		jmp8: MOV CL,BYTE PTR DS:[EDX]
		ADD EDX,0x1
		CMP CL,BL
		JE jmp7
		TEST CL,CL
		JE Sub3_jmp3
		TEST EDX,0x3
		JE Sub3_jmp4
		JMP jmp8
		jmp7: LEA EAX,DWORD PTR DS:[EDX-0x1]
		POP EBX
		RETN
		jmp5: MOV AH,BYTE PTR DS:[ECX+0x2]
		TEST AH,AH
		JE jmp9
		MOV AL,BYTE PTR DS:[ESI]
		ADD ESI,0x2
		CMP AL,AH
		JNZ jmp10
		MOV AL,BYTE PTR DS:[ECX+0x3]
		TEST AL,AL
		JE jmp9
		MOV AH,BYTE PTR DS:[ESI-0x1]
		ADD ECX,0x2
		CMP AL,AH
		JE jmp5
		JMP jmp10
		jmp9: LEA EAX,DWORD PTR DS:[EDI-0x1]
		POP ESI
		POP EBX
		POP EDI
		RETN

	Sub1:

		MOV EAX,EDI
		POP ESI
		POP EBX
		POP EDI
		RETN

	Sub2:

		XOR EAX,EAX
		POP ESI
		POP EBX
		POP EDI
		MOV AL,DL
		JMP Sub3

	Sub3:

		PUSH EBX
		MOV EBX,EAX
		SHL EAX,0x8
		MOV EDX,DWORD PTR SS:[ESP+0x8]
		TEST EDX,0x3
		JNZ jmp8
		Sub3_jmp4: OR EBX,EAX
		PUSH EDI
		MOV EAX,EBX
		SHL EBX,0x10
		PUSH ESI
		OR EBX,EAX
		Sub3_jmp1: MOV ECX,DWORD PTR DS:[EDX]
		MOV EDI,0x7EFEFEFF
		MOV EAX,ECX
		MOV ESI,EDI
		XOR ECX,EBX
		ADD ESI,EAX
		ADD EDI,ECX
		XOR ECX,0xFFFFFFFF
		XOR EAX,0xFFFFFFFF
		XOR ECX,EDI
		XOR EAX,ESI
		ADD EDX,0x4
		AND ECX,0x81010100
		JNZ Sub3_jmp5
		AND EAX,0x81010100
		JE Sub3_jmp1
		AND EAX,0x1010100
		JE Sub4
		Sub3_jmp2: POP ESI
		POP EDI
		Sub3_jmp3: POP EBX
		XOR EAX,EAX
		RETN
		Sub3_jmp5: MOV EAX,DWORD PTR DS:[EDX-0x4]
		CMP AL,BL
		JNZ Sub3_jmp6
		LEA EAX,DWORD PTR DS:[EDX-0x4]
		POP ESI
		POP EDI
		POP EBX
		RETN
		Sub3_jmp6: TEST AL,AL
		JE Sub3_jmp2
		CMP AH,BL
		JE jmp11
		TEST AH,AH
		JE Sub3_jmp2
		SHR EAX,0x10
		CMP AL,BL
		JNZ jmp12
		LEA EAX,DWORD PTR DS:[EDX-0x2]
		POP ESI
		POP EDI
		POP EBX
		RETN

	Sub4:

		AND ESI,0x80000000
		JE Sub3_jmp2
		JMP Sub3_jmp1
	}
}
 
Top