Source Code ProjectWorldToScreen hooklama

sselraefyruf

Member
Joined
Nov 4, 2021
Topics
2
Messages
2
Reaction score
5
RC Point
0
KONU ALINTI DEĞİLDİR.

Fonksiyon aldığı 4 tane parametre var bunlar ise;
Parametreler:
APlayerController const * Player,
const FVector & WorldPosition,
FVector2D & ScreenPosition,
bool bPlayerViewportRelative

Zaten unreal engine'nin kendi dökümasyonunda var asıl soru nasıl hook atıcaz.
Unutmadan hatırlatayım : Thiscall ile olan yeri çağırırsınız , Fastcall ile hook atarsınız o yüzden biz fastcall ile hooklucaz.
ProjectWorldToScreen:
inline bool WorldToScreen(PlayerController* player, FVector* WorldPos, FVector2D* ScreenPos)
{
    auto Address = (uintptr_t)GetModuleHandle(nullptr) + 0x2C57410; // Mir4
    return reinterpret_cast<bool(__fastcall*)(PlayerController*, FVector*, FVector2D*, bool)>(Address)(player, WorldPos, ScreenPos, false);
}

ProjectWorldToScreen adresini bulmak istiyorsanız oyunu dumplayın zor bir şey değil stringini arayın adresi bulun azcık reverse ;).
FVector:
struct FVector
{
    float                                              X;                                                         
    float                                              Y;                                                         
    float                                              Z;                                                         


    inline FVector() : X(0), Y(0), Z(0) {}

    inline FVector(float x, float y, float z) : X(x), Y(y), Z(z) {}

    inline FVector operator + (const FVector& other) const { return FVector(X + other.X, Y + other.Y, Z + other.Z); }

    inline FVector operator - (const FVector& other) const { return FVector(X - other.X, Y - other.Y, Z - other.Z); }

    inline FVector operator * (float scalar) const { return FVector(X * scalar, Y * scalar, Z * scalar); }

    inline FVector operator * (const FVector& other) const { return FVector(X * other.X, Y * other.Y, Z * other.Z); }

    inline FVector operator / (float scalar) const { return FVector(X / scalar, Y / scalar, Z / scalar); }

    inline FVector operator / (const FVector& other) const { return FVector(X / other.X, Y / other.Y, Z / other.Z); }

    inline FVector& operator=  (const FVector& other) { X = other.X; Y = other.Y; Z = other.Z; return *this; }

    inline FVector& operator+= (const FVector& other) { X += other.X; Y += other.Y; Z += other.Z; return *this; }

    inline FVector& operator-= (const FVector& other) { X -= other.X; Y -= other.Y; Z -= other.Z; return *this; }

    inline FVector& operator*= (const float other) { X *= other; Y *= other; Z *= other; return *this; }

    inline float Dot(const FVector& b) const { return (X * b.X) + (Y * b.Y) + (Z * b.Z); }

    inline float MagnitudeSqr() const { return Dot(*this); }

    inline float Magnitude() const { return sqrtf(MagnitudeSqr()); }

    inline FVector Unit() const
    {
        const float fMagnitude = Magnitude();
        return FVector(X / fMagnitude, Y / fMagnitude, Z / fMagnitude);
    }

    friend bool operator==(const FVector& first, const FVector& second) { return first.X == second.X && first.Y == second.Y && first.Z == second.Z; }

    friend bool operator!=(const FVector& first, const FVector& second) { return !(first == second); }

};
FVector2D:
struct FVector2D
{
    float                                              X;                                                         
    float                                              Y;                                                         


    inline FVector2D() : X(0), Y(0) {}

    inline FVector2D(float x, float y) : X(x), Y(y) {}

    inline FVector2D operator + (const FVector2D& other) const { return FVector2D(X + other.X, Y + other.Y); }

    inline FVector2D operator - (const FVector2D& other) const { return FVector2D(X - other.X, Y - other.Y); }

    inline FVector2D operator * (float scalar) const { return FVector2D(X * scalar, Y * scalar); }

    inline FVector2D operator * (const FVector2D& other) const { return FVector2D(X * other.X, Y * other.Y); }

    inline FVector2D operator / (float scalar) const { return FVector2D(X / scalar, Y / scalar); }

    inline FVector2D operator / (const FVector2D& other) const { return FVector2D(X / other.X, Y / other.Y); }

    inline FVector2D& operator=  (const FVector2D& other) { X = other.X; Y = other.Y; return *this; }

    inline FVector2D& operator+= (const FVector2D& other) { X += other.X; Y += other.Y; return *this; }

    inline FVector2D& operator-= (const FVector2D& other) { X -= other.X; Y -= other.Y; return *this; }

    inline FVector2D& operator*= (const float other) { X *= other; Y *= other; return *this; }

};

Bu kadar zor değil pek PlayerController struct yapısında reverseleyin öhm.

UC'de zaten paylaşmıştım konudaki son post görmek isteyenler için (uc forum linki yasak olduğunu düşünmüyorum ondan attım)
https://www.unknowncheats.me/forum/other-fps-games/471318-mir4-reversal-structs-offsets-2.html


Oyun içi fotoğraf;
 
Top