Search found 34 matches: customtype
Searched query: customtype
- Mon Jan 27, 2025 12:29 pm
- Forum: Code examples / Cookbook
- Topic: [L4D2] EmitSound pitch randomization
- Replies: 0
- Views: 240547
[L4D2] EmitSound pitch randomization
... DataType, Pointer, alloc from memory.hooks import PreHook, PostHook, use_pre_registers from random import randint from memory.manager import CustomType, Type, manager enginelib = find_binary('engine') class IEngineSound(CustomType, metaclass=manager): EmitSound = manager.virtual_function(5, ...
- Mon Jan 27, 2025 12:26 pm
- Forum: Code examples / Cookbook
- Topic: [L4D2] Replace all dialogues and monologues with Nick's laugh.
- Replies: 0
- Views: 126590
[L4D2] Replace all dialogues and monologues with Nick's laugh.
... Pointer, alloc from memory.hooks import PreHook, PostHook, use_pre_registers from players.entity import Player from memory.manager import CustomType, Type, manager serverlib = find_binary('server') InstancedScriptedScene = serverlib[b'\x55\x8B\xEC\x53\x56\x57\x6A\x2A\x68'].make_function( ...
- Mon Jan 27, 2025 12:15 pm
- Forum: Code examples / Cookbook
- Topic: [L4D2] Play as infected in coop
- Replies: 0
- Views: 125653
[L4D2] Play as infected in coop
... from players.entity import Player from memory import find_binary, make_object, Convention, DataType from memory.manager import CustomType, manager from events.hooks import PreEvent, EventAction from players.helpers import index_from_userid from filters.players import PlayerIter ...
- Sun Oct 17, 2021 3:37 pm
- Forum: Plugin Requests
- Topic: HL2DM-cscanner spawned
- Replies: 15
- Views: 39385
Re: HL2DM-cscanner spawned
... self.make_virtual_function( With: self.pointer.make_virtual_function( This is a regression that was introduced into c7825ed which causes CustomType 's, BasePointer 's and Pointer 's attributes to no longer be dynamically resolved. Not really sure this was intended in the first place, ...
- Sun Oct 17, 2021 8:59 am
- Forum: Plugin Requests
- Topic: HL2DM-cscanner spawned
- Replies: 15
- Views: 39385
Re: HL2DM-cscanner spawned
... self.make_virtual_function( With: self.pointer.make_virtual_function( This is a regression that was introduced into c7825ed which causes CustomType 's, BasePointer 's and Pointer 's attributes to no longer be dynamically resolved. Not really sure this was intended in the first place, ...
- Fri Feb 26, 2021 1:19 am
- Forum: Plugin Development Support
- Topic: Using engine server's get_player_info
- Replies: 3
- Views: 15891
Re: Using engine server's get_player_info
... Offsets are based on the link you provided, which are likely to be outdated and/or different for each games though. Alternatively, you could use a CustomType to make it easier as well. EDIT: Updated the offsets, tested on CS:S and they appears correct for that game.
- Wed Dec 02, 2020 9:25 pm
- Forum: Plugin Development Support
- Topic: Setting owner_handle of projectiles
- Replies: 5
- Views: 15385
Re: Setting owner_handle of projectiles
... and 1276 on Windows. Offset for inferno is 2936 on Linux and 2912 on Windows. If you want to set the attacker to Projectile, you can create a CustomType like this. # Source.Python Imports # Core import core # Entities from entities.entity import Entity # Memory from memory import get_object_pointer ...
- Sat Oct 10, 2020 7:56 pm
- Forum: Plugin Requests
- Topic: Crowbar throw
- Replies: 12
- Views: 29562
Re: Crowbar throw
... from mathlib import Vector, QAngle, NULL_VECTOR from memory import Convention, DataType from memory.manager import CustomType, TypeManager, Type from players.constants import PlayerButtons from players.entity import Player # How much melee ammo should the player ...
- Fri Oct 02, 2020 5:36 am
- Forum: Plugin Development Support
- Topic: [HL2DM/ANY] Hooking VphysicsCollision
- Replies: 13
- Views: 30004
Re: [HL2DM/ANY] Hooking VphysicsCollision
That's because your offsets are incorrect. class GameVCollisionEvent(CustomType, metaclass=manager): manager.register_converter("BaseEntity", BaseEntity._obj) pre_velocity = manager.static_instance_array("Vector", 32, ...
- Thu Oct 01, 2020 8:07 pm
- Forum: Plugin Development Support
- Topic: [HL2DM/ANY] Hooking VphysicsCollision
- Replies: 13
- Views: 30004
Re: [HL2DM/ANY] Hooking VphysicsCollision
... PLATFORM from entities.entity import Entity from memory import Convention, DataType from memory.hooks import PreHook from memory.manager import CustomType, TypeManager, Type manager = TypeManager() VPHYSICS_COLLISION_OFFSET = 161 if PLATFORM == 'windows' else 162 vphysics_collision ...
- Thu Oct 01, 2020 6:30 am
- Forum: Plugin Development Support
- Topic: [HL2DM/ANY] Hooking VphysicsCollision
- Replies: 13
- Views: 30004
[HL2DM/ANY] Hooking VphysicsCollision
... PLATFORM from entities.entity import Entity from memory import Convention, DataType from memory.hooks import PreHook from memory.manager import CustomType, TypeManager, Type manager = TypeManager() VPHYSICS_COLLISION_OFFSET = 161 if PLATFORM == 'windows' else 162 vphysics_collision ...
- Thu May 14, 2020 8:36 pm
- Forum: Plugin Development Support
- Topic: *DELETED*
- Replies: 6
- Views: 15165
Re: [Q] Custom structures
Your PlayerInfoType class should be a subclass of CustomType and use the manager as the metaclass. If you also provide the size, you can then instantiate your PlayerInfoType class and internally memory is allocated automatically. I never had any stability ...
- Thu May 14, 2020 9:26 am
- Forum: Plugin Development Support
- Topic: *DELETED*
- Replies: 6
- Views: 15165
Re: [Q] Custom structures
Try searching for CustomType here on the forums. There are a few examples. CustomType provides a few more features like automatically registering it as a return type, so you can easily use it with virtual functions and normal functions. ...
- Sat May 19, 2018 5:26 am
- Forum: Plugin Development Support
- Topic: Some help with CustomType
- Replies: 3
- Views: 16712
Re: Some help with CustomType
Yes, that's the proper way. For m_iMapHasVIPSafetyZone you can also use manager.instance_attribute. Edit: The calling convenient is wrong. It's a THISCALL. Right now it will only work on Linux, because THISCALL and CDECL are the same on Linux. Okay thanks! It's only meant to work on linux anyway, t...
- Sat May 19, 2018 4:45 am
- Forum: Plugin Development Support
- Topic: Some help with CustomType
- Replies: 3
- Views: 16712
Re: Some help with CustomType
Yes, that's the proper way. For m_iMapHasVIPSafetyZone you can also use manager.instance_attribute.
Edit: The calling convenient is wrong. It's a THISCALL. Right now it will only work on Linux, because THISCALL and CDECL are the same on Linux.
Edit: The calling convenient is wrong. It's a THISCALL. Right now it will only work on Linux, because THISCALL and CDECL are the same on Linux.
- Fri May 18, 2018 11:43 pm
- Forum: Plugin Development Support
- Topic: Some help with CustomType
- Replies: 3
- Views: 16712
Re: Some help with CustomType
class CCSGameRules(CustomType, metaclass=manager): _binary = "server" # 5 5 CCSGameRules::LevelInitPostEntity(void) LevelInitPostEntity = manager.virtual_function( 5 if PLATFORM == 'windows' else ...
- Fri May 18, 2018 11:08 pm
- Forum: Plugin Development Support
- Topic: Some help with CustomType
- Replies: 3
- Views: 16712
Some help with CustomType
I have: if PLATFORM == 'windows': raise NotImplementedError("UNIX Only") class CCSGameRules(CustomType, metaclass=manager): # 5 5 void CCSGameRules::LevelInitPostEntity(void) LevelInitPostEntity = manager.virtual_function( 5 if PLATFORM ...
- Sun Dec 10, 2017 3:47 pm
- Forum: Plugin Development Support
- Topic: Unable to convert index from pointer in hook.
- Replies: 5
- Views: 11948
Re: Unable to convert index from pointer in hook.
... super().__init__(data) def __missing__(self, key): return False weapon_dict = WeaponDict() class CCSPlayer(CustomType, metaclass=manager): #CCSPlayer::BumpWeapon(CBaseCombatWeapon*) BumpWeapon = manager.virtual_function( 397 if PLATFORM == ...
- Sun Dec 10, 2017 2:28 pm
- Forum: Plugin Development Support
- Topic: Unable to convert index from pointer in hook.
- Replies: 5
- Views: 11948
Unable to convert index from pointer in hook.
... everything to just the conversion to index and still have the issue. This is when trying to +USE on an AK/M4 Code: class CBaseEntity(CustomType, metaclass=manager): #CBaseEntity::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) Use = manager.virtual_function( 97 if ...
- Thu Sep 22, 2016 5:26 am
- Forum: Plugin Development Support
- Topic: Effectively using INI-files with signatures
- Replies: 6
- Views: 8434
Re: Effectively using INI-files with signatures
I tried to go without an object, but it said
So I went with creating a subclass of CustomType (with a meta of my manager). So that class that I made will be capable of providing me with methods? Nice. Sorry for dumb question then.
ValueError: _binary was not specified.
So I went with creating a subclass of CustomType (with a meta of my manager). So that class that I made will be capable of providing me with methods? Nice. Sorry for dumb question then.