Exemplo n.º 1
0
void FileMgr::InitHooks( void )
{
    // Install file system monitoring hooks.
    HookInstall( 0x00538730, (DWORD)chdirProgramDirAbsolute, 5 );
    HookInstall( 0x005387D0, (DWORD)chdirProgramDir, 5 );
    // todo: 0x00538860

    // Create file monitoring utilities.
    curDirTranslator = core->GetFileSystem()->CreateTranslator( "/" );
}
Exemplo n.º 2
0
void Placeable_Init( void )
{
    // We should handle the matrix allocation ourselves
    HookInstall( 0x0054F560, h_memFunc( &CPlaceableSAInterface::AcquaintMatrix ), 5 );
    HookInstall( 0x0054F4C0, h_memFunc( &CPlaceableSAInterface::AllocateMatrix ), 5 );
    HookInstall( 0x0054F3B0, h_memFunc( &CPlaceableSAInterface::FreeMatrix ), 5 );

    // Transformation hooks
    HookInstall( 0x0054F1B0, h_memFunc( &CPlaceableSAInterface::Transform::GetMatrixFromHeading ), 5 );
}
Exemplo n.º 3
0
void ObjectAttributes_Init()
{
    // Load the attributes ourselves.
    // We need a seperate structure to save original attributes to, restoring them at mod unload.
    // Introducing a new callback framework to game_sa: mod init + mod unload
    HookInstall( 0x005B5360, (DWORD)_Objects_LoadAttributes, 5 );
    HookInstall( 0x005A2D00, (DWORD)_Object_PrepareDynamicPhysics, 5 );

    // Set the default dynamic data each created object will receive
    *(dynamicObjectData**)0x0059F85D = g_dynObjData;
}
Exemplo n.º 4
0
CSettingsSA::CSettingsSA ( void )
{
    m_pInterface = (CSettingsSAInterface *)CLASS_CMenuManager;
    m_pInterface->bFrameLimiter = false;
    m_bVolumetricShadowsEnabled = false;
    m_bVolumetricShadowsSuspended = false;
    SetAspectRatio ( ASPECT_RATIO_4_3 );
    HookInstall ( HOOKPOS_GetFxQuality, (DWORD)HOOK_GetFxQuality, 5 );
    HookInstall ( HOOKPOS_StoreShadowForVehicle, (DWORD)HOOK_StoreShadowForVehicle, 9 );
    m_iDesktopWidth = 0;
    m_iDesktopHeight = 0;
    MemPut < BYTE > ( 0x6FF420, 0xC3 );     // Truncate CalculateAspectRatio

    // Set "radar map and radar" as default radar mode
    SetRadarMode ( RADAR_MODE_ALL );
}
Exemplo n.º 5
0
VOID CGameSA::SetRenderHook ( InRenderer* pInRenderer )
{
    if ( pInRenderer )
        HookInstall ( (DWORD)FUNC_CDebug_DebugDisplayTextBuffer, (DWORD)pInRenderer, 6 );
    else
    {
        MemPut < BYTE > ( FUNC_CDebug_DebugDisplayTextBuffer, 0xC3 );
    }
}
Exemplo n.º 6
0
VOID CGameSA::SetRenderHook ( InRenderer* pInRenderer )
{
	if ( pInRenderer )
		HookInstall ( (DWORD)FUNC_CDebug_DebugDisplayTextBuffer, (DWORD)pInRenderer, 6 );
	else
	{
		*(BYTE *)FUNC_CDebug_DebugDisplayTextBuffer = 0xC3;
	}
}
void MyHookStart()
{
	if(MessageBox(NULL, "Hooking Start?", "AllHook", MB_YESNO) == IDYES)
	{
		HookInstall(hWndMain);
		wsprintf(str, "Hooking Start..");
		InvalidateRect(hWndMain, NULL, TRUE);
	}
}
Exemplo n.º 8
0
CCameraSA::CCameraSA(CCameraSAInterface * cameraInterface)
{ 
	DEBUG_TRACE("CCameraSA::CCameraSA(CCameraSAInterface * cameraInterface)");
	this->internalInterface = cameraInterface;
	for(int i = 0; i<MAX_CAMS;i++)
		this->Cams[i] = new CCamSA(&this->internalInterface->Cams[i]);
    bCameraClipObjects = true;
    bCameraClipVehicles = true;
    HookInstall(HOOKPOS_Camera_CollisionDetection, (DWORD)HOOK_Camera_CollisionDetection, 5 );
}
Exemplo n.º 9
0
CAudioSA::CAudioSA()
{
    m_bRadioOn = false;
    m_bRadioMuted = false;
    m_ucRadioChannel = 0;
    m_bAmbientSoundsPaused = false;
    m_bAmbientGeneralEnabled = true;
    m_bAmbientGunfireEnabled = true;

    HookInstall ( HOOKPOS_CAEAmbienceTrackManager_CheckForPause, (DWORD)HOOK_CAEAmbienceTrackManager_CheckForPause, 6 );
}
Exemplo n.º 10
0
void Entity_Init( void )
{
    HookInstall( 0x00535300, h_memFunc( &CEntitySAInterface::GetColModel ), 5 );
    HookInstall( 0x00534540, h_memFunc( &CEntitySAInterface::IsOnScreen ), 5 );
    HookInstall( 0x00534250, h_memFunc( &CEntitySAInterface::GetCollisionOffset ), 5 );
    HookInstall( 0x005449B0, h_memFunc( &CEntitySAInterface::_GetBoundingBox ), 5 );
    HookInstall( 0x00534290, h_memFunc( &CEntitySAInterface::GetCenterPoint ), 5 );
    HookInstall( 0x00446F90, h_memFunc( &CEntitySAInterface::UpdateRwMatrix ), 5 );
    HookInstall( 0x00532B00, h_memFunc( &CEntitySAInterface::UpdateRwFrame ), 5 );
    HookInstall( 0x00536BE0, h_memFunc( &CEntitySAInterface::GetBasingDistance ), 5 );

    EntityRender_Init();
}
Exemplo n.º 11
0
/*=========================================================
    CRwExtensionManagerSA::constructor

    Purpose:
        Initializes various RenderWare extensions. This interface
        has access to special RenderWare extensions of GTA:SA (Allocate).
=========================================================*/
CRwExtensionManagerSA::CRwExtensionManagerSA( void )
{
    // Patch some fixes
    HookInstall( 0x00732480, (DWORD)RpAtomicRenderAlpha, 5 );
    HookInstall( 0x0041B1D0, (DWORD)ReadCollisionFromClump, 5 );

    switch( pGame->GetGameVersion() )
    {
    case VERSION_EU_10:
        HookInstall( 0x007509F0, (DWORD)_worldAtomicSceneCopyConstructor, 5 );
        break;
    case VERSION_US_10:
        HookInstall( 0x007509A0, (DWORD)_worldAtomicSceneCopyConstructor, 5 );
        break;
    }

#if 0
    // Initialize global extensions
    RpGeometryStreamlineInit();
#endif
}
Exemplo n.º 12
0
////////////////////////////////////////////////////////////////
//
// CRenderWareSA::InitTextureWatchHooks
//
//
////////////////////////////////////////////////////////////////
void CRenderWareSA::InitTextureWatchHooks ( void )
{
    HookInstall ( HOOKPOS_CTxdStore_SetupTxdParent, (DWORD)HOOK_CTxdStore_SetupTxdParent, 6 );
    HookInstall ( HOOKPOS_CTxdStore_RemoveTxd, (DWORD)HOOK_CTxdStore_RemoveTxd, 6 );
}
Exemplo n.º 13
0
void CMultiplayerSA::InitHooks_13 ( void )
{
    // HookInstalls go here
    HookInstall ( HOOKPOS_CEventHitByWaterCannon, (DWORD)HOOK_CEventHitByWaterCannon, 9 );

    // Siren hooks
    HookInstall ( HOOKPOS_CVehicle_ProcessStuff_TestSirenTypeSingle, (DWORD)HOOK_CVehicle_ProcessStuff_TestSirenTypeSingle, 7 ); // Test siren type is single for a jump
    HookInstall ( HOOKPOS_CVehicle_ProcessStuff_SetSirenPositionSingle, (DWORD)HOOK_CVehicle_ProcessStuff_PostPushSirenPositionSingle, 19 ); // mov before Push for the siren position (overhook so we can get RGBA)
    HookInstall ( HOOKPOS_CVehicle_ProcessStuff_TestSirenTypeDual, (DWORD)HOOK_CVehicle_ProcessStuff_TestSirenTypeDual, 7 ); // test siren type is dual for a jump
    HookInstall ( HOOKPOS_CVehicle_ProcessStuff_PostPushSirenPosition1, (DWORD)HOOK_CVehicle_ProcessStuff_PostPushSirenPositionDualRed, 15 ); // mov before push for the siren position (overhook so we can get RGBA)
    HookInstall ( HOOKPOS_CVehicle_ProcessStuff_PostPushSirenPosition2, (DWORD)HOOK_CVehicle_ProcessStuff_PostPushSirenPositionDualBlue, 15 ); // mov before push for the siren position (overhook so we can get RGBA)
    HookInstall ( HOOKPOS_CVehicle_DoesVehicleUseSiren, (DWORD)HOOK_CVehicle_DoesVehicleUseSiren, 5 ); // Does vehicle have a siren
    HookInstall ( HOOKPOS_CVehicle_ProcessStuff_TestCameraPosition, (DWORD)HOOK_CVehicle_ProcessStuff_TestCameraPosition, 5 ); // Fix for single sirens being 360 degrees
    // Breaks Rear wheel rendering leave for now
    //HookInstall ( HOOKPOS_CMotorBike_ProcessStuff_PushSirenPositionBlue, (DWORD)HOOK_CMotorBike_ProcessStuff_PushSirenPositionBlue, 15 ); // mov before the push for the sien position (overhook so we can get RGBA)
    //HookInstall ( HOOKPOS_CMotorBike_ProcessStuff_PushSirenPositionRed, (DWORD)HOOK_CMotorBike_ProcessStuff_PushSirenPositionRed, 22 ); // mov before the push for the sien position (overhook so we can get RGBA)

    //HookInstall ( HOOKPOS_CMotorbike_ProcessStuff_TestVehicleModel, (DWORD)HOOK_CMotorbike_ProcessStuff_TestVehicleModel, 6 );
    //HookInstall ( HOOKPOS_CVehicle_ProcessStuff_PushRGBPointLights, (DWORD)HOOK_CVehicle_ProcessStuff_PushRGBPointLights, 48 );
    HookInstall ( HOOKPOS_CVehicle_ProcessStuff_StartPointLightCode, (DWORD)HOOK_CVehicle_ProcessStuff_StartPointLightCode, 5 );

    HookInstall ( HOOKPOS_CVehicleAudio_ProcessSirenSound1, (DWORD) HOOK_CVehicleAudio_ProcessSirenSound1, 5 );
    HookInstall ( HOOKPOS_CVehicleAudio_ProcessSirenSound2, (DWORD) HOOK_CVehicleAudio_ProcessSirenSound2, 5 );
    HookInstall ( HOOKPOS_CVehicleAudio_ProcessSirenSound3, (DWORD) HOOK_CVehicleAudio_ProcessSirenSound3, 5 );
    HookInstall ( HOOKPOS_CVehicleAudio_ProcessSirenSound, (DWORD) HOOK_CVehicleAudio_ProcessSirenSound, 6 );

    HookInstall ( HOOKPOS_CTaskSimpleJetpack_ProcessInput, (DWORD) HOOK_CTaskSimpleJetpack_ProcessInput, 5 );
    HookInstall ( HOOKPOS_CTaskSimplePlayerOnFoot_ProcessWeaponFire, (DWORD) HOOK_CTaskSimplePlayerOnFoot_ProcessWeaponFire, 5 );

    HookInstall ( HOOKPOS_CObject_PreRender, (DWORD)HOOK_CObject_PreRender, 6 );

    HookInstall ( HOOKPOS_CWorld_RemoveFallenPeds, (DWORD)HOOK_CWorld_RemoveFallenPeds, 6 );

    HookInstall ( HOOKPOS_CVehicleModelInterface_SetClump, (DWORD)HOOK_CVehicleModelInterface_SetClump, 7 );

    HookInstall ( HOOKPOS_CBoat_ApplyDamage, (DWORD)HOOK_CBoat_ApplyDamage, 12 );
    
    InitHooks_ClothesSpeedUp ();
    EnableHooks_ClothesMemFix ( true );
    InitHooks_FixBadAnimId ();
    InitHooks_HookDestructors ();
    InitHooks_RwResources ();
    InitHooks_ClothesCache ();
    InitHooks_Files ();
    InitHooks_Weapons ();
    InitHooks_Rendering ();
}