ProjectWorldToScreen hooklama (zor değil abi ehe)

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Banlı Üye
Katılım
16 Eki 2021
Mesajlar
2
Tepki puanı
0
Yaş
27
4 HİZMET YILI
Konu alıntı değil yoruma gelip fanboyluk yapmayın tşk türk forumlarında açtım uc'de sadece fonksiyon veriliyor yani anlatan yok ü.
Bu arada ensoul sdk'ya slm ama forumdan gitmiş galiba uzaklar üzülmek öhm neyse konuya dönek.

Fonksiyonun zaten aldığı 4 parametre var ue4 dökümanında var.
C++:
APlayerController const * Player,
const FVector & WorldPosition,
FVector2D & ScreenPosition,
bool bPlayerViewportRelative



Bakın şimdi Thiscall = olan yeri çağırıcaksınız ilk parametre olarak'da ecx alabilir.
Eğer hook atıcaksanız = Fastcall ilk iki parametre olarak'da ecx,edx alabilir anladiniz inş eyw.
C++:
inline bool WorldToScreen(PlayerController* player, FVector* WorldPos, FVector2D* ScreenPos)
{
    auto Address = (uintptr_t)GetModuleHandle(nullptr) + 0x2C57410; //
    return reinterpret_cast<bool(__fastcall*)(PlayerController*, FVector*, FVector2D*, bool)>(Address)(player, WorldPos, ScreenPos, false);
}

Fonksiyonun kendi parametresine döndürüyoruz hook atıp asdas.
ProjectWorldToScreen adresini bulmak istiyorsanız oyunu dumplayın zor bir şey değil stringini arayın adresi bulun azcık reverse (bende reverse berbatım ü) ;).

FVector ve FVector2D Yapıları;
C++:
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); }

};
C++:
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)
Bağlantıları görmek için lütfen Giriş Yap


Oyun içi fotoğraf;

UE4 konusunda birazcık iyiyim ama hala zortum Ğ.
 
Reverser
Katılım
27 Ara 2017
Mesajlar
236
Çözümler
2
Tepki puanı
4,639
Ödüller
13
8 HİZMET YILI
Ben bir hook göremedim ama neyse.
Bu yaptığın işlem bir oyun fonksiyonu çağırma.
Birde 64bit oyunda çalıştığın için diğer şeylere bakmana gerek yok bütün fonksiyonlar fastcall.

Arda hep aynı yerinde sayiyorsun.
 
Mermiler Seksin Bu Alemde Teksin
Süper Üye
Katılım
15 May 2016
Mesajlar
895
Çözümler
2
Tepki puanı
53
Ödüller
10
Yaş
28
10 HİZMET YILI
Bence Biraz daha çalışırsan daha güzelini yapa bilirsin
 
  • Konuyu başlatan
  • Yasaklandı
  • #5
Banlı Üye
Katılım
16 Eki 2021
Mesajlar
2
Tepki puanı
0
Yaş
27
4 HİZMET YILI
Ben bir hook göremedim ama neyse.
Bu yaptığın işlem bir oyun fonksiyonu çağırma.
Birde 64bit oyunda çalıştığın için diğer şeylere bakmana gerek yok bütün fonksiyonlar fastcall.

Arda hep aynı yerinde sayiyorsun.
Oha ünlü olmuşum nader çok eskiden demişti hook atıcaksan fastcall olarak çağırıcaksın diye konuşmalarımızda vardı ehe
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst