Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions broken_patterns.txt
Original file line number Diff line number Diff line change
@@ -1,68 +1,10 @@
Could not rename cGcPlanetGenerationInputData::SetDefaults
Could not rename cGcSimulation::cGcSimulation
Could not rename Engine::SetUniformArrayDefaultMultipleShaders
Could not rename nvgArc
Could not rename cGcBinoculars::UpdateTarget
Could not rename cTkRigidBody::SetAngularVelocity
Could not rename cEgSceneGraphResource::ParseData
Could not rename cGcPlayerHUD::RenderIndicatorPanel
Could not rename cGcPlayerShipOwnership::DestroyShip
Could not rename cTkResource::cTkResource
Could not rename cGcHUDMarker::cGcHUDMarker
Could not rename cGcFrontendPageFunctions::SetPopupBasics
Could not rename cEgRenderer::DrawMeshes
Could not rename cEgRenderer::SetupMeshMaterial
Could not rename cEgRenderer::DrawRenderables
Could not rename cEgDrawGeometry::Draw
Could not rename Engine::GetResourceHandleForNode
Could not rename cEgGeometryResource::CreateVertexInfoForHash
Could not rename GeometryStreaming::cEgGeometryStreamer::RequestStream
Could not rename GeometryStreaming::cEgGeometryStreamer::OnBufferLoadFinish
Could not rename EgInstancedModelExtension::cEgInstancedMeshNode::RenderAsync
Could not rename cTkResourceManager::GetDefaultResource
Could not rename cGcDiscoveryManager::SubmitDiscoveryData
Could not rename cGcMarkerPoint::IsEqual
[ERROR]: No struct data for cGcPortalComponent found
[ERROR]: No struct data for cGcPortalComponent::PersistentData found

cGcGameState
mPlayerSquadronOwnership: 0x2C9540

cGcSimulation
mEnvironment: 0xAC930
mSky: 0xACA30
mEcosystem: 0xB3CA0
mFishManager: 0x25D5E0
mpSolarSystem: 0x25E090
mWarp: 0x25E0B0
mPlayerExperienceDirector: 0x25E820
mPlayer: 0x25F860
mSimulationRootNode: 0x265AB0
maGroupNodes: 0x265AB4
mCurrentUA: 0x265B10

cGcSolarSystem
mSolarSystemMap: 0x51BC20
mSpaceStationNode: 0x522AA0

cGcPlayer
mRootNode: 0xE0
mEquipmentNode: 0x380
mbSpawned: 0x3160
mbIsRunning: 0x3162
mbIsAutoWalking: 0x3168
mFacingDir: 0x3480
mfPitch: 0x3494
mfJetpackTank: 0x3524
mfJetpackUpForce: 0x352C
mfJetpackForce: 0x3530
mfJetpackIgnitionForce: 0x3534
mfAirTimer: 0x3560
mfStamina: 0x56A0
mbIsDying: 0x5780
mbTorchActive: 0x5828
mbTorchLightNeeded: 0x582A

cGcFrontendManager
mGameGuiInput: 0x2250
mPage: 0x2BB0
98 changes: 52 additions & 46 deletions nmspy/data/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
c_void_p,
cast,
)
from ctypes import Structure as _Structure
from enum import IntEnum
from logging import getLogger
from typing import TYPE_CHECKING, Annotated, Generator, Generic, Optional, Type, TypeVar, get_args
Expand Down Expand Up @@ -159,14 +160,15 @@ class cTkResource(Structure):
miType: Annotated[c_enum32[enums.ResourceTypes], 0x8]
msName: Annotated[basic.cTkFixedString[0x100], 0xC]
mxFlags: Annotated[int, Field(c_int32, 0x110)]
mHandle: Annotated[int, Field(c_int32, 0x128)]
mHandle: Annotated[int, Field(c_int32, 0x118)]
muRefCount: Annotated[int, Field(c_int32, 0x12C)]
mbNoQuery: Annotated[bool, Field(c_bool, 0x131)]
mbLoaded: Annotated[bool, Field(c_bool, 0x138)]
mbReplaceWithDefault: Annotated[bool, Field(c_bool, 0x13B)]
mDescriptor: Annotated[cTkResourceDescriptor, 0x188] # TODO: Test
muHotRequestNumber: Annotated[int, Field(c_uint16, 0x1B8)]
mDescriptor: Annotated[cTkResourceDescriptor, 0x190]
muHotRequestNumber: Annotated[int, Field(c_uint16, 0x1C0)]

@function_hook("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? C6 41")
@function_hook("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? C6 41 ? ? 48 8D 05")
def cTkResource(
self,
this: "_Pointer[cTkResource]",
Expand Down Expand Up @@ -282,13 +284,16 @@ def cTkPersonalRNG(self, this: "_Pointer[cTkPersonalRNG]"): ...

@partial_struct
class TkAudioID(Structure):
mpacName: Annotated[Optional[str], Field(c_char_p)]
muID: Annotated[int, Field(c_uint32)]
mbValid: Annotated[bool, Field(c_bool)]
mpacName: Annotated[Optional[str], Field(c_char_p, 0x0)]
muID: Annotated[int, Field(c_uint32, 0x8)]
mbValid: Annotated[bool, Field(c_bool, 0xC)]


class TkAudioObject(Structure):
pass
class TkAudioObject(_Structure):
mID: int
_fields_ = [
("mID", c_uint64),
]


@partial_struct
Expand All @@ -297,18 +302,18 @@ class cTkAudioManager(Structure):
def Play_attenuated(
self,
this: "_Pointer[cTkAudioManager]",
event: _Pointer[TkAudioID],
position: c_uint64,
object: c_int64,
attenuationScale: Annotated[float, c_float],
lEvent: _Pointer[TkAudioID],
lPosition: _Pointer[basic.cTkVector3],
lObject: TkAudioObject,
lAttenuationScale: Annotated[float, c_float],
) -> c_bool: ...

@function_hook("48 83 EC ? 33 C9 4C 8B D2 89 4C 24 ? 49 8B C0 48 89 4C 24 ? 45 33 C9")
def Play(
self,
this: "_Pointer[cTkAudioManager]",
event: _Pointer[TkAudioID],
object: c_int64,
lEvent: _Pointer[TkAudioID],
lObject: TkAudioObject,
) -> c_bool: ...

@function_hook("4C 89 44 24 ? 55 53 56 57 41 55 41 56 48 8D 6C 24")
Expand Down Expand Up @@ -1105,7 +1110,7 @@ def SpawnNewShip(
lbSpawnShipOverride: c_bool,
) -> c_bool: ...

@function_hook("40 55 53 57 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 1D")
@function_hook("40 55 53 57 41 54 41 55 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 1D")
def DestroyShip(
self,
this: "_Pointer[cGcPlayerShipOwnership]",
Expand Down Expand Up @@ -1462,7 +1467,9 @@ class cGcDiscoveryData(Structure):

@partial_struct
class cGcDiscoveryManager(Structure):
@function_hook("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B 59 ? 41 0F B6 F9")
@function_hook(
"48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 48 8D 79 ? 48 8B D9"
)
def SubmitDiscoveryData(
self,
this: "_Pointer[cGcDiscoveryManager]",
Expand All @@ -1475,25 +1482,25 @@ def SubmitDiscoveryData(
class cGcGameState(Structure):
# Found in cGcGameState::cGcGameState
mPlayerState: Annotated[cGcPlayerState, 0xAAD0]
mSavedSpawnState: Annotated[nmse.cGcPlayerSpawnStateData, 0xD5010]
mPlayerShipOwnership: Annotated[cGcPlayerShipOwnership, 0xD50F0]
mPlayerVehicleOwnership: Annotated[cGcPlayerVehicleOwnership, 0xDFB10]
mPlayerCreatureOwnership: Annotated[cGcPlayerCreatureOwnership, 0xE0260]
mPlayerMultitoolOwnership: Annotated[cGcPlayerMultitoolOwnership, 0x2B2160]
mSavedSpawnState: Annotated[nmse.cGcPlayerSpawnStateData, 0xD5070]
mPlayerShipOwnership: Annotated[cGcPlayerShipOwnership, 0xD5150]
mPlayerVehicleOwnership: Annotated[cGcPlayerVehicleOwnership, 0xDFB70]
mPlayerCreatureOwnership: Annotated[cGcPlayerCreatureOwnership, 0xE02C0]
mPlayerMultitoolOwnership: Annotated[cGcPlayerMultitoolOwnership, 0x2B21C0]
mPlayerFreighterOwnership: Annotated[
tuple[cGcPlayerFreighterOwnership, ...],
Field(cGcPlayerFreighterOwnership * 4, 0x2B82E0),
Field(cGcPlayerFreighterOwnership * 4, 0x2B8340),
]
mPlayerFleetManager: Annotated[
tuple[cGcPlayerFleetManager, ...],
Field(cGcPlayerFleetManager * 4, 0x2B95E0),
Field(cGcPlayerFleetManager * 4, 0x2B9640),
]
mPlayerSquadronOwnership: Annotated[cGcPlayerSquadronOwnership, 0x2C9540]
# mDiscoveryManager: Annotated[cGcDiscoveryManager, 0x2BA3B8]
# Found passed into cGcPersistentInteractionsManager::LoadGalacticAddressBuffers wherever it is called.
# Need to subtract the offset of cGcGamestate from the address in the exe which is the pointer to the
# start of cGcApplication::Data
mSavedInteractionsManager: Annotated[cGcPersistentInteractionsManager, 0x317B10]
mSavedInteractionsManager: Annotated[cGcPersistentInteractionsManager, 0x317BE0]

@function_hook("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? C7 41")
def cGcGameState(self, this: "_Pointer[cGcGameState]"): ...
Expand Down Expand Up @@ -1607,7 +1614,7 @@ class cGcPlayer(Structure):
mbIsDying: Annotated[bool, Field(c_bool, 0x5780)]
mbTorchActive: Annotated[bool, Field(c_bool, 0x5828)]
mbTorchLightNeeded: Annotated[bool, Field(c_bool, 0x582A)]
mCommunicator: Annotated[cGcPlayerCommunicator, 0x5908]
mCommunicator: Annotated[cGcPlayerCommunicator, 0x5960]

@function_hook("40 55 41 54 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05")
def CheckFallenThroughFloor(self, this: "_Pointer[cGcPlayer]"): ...
Expand Down Expand Up @@ -1667,7 +1674,10 @@ def SetFacing(self, this: "_Pointer[cGcPlayer]", lDir: _Pointer[basic.cTkVector3


class cGcPlanetGenerationInputData(nmse.cGcPlanetGenerationInputData):
@function_hook("48 89 5C 24 ? 57 48 83 EC ? 0F 57 C0 33 FF 0F 11 01 48 8B D9 48 89 7C 24")
@function_hook(
"40 53 48 83 EC ? 0F 57 C0 48 C7 44 24 ? ? ? ? ? 0F 11 01 48 8B D9 C6 44 24 ? ? 0F 11 41 ? 0F 10 44 "
"24 ? 0F 11 41 ? 48 83 C1 ? E8 ? ? ? ? 48 8D 4B ? E8 ? ? ? ? 48 8D 4B ? E8 ? ? ? ? 48 8D 4B"
)
def SetDefaults(self, this: "_Pointer[cGcPlanetGenerationInputData]"): ...


Expand Down Expand Up @@ -2192,9 +2202,7 @@ def Reset(self, this: "_Pointer[cGcMarkerPoint]"): ...
@function_hook("40 55 53 56 57 41 54 48 8D 6C 24 ? 48 81 EC ? ? ? ? 0F B6 99")
def Update(self, this: "_Pointer[cGcMarkerPoint]"): ...

@function_hook(
"48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 48 8B F9 48 8B F2"
)
@function_hook("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B F9 48 8B F2")
def IsEqual(
self,
this: "_Pointer[cGcMarkerPoint]",
Expand Down Expand Up @@ -2307,9 +2315,7 @@ def group_node(self, name: constants.kaNodeNames) -> basic.TkHandle | None:
if name in (node_names := get_args(constants.kaNodeNames)):
return self.maGroupNodes[node_names.index(name)]

@function_hook(
"48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 33 C0 0F 29 74 24"
)
@function_hook("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 33 C0 0F 29 74 24")
def cGcSimulation(self, this: "_Pointer[cGcSimulation]"): ...

@function_hook("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 45 33 FF")
Expand Down Expand Up @@ -2375,13 +2381,13 @@ def cGcHUD(self, this: "_Pointer[cGcHUD]"): ...

@partial_struct
class cGcHUDMarker(Structure):
_total_size_ = 0x1700
_total_size_ = 0x1BB0

mColour: Annotated[basic.Colour, 0x0]
mData: Annotated[cGcMarkerPoint, 0x10]

@function_hook(
"48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 48 8B F1 48 83 C1"
"48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 48 8B F9 48 83 C1"
)
def cGcHUDMarker(self, this: "_Pointer[cGcHUDMarker]"): ...

Expand All @@ -2403,7 +2409,7 @@ class cGcPlayerHUD(cGcHUD):
)
def cGcPlayerHUD(self, this: "_Pointer[cGcPlayerHUD]"): ...

@function_hook("48 8B C4 55 57 48 8D 68 ? 48 81 EC ? ? ? ? 48 8B 91")
@function_hook("48 8B C4 55 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 91")
def RenderIndicatorPanel(self, this: "_Pointer[cGcPlayerHUD]"): ...

@function_hook("48 8B C4 48 89 48 ? 55 41 56 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 83 B9")
Expand Down Expand Up @@ -2608,10 +2614,10 @@ class cGcFrontendManager(Structure):
# Passed into cGcNGuiManager::BeginFrame as 2nd argument.
mGameGuiInput: Annotated[cTkNGuiInput, 0x2250]
# Found in cGcFrontendManager::cGcFrontendManager
mFrontendRoot: Annotated[cGcNGuiLayer, 0x2468]
mFrontendRoot: Annotated[cGcNGuiLayer, 0x2880]
# Found near the top of cGcFrontendManager::RenderPage
mPage: Annotated[cGcFrontendPage, 0x2BB0]
mSolarSystemMapUI: Annotated[cGcFrontendPageSolarSystemMap, 0x58DF0]
mSolarSystemMapUI: Annotated[cGcFrontendPageSolarSystemMap, 0x59620]

@function_hook(
"48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 54 41 56 41 57 48 83 EC ? 48 8D 05"
Expand Down Expand Up @@ -2714,7 +2720,7 @@ def SendValue(
class cGcApplication(cTkFSM):
@partial_struct
class Data(Structure):
_total_size_ = 0x95F210
_total_size_ = 0x986710
# These are found in cGcApplication::Data::Data
mRealityManager: Annotated[cGcRealityManager, 0x60]
mGameState: Annotated[cGcGameState, 0xE70]
Expand Down Expand Up @@ -3038,7 +3044,7 @@ def GetNodeAbsoluteTransMatrix(
absMat: _Pointer[basic.cTkMatrix34],
): ...

@static_function_hook("4C 89 4C 24 ? 48 89 4C 24 ? 56 41 56")
@static_function_hook("4C 89 4C 24 ? 48 89 4C 24 ? 41 57")
@staticmethod
def SetUniformArrayDefaultMultipleShaders(
laShaderRes: c_uint64,
Expand Down Expand Up @@ -3116,7 +3122,7 @@ def AddNodes(
) -> c_uint64: # TkHandle *
...

@static_function_hook("44 8B D2 4C 8B C1")
@static_function_hook("44 8B D2 4C 8B C1 41 C1 EA")
@staticmethod
def GetResourceHandleForNode(
result: _Pointer[c_int32], # TkStrongType<int,TkStrongTypeIDs::TkResHandleID> *
Expand Down Expand Up @@ -3593,7 +3599,7 @@ def SetMarker(self, this: "_Pointer[cGcBinoculars]"): ...
@function_hook("40 53 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 8D 54 24")
def GetRange(self, this: "_Pointer[cGcBinoculars]") -> c_float: ...

@function_hook("48 8B C4 55 57 41 54 41 56 48 8D A8")
@function_hook("48 8B C4 55 57 41 54 41 56 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 89 58")
def UpdateTarget(self, this: "_Pointer[cGcBinoculars]", lfTimeStep: Annotated[float, c_float]): ...

@function_hook("40 53 48 83 EC ? 48 8B 91 ? ? ? ? 48 8B D9 F3 0F 11 49")
Expand Down Expand Up @@ -4755,8 +4761,8 @@ def SetEmptySlotBackground(
): ...

@static_function_hook(
"48 8B C4 48 89 58 ? 48 89 70 ? 48 89 78 ? 4C 89 48 ? 55 41 54 41 55 41 56 41 57 48 8D 68 ? 48 81 EC "
"? ? ? ? 0F 29 78"
"48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 4C 89 44 24 ? 55 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 "
"81 EC ? ? ? ? 48 8B 85"
)
@staticmethod
def SetPopupBasics(
Expand Down Expand Up @@ -5155,7 +5161,7 @@ class cEgPipelineCommand(Structure):
class cEgRenderer(cEgRendererBase):
_total_size_ = 0x14C90

@static_function_hook("48 8B C4 44 89 40 ? 48 89 48 ? 55 53 41 54")
@static_function_hook("48 8B C4 44 89 40 ? 48 89 48 ? 55 53 41 56")
@staticmethod
def DrawMeshes(
lRenderQueue: _Pointer[cEgRenderQueueBuffer],
Expand Down Expand Up @@ -5186,7 +5192,7 @@ def DrawRenderables(
lbRenderStereoSinglePass: Annotated[bool, c_bool],
): ...

@static_function_hook("48 8B C4 48 89 58 ? 48 89 78 ? 4C 89 70 ? 55 48 8D 68 ? 48 81 EC ? ? ? ? 48 8B 9D")
@static_function_hook("48 8B C4 48 89 58 ? 44 89 40 ? 55 56 57 41 54 41 57")
@staticmethod
def SetupMeshMaterial(
lpMaterialResource: _Pointer[cEgMaterialResource],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
dependencies = [
"pymhf[http_api,gui]==0.2.5"
]
version = "183877.0.dev0"
version = "183877.0"

[dependency-groups]
dev = [
Expand Down
Loading
Loading