alterIWnet device pointer?

Posts 1–14 of 14 · Page 1 of 1
alterIWnet device pointer?
Hello forum,
i'm currently woring on a project for alterIWnet.
I want to detour the EndScene function, but can't find the offset.
0x586FA0 for the official MW2 doesen't seem to work.

I want so say, that i need the offset to the EndScene function.
As in after the final kill or are you talking about single player?
Quote Originally Posted by aIW|Convery View Post
As in after the final kill or are you talking about single player?
I'm talking about the multiplayer from alterIWnet 1.3.3.7a++.
I got the address(0x06737268), but it looks like MW2 chrashes everytime i inject the dll.
Quote Originally Posted by gethan View Post
I got the address(0x06737268), but it looks like MW2 chrashes everytime i inject the dll.
What are u trying to do?
Atm, I'm trying to draw a rectangle^^
[FONT="Georgia"][COLOR="DarkOliveGreen"][SIZE="2"]
Quote Originally Posted by gethan View Post
Atm, I'm trying to draw a rectangle^^
Use the mw2 engine
Give me a second......

EDIT:
It's on -not allowed-:
Wow, ty, I'll look what I can do
Quote Originally Posted by gethan View Post
Wow, ty, I'll look what I can do
For what?
/removed link
Don't post links to that site.
Where are you trying to draw from?
EDIT:
HUH? Wait.
Here is the code for the DetourFunction:
Code:
oEndScene = (void (__cdecl *)(void))DetourFunction((PBYTE)0x586E00, (PBYTE)xEndScene);
It's working fine for me. And also 'xEndScene' is mah function where I call the drawing thinies.
Code:
void xEndScene(void)
{
          //Code Here?
}
Ok, my DLL code looks like this:

Code:
#include <windows.h>
#include <iostream>

(PBYTE)xEndScene);

bool DetourFunc( BYTE* oldFunc, BYTE* newFunc, DWORD len )
{
    BYTE* newMem4base = NULL;
    DWORD dwOld;

    newMem4base = ( BYTE* )malloc( 5+len );

    if( newMem4base == NULL )
        return false;

    for( DWORD i = 0; i < ( len+5 ); i++ )
        newMem4base[i] = 0x90;

    VirtualProtect( oldFunc, len, PAGE_READWRITE, &dwOld );

    memcpy( newMem4base, oldFunc, len );
    oldFunc[0] = 0xE8;
    *( DWORD* )( oldFunc+0x01 ) = DWORD( newFunc-oldFunc-5 );
    oldFunc[5] = 0xE9;
    *( DWORD* )( oldFunc+0x06 ) = DWORD( newMem4base-( oldFunc+0x5 )-5 );
    newMem4base += len;
    newMem4base[0] = 0xE9;
    *( DWORD* )( newMem4base+0x01 ) = DWORD( ( oldFunc+10 )-newMem4base-5 );

    for( DWORD i = 10; i <len; i++ )
        oldFunc[i] = 0x90;

    return true;
}

void xEndScene(void)
{
          //Code Here?
}

DWORD WINAPI Thread( LPVOID lpParam )
{
	DetourFunc( ( BYTE* )0x01031470, ( BYTE* )&xEndScene, 10);
	return 0;
}


BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
{
	if( ul_reason_for_call == DLL_PROCESS_ATTACH )
	{
		HANDLE hThread = CreateThread( NULL, 0, Thread, NULL, 0, NULL );
		CloseHandle( hThread );
	}

	return TRUE;
}
For the Draw function i foud this code(But cant compile(Problem with RGBA color and arguments):
Code:
#include <iostream>
#include <windows.h>

typedef void* (*GetFontType_)(char* FontName, int Unknown1);
GetFontType_ GetFontType = (GetFontType_)0x505670;

typedef int (*DrawEngineText_)(char* Text, int Unknown1, void* Font, float X, float Y, float Unknown2, float Unknown3, float Unknown4, RGBA_COLOR* Color, int Unknown5);
DrawEngineText_ DrawEngineText = (DrawEngineText_)0x509D80;


struct RGBA_COLOR
{
        float r, g, b, a;
};


void DrawTextWithEngine(float x, float y, RGBA_COLOR* Color, const char* Text, ...)
{
	void* Font = GetFontType( "fonts/smalldevfont", 0 );
        	
	char buf[300] = "";
	va_list va_alist;

	va_start(va_alist,Text);
	vsnprintf(buf,sizeof(buf),Text,va_alist);
	va_end(va_alist);

	DrawEngineText(buf,0x7FFFFFFF,Font,x,y,1.0f,1.0f,0.0f,Color,0);	
}
But i am a little helpless now. I don't know what to next.
Posts 1–14 of 14 · Page 1 of 1
This thread is closed for replies.
Talk with us