View Single Post
Old 21.06.2006, 14:04   #65
Dmytro
Архивный участник
 
Join Date: Nov 2005
Posts: 215
Default

Where you were earlier guys?! :P

... Adding ave_big_head (Abnormal), maybe not working ...
Thx to Aspire for HEX.

Code:
#include "headers.h"

void AddAveEffects();

const WCHAR * ave_big_head = L"ave_big_head";
const DWORD ave_bleeding_addr = 0x0056E4BC; //Start point
const BYTE db_ave_bleeding_addr[] = {0x8B,0x46,0x20,0x8B,0x4E,0x0C};
const DWORD sub_58C90D = 0x58C90D; //.text:0056E4CB	call sub_58C90D
const DWORD loc_56E4C5 = 0x56E4C5; //push	offset Ave_dot_bleed ; "ave_dot_bleeding" //Out point

//justification by 1 byte
struct jmp_far
{
  BYTE _push;  //push
  DWORD addr;  //address
  BYTE _ret;   //ret
};

//Abnormal_effects_update----------------------------------------------------------------------------------------------
void AbnormalEffects(HANDLE hMainInst)
{
	BYTE OldCodeBuff[8];
	jmp_far jump;

	if(ReadProcessMemory(hMainInst,(LPVOID)ave_bleeding_addr,&OldCodeBuff,sizeof(jump),NULL))
	{
		if(memcmp(OldCodeBuff,db_ave_bleeding_addr,sizeof(db_ave_bleeding_addr))==0)
		{
			jump._push = 0x68;
			jump.addr = (DWORD)&AddAveEffects;
			jump._ret = 0xC3;

			if(!WriteProcessMemory(hMainInst,(LPVOID)ave_bleeding_addr,&jump,sizeof(jump),NULL))
			{
				MessageBox(0,"AVE_EFFECTS: Can't write process memory!","Error Notice!",MB_OK | MB_ICONSTOP);
			}				
		}
		else
		{
			MessageBox(0,"AVE_EFFECTS: Wrong file version!","Error Notice!",MB_OK | MB_ICONSTOP);
		}
	}
	else
	{
		MessageBox(0,"AVE_EFFECTS: Can't read process memory!","Error Notice!",MB_OK | MB_ICONSTOP);
	}
}
//---------------------------------------------------------------------------------------------------------------------
Naked void AddAveEffects()
{
	__asm
	{
		//ave_big_head
			mov			eax,[esi+20h]
			mov         ecx,[esi+0Ch]
			mov         edx,[ecx+eax*8]
			push        dword ptr [ave_big_head]
			push        edx
			mov			edx, sub_58C90D
			call		edx
			add         esp,8
			test        eax,eax
			jne			LEnd
			mov         eax,[esi+90h]
			mov         dword ptr [eax+1BCh],2000h
			mov         ecx,[esp+013Ch]
			mov         fs:[0],ecx
			pop         edi
			pop         esi
			pop         ebx
			mov         esp,ebp
			pop         ebp
			retn
		LEnd:
		//ave_dot_bleeding -> header
			mov         eax,[esi+20h]
			mov         ecx,[esi+0Ch]
			mov         edx,[ecx+eax*8]
			push		loc_56E4C5
			retn
	}
}
//---------------------------------------------------------------------------------------------------------------------
I think start point must be another. Later i post another version.
Dmytro is offline