-
Member
Is FaceTo 0x1403F5150 (base 140000000) in this build? (i should mention that this is the first time i've tried to get faceto to work.)
Code:
__int64 __fastcall FaceTo(__int64 a1, double angle)
{
__int64 v2; // rdx
__int64 result; // rax
double v4; // xmm1_8
double v5; // xmm2_8
double v6; // xmm0_8
char v7; // r14
char v8; // r15
char v9; // r12
char v10; // r13
char v11; // di
char v12; // bl
char v13; // si
char v14; // bp
__int128 v15; // xmm0
__int128 v16; // [rsp+20h] [rbp-38h] BYREF
result = *(_QWORD *)(a1 + 54216);
if ( result == v2 )
return result;
v4 = 1.0 / (double)(int)*(_QWORD *)(a1 + 54512);
v5 = (double)(int)result * v4;
v6 = (double)(int)v2 * v4;
if ( result > 0 && v5 <= 0.2000000029802322 )
{
v7 = 1;
v8 = 1;
LABEL_10:
v9 = 1;
LABEL_11:
v10 = 0;
goto LABEL_12;
}
if ( result > 0 )
{
v7 = 0;
if ( v5 <= 0.25 )
{
v8 = 1;
goto LABEL_10;
}
}
if ( result > 0 )
{
v8 = 0;
v7 = 0;
if ( v5 <= 0.3499999940395355 )
goto LABEL_10;
}
v8 = 0;
v7 = 0;
v9 = 0;
if ( result <= 0 || v5 < 0.75 )
goto LABEL_11;
v10 = 1;
LABEL_12:
if ( v2 > 0 )
{
if ( v6 <= 0.2000000029802322 )
{
v11 = 1;
v12 = 1;
LABEL_21:
v13 = 1;
goto LABEL_22;
}
v11 = 0;
if ( v6 <= 0.25 )
{
v12 = 1;
goto LABEL_21;
}
v12 = 0;
v11 = 0;
if ( v6 <= 0.3499999940395355 )
goto LABEL_21;
}
v12 = 0;
v11 = 0;
v13 = 0;
if ( v2 > 0 && v6 >= 0.75 )
{
v14 = 1;
goto LABEL_23;
}
LABEL_22:
v14 = 0;
LABEL_23:
v15 = *(_OWORD *)(a1 + 24);
*(_QWORD *)(a1 + 54216) = v2;
v16 = v15;
result = sub_1419C4110(&v16);
if ( v7 != v11 || v8 != v12 || v9 != v13 || v10 != v14 )
return sub_14061E070();
return result;
}
When I call it with first arg the struct from OM, and second arg, is the facing angle (in radians, north is 0 or 2PI) nothing happens. Maybe I need to send a movemement update as well?
The struct I'm passing as arg 1 is the same struct that has the unit (actor) vtable as the first element.
Code:
struct omObj {
void **vmt; /* 0x000 - 0x008 */
char fill1[0x8]; /* 0x008 - 0x010 */
uint8_t otype; /* 0x010 - 0x011 */
char fill2[0x7]; /* 0x011 - 0x018 */
wGUID guid; /* 0x018 - 0x028 */
char fill3[0xc8]; /* 0x028 - 0x0f0 */
struct movementData *moveData; /* 0xf0 - 0xf8 */
char fill4[0x10]; /* 0x0f8 - 0x108 */
vec4 go_position; /* 0x108 - 0x118 */
char fill5[0x30]; /* 0x118 - 0x148 */
vec4 unit_position;/* 0x148 - 0x158 */
char fill6[0x34]; /* 0x158 - 0x18c */
vec4 position2; /* 0x18c - 0x19c */
char fill7[0xee4];/* 0x019c - 0x1080 */
wGUID go_owner; /* 0x1080 - 0x1088 */
}
Some of the fields are probably wrong. like movement data, go_owner.
But other fields are confirmed. e.g., in this struct, vmt[15] is the object name, 14 is height (not scaled), 58 is get facing, 56 is object position. (i think 90 returns a pointer to a guid. i didn't check which guid.). otype, guid, unit position, go position, these are confirmed.
When I call vtable methods, I pass this struct, and it all works. I'm assuming this is the same struct to pass when calling FaceTo.
Last edited by thateuler; 04-25-2022 at 12:39 PM.
-
Established Member
const uint64_t ClickToMoveFacing = 0x3F5A60; // void (CGObject* localPlayer, float facing)
-
Post Thanks / Like - 1 Thanks
thateuler (1 members gave Thanks to oiramario for this useful post)
-
Member
What does 0x210 stand for?
-
Contributor
Originally Posted by
hackjoe8
What does 0x210 stand for?
0x210 is 528 in hex
-
Member
Originally Posted by
ChrisIsMe
0x210 is 528 in hex
Thank you!
-
Member
Reading object names works:
var n1 = Memory.ReadInt64(new IntPtr(BasePointer + 0x148 ), true);
var n2 = Memory.ReadInt64(new IntPtr(n1 + 0xE0), true);
Name = Memory.ReadString(new IntPtr(n2), 255, true);
X = Memory.ReadFloat(new IntPtr(BasePointer + 0x108 ), true);
Y = Memory.ReadFloat(new IntPtr(BasePointer + 0x10C), true);
Z = Memory.ReadFloat(new IntPtr(BasePointer + 0x110), true);
Still got problems with unit name and camera info
thanks in advance
-
Member
Originally Posted by
serioux1337
Still got problems with unit name and camera info
thanks in advance
VMT 15 gives the name for any object type.
I'm using the following for camera Info
Code:
struct Vector3
{
float x;
float y;
float z;
};
struct Vector2
{
float x;
float y;
};
struct Matrix
{
float _00; //a
float _01; //b
float _02; //c
float _10; //d
float _11; //e
float _12; //f
float _20; //g
float _21; //h
float _22; //i
};
struct CCamera {
char pad[0x10];
struct Vector3 camPos; //0x10-0x18
struct Matrix mat; //0x1C-0x3C
float fov; //0x40
};
GetActiveCamera 0000000141D61690
Hat tip to @ChrisIsMe
-
Contributor
Last edited by ChrisIsMe; 11-01-2023 at 05:11 PM.
-
Post Thanks / Like - 2 Thanks
thateuler,
Razzue (2 members gave Thanks to ChrisIsMe for this useful post)