Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access violation when printing specific structs #94

Open
apple1417 opened this issue Jul 10, 2021 · 1 comment
Open

Access violation when printing specific structs #94

apple1417 opened this issue Jul 10, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@apple1417
Copy link
Contributor

This code causes a consistent crash when the hooked function is run (shortly after loading into a map with vendors).

def Log(caller: unrealsdk.UObject, function: unrealsdk.UFunction, params: unrealsdk.FStruct) -> bool:
    unrealsdk.Log(params)
    
unrealsdk.RunHook("WillowGame.PopulationFactoryVendingMachine.CreateInteractiveObject", "test", Log)

The function signature (and thus what the params struct should contain) is as follows:

protected function WillowInteractiveObject CreateInteractiveObject(PopulationMaster Master, Vector SpawnLocation, Rotator SpawnRotation, int GameStage, int AwesomeLevel, InteractiveObjectDefinition SelectedObjectDefinition) {
@apple1417 apple1417 added the bug Something isn't working label Jul 16, 2022
@apple1417
Copy link
Contributor Author

Another example:

  1. Add the item BL2(BwAAAAAR6wIEAQcIMBBarQjBAUEAwf///////////38DAQ4gAME=)
  2. Hover over an item right next to it
  3. Run
def Log(caller: unrealsdk.UObject, function: unrealsdk.UFunction, params: unrealsdk.FStruct) -> bool:
    unrealsdk.Log(params)
    
unrealsdk.RunHook("WillowGame.PopulationFactoryVendingMachine.CreateInteractiveObject", "test", Log)

Interestingly, this crash comes from python functions.

PyUnicode_CopyCharacters() Address = 0x5fddb6a0 (filename not found) [in C:\Program Files (x86)\Steam\steamapps\common\Borderlands 2\Binaries\Win32\python37.dll]
PyUnicode_FromWideChar() Address = 0x5fddbf97 (filename not found) [in C:\Program Files (x86)\Steam\steamapps\common\Borderlands 2\Binaries\Win32\python37.dll]

The reason I'm leaving this under the same issue however is that neither crash happens if you log every parameter separately, only when you log the same struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant