-
Notifications
You must be signed in to change notification settings - Fork 140
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
Can't get static classes #52
Comments
Strange. Can you send me the sdk? |
bruh, you didn't even send the sdk. |
sorry for that, there's the new one https://www.mediafire.com/file/2ncu6r97yzl8sy6/SDK.zip/file |
Instead of the first example from above you're supposed to use |
no it doesn't return a valid pointer |
Heap memory is dynamic, addresses change when restarting. So does everything work? you also need to show me what you're printing, not just the result. |
getting static class works now. for some reason when im using the "GetAllActorsOfClass" //init //caching |
what kind of pseudocode is that? send the actual code you're using |
it just a bunch of printf. i can't actually debug cuz the AC is active void UGameplayStatics::GetAllActorsOfClass(class UObject* WorldContextObject, class AActor* ActorClass, TArray<class AActor*>* OutActors)
{
printf("GetAllActorsOfClass Starting\n");
static class UFunction* Func = nullptr;
if (!Func)
Func = Class->GetFunction("GameplayStatics", "GetAllActorsOfClass");
Params::UGameplayStatics_GetAllActorsOfClass_Params Parms{};
Parms.WorldContextObject = WorldContextObject;
Parms.ActorClass = ActorClass;
auto Flgs = Func->FunctionFlags;
Func->FunctionFlags |= 0x400;
printf("GetAllActorsOfClass ProcessEvent start\n");
UObject::ProcessEvent(Func, &Parms);
printf("GetAllActorsOfClass ProcessEvent end\n");
Func->FunctionFlags = Flgs;
if (OutActors != nullptr)
*OutActors = std::move(Parms.OutActors);
printf("GetAllActorofClass Ending\n");
} class UFunction* UClass::GetFunction(const std::string& ClassName, const std::string& FuncName)
{
printf("GetFunction [%s][%s]\n", ClassName.c_str(), FuncName.c_str());
for(UStruct* Clss = this; Clss; Clss = Clss->Super)
{
printf("for(UStruct* Clss = this; Clss; Clss = Clss->Super) [%llx] [%s]\n", (void*)Clss, Clss->GetName().c_str());
if (Clss->GetName() == ClassName)
{
printf("if (Clss->GetName() == ClassName) [%s]\n", Clss->GetName().c_str());
for (UField* Field = Clss->Children; Field; Field = Field->Next)
{
printf("for (UField* Field = Clss->Children; Field; Field = Field->Next) [%llx]\n", (void*)Field);
if(Field->HasTypeFlag(EClassCastFlags::Function) && Field->GetName() == FuncName)
{
printf("if(Field->HasTypeFlag(EClassCastFlags::Function) && Field->GetName() == FuncName) [%s]\n", Field->GetName().c_str());
return static_cast<class UFunction*>(Field);
}
}
}
}
return nullptr;
}
``` |
if (ue->SetObjects())
{
auto MyController = ue->PlayerController;
auto MyPawn = ue->World->OwningGameInstance->LocalPlayers[0]->PlayerController->Pawn;
auto MyPlayer = ue->PlayerController->K2_GetPawn();
auto CamManager = ue->PlayerController->PlayerCameraManager;
auto MyLoc = ue->PlayerController->PlayerCameraManager->GetCameraLocation();
auto MyRot = ue->PlayerController->PlayerCameraManager->GetCameraRotation();
SDK::TArray<SDK::AActor*> actors;
ue->GPStatics->GetAllActorsOfClass(ue->World, (SDK::AActor*)SDK::AArkPlayer::StaticClass(), &actors);
for (int i = 0; i < actors.Num(); i++)
{
auto actor = actors[i];
ImGui::Text("Actor [%s]", actor->GetName().c_str());
}
} static bool SetObjects()
{
//set MathLib for math functions
if (!MathLib) MathLib = (SDK::UKismetMathLibrary*)SDK::UKismetMathLibrary::StaticClass();
//set SystemLib for math functions
if (!KismetSystemLib) KismetSystemLib = (SDK::UKismetSystemLibrary*)SDK::UKismetSystemLibrary::StaticClass();
//Set GPStatics for game functions
if (!GPStatics) GPStatics = (SDK::UGameplayStatics*)SDK::UGameplayStatics::StaticClass()->GetDefaultObj();
if (!GPStatics) return false;
World = *GWorld;
//check world
if (!World) return false;
//Set local player
if (World->OwningGameInstance && World->OwningGameInstance->LocalPlayers.IsValidIndex(0)) LocalPlayer = World->OwningGameInstance->LocalPlayers[0];
if (!LocalPlayer) return false;
//Set player contoller
if (LocalPlayer) PlayerController = LocalPlayer->PlayerController;
if (!PlayerController) return false;
//Everything went well
return true;
} |
you're somehow mananging to call "GetAllActorsOfClass" on an instance of a UClass, call it on an actual GameplayStatics object |
:| |
i was trying to get the static class in my internal but it gives me no result
but when i try to get those static classes on the dumper it gives me results
The text was updated successfully, but these errors were encountered: