FFXIVAPP / sharlayan

Visit us on Discord! https://discord.gg/aCzSANp
https://xivapp.com
MIT License
114 stars 35 forks source link

Collection of 64bit Offsets, Structures and Enums for Patch 3.5 #12

Open ghost opened 7 years ago

ghost commented 7 years ago

Since @EmperorArthur started an issue in the main repository for 64bit offsets which are outdated I thought we can have that collection of information in the Memory repository where everyone can share his results.

The following lists and tables are non-exhaustive and there are many things that either have to be verified or found in the first place. For example I wasn't able to find units for all mob difficulty icons in the game.

I'd be glad if you happen to have something to improve this overview.


ActorEntity

In my newest gist you will find a Cheat Engine list of addresses and a Lua script included in the ct file which is separately available as well. When you run CE and open the ct file it will automatically attach to the game and calculate the addresses which are written to the memory records so you don't have to find base addresses at all.

Here are my current offsets for the ActorEntity target struct (with some redundant annotations about the values):

Name                  = 0x30, -- Text[68]
Id                    = 0x74, -- Int32
NpcId1                = 0x7C, -- Int32
NpcId2                = 0x80, -- Int32
OwnerId               = 0x84, -- Int32
--[[ 0 Unknown, 1 PC, 2 Monster, 3 NPC, 5 Aetheryte, 6 Gathering, 7 EObj, 9 Minion ]]--
Type                  = 0x8C, -- Int8
--[[ Probably bitfield - 0 Unknown, 1 Own, 2 True, 4 False ]]--
TargetType            = 0x8D, -- Int8
--[[ 0x8F could be some server-side altitude difference - lagging ]]--
--[[ 0x90 is distance in rounded yalms as well but it is lagging - maybe server-side value? ]]--
--[[ 0x91 could be some *local* altitude difference ]]--
--[[ 0x92 *local* distance in rounded yalms since it is not lagging at all ]]--
Distance              = 0x92, -- Int8
X                     = 0xB0, -- float
Z                     = 0xB4, -- float
Y                     = 0xB8, -- float
--[[ Rotation around own axis (-pi, pi) ]]--
Heading               = 0xC0, -- float
HitBoxRadius          = 0xD0, -- float
--[[ 0x801AFFFF for FATE targets (Monster and NPCs!) - Check for Type = Monster]]--
FateFlag              = 0xF4, -- Int32
--[[ 0 Unknown, 1 Idle, 2 Dead, 3 Sitting, 4 Mounted, 5 Crafting, 6 Gathering, 7 Melding,
8 SMachine (what is this?!) ]]--
ActionStatusId        = 0x1A0, -- Int8
IconId                = 0x1B0, -- Int8
--[[
  Certain enemies are part of factions - thus NPCs can be aggressive but still friendly.
  Guards and NPCs during FATEs do happen to behave like that.

  0 Allied, 4 Monsters, 6 Ixali, 7 Amalj'aa, 8 Kobold
]]--
FactionId             = 0x1B1, -- Int8
--[[ Probably bitfield - 0 Unknown, 1 Claimed, 2 Idle, 5 Crafting, 6 UnknownUnSheathed,
7 UnknownSheathed, 97 Unknown (something in the middle of gathering) ]]--
StatusId              = 0x1B2, -- Int8
ClaimedById           = 0x1B8, -- Int32
TargetId              = 0x1C0, -- Int32
JobId                 = 0x1440, -- Int8
Level                 = 0x1441, -- Int8
--[[ 1 Maelstrom, 2 Order of the Twin Adder, 3 Immortal Flames ]]--
GrandCompany          = 0x1442, -- Int8
GrandCompanyRank      = 0x1443, -- Int8
TitleId               = 0x1446, -- Int16
CurrentHp             = 0x1448, -- Int32
MaxHp                 = 0x144C, -- Int32
CurrentMp             = 0x1450, -- Int32
MaxMp                 = 0x1454, -- Int32
CurrentTp             = 0x1458, -- Int16
CurrentGp             = 0x145A, -- Int16
MaxGp                 = 0x145C, -- Int16
CurrentCp             = 0x145E, -- Int16
MaxCp                 = 0x1460, -- Int16
--[[
  val & 0x1
      - boolean value indicating whether entity is aggressive
  val & 0x2
      - boolean value indicating whether entity is currently in combat
  val & 0x4
      - boolean value indicating entities battle stance (weapon shethed)
  val & 0x80
      - boolean value indicating whether entity is currently casting
]]--
CombatFlags           = 0x15CA, -- Int8 (bitfield!)
--[[ See below for more detailed information  ]]--
DifficultyRank        = 0x179D, -- Int8
IsCasting1            = 0x19D0, -- Int8
IsCasting2            = 0x19D1, -- Int8
CastingId             = 0x19D4, -- UInt8!!
CastingTargetId       = 0x19E0, -- Int32
CastingProgress       = 0x1A04, -- float
CastingTime           = 0x1A08 -- float

Icons

These icons appear next to a players name in the party list and/or above their heads next to their name, and describe what the player's status or what they are seeking. The IconId obtained at 0x1B0 is different to the ones from the API. Either the API is highly outdated or 64 bit has almost completely different ids. I wasn't able to get all the icons yet since I couldn't create an alliance, find someone with particular quests or FATEs as well as some duty realated stuff. Here is my non-exhaustive list for the time being:

Id Description Id Description
5 Disconnecting 27 Mentor
11 Idle Cam 28 PvE Mentor
13 Busy 29 Trade Mentor
15 Playing Triple Triad 30 PvP Mentor
16 Cutscene 31 Returning Player
18 Away From Keyboard 32 Sprout
21 Looking to Meld Materia 36 Party Leader
22 RP 37 Party Member
23 Looking for Party (Green) 38 Cross World Party Leader
25 Duty Finder Queue 39 Cross World Party Member
26 Recruiting via Party Finder 43 In Duty

Factions

Certains entities are associated with factions. Aggressiveness and hostility are not the same which is why factions must be used to determine either of those. NPC guards can be aggressive but they are not hostile towards your character. There is a enmity table for each faction to deduce hostility but this is just too deep into the memory. The factions I encountered thus far are the following:

Id Description
0 Allied NPCs and PCs
4 Monsters in general
6 Ixali
7 Amalj'aa
8 Kobold

Combat Flags

At 0x15CA you will encounter a byte which indicates certain actions and behaviors of an entity. Thus far I only noticed four interesting bits:

Bit Mask Description
1 0x1 Indicates whether the entity is aggressive
2 0x2 Indicates whether the entity is currently in combat
3 0x4 Indicates the battle stance, i.e. whether the weapon is sheathed
8 0x80 Indicates whether the entity is currently casting

Mob Difficulty Ranks

At 0x179D there is a byte that describes (together with the first bit of the Combat Flags) which icons is displayed above an enemy. Here is a table with the values I found thus far:

Aggressive

Level Icon Value Affected Units
1 0 Generic Hostile Units and newly spawned Adds during Boss Encounters
2 3 Dungeon Trash
3 ?? ??
4 1 Elite Marks
5 6 Minor Boss
6 2 Major Boss

Passive

Level Icon Value Affected Units
1 0 Generic Passive Units
2 ?? Bioculture Node in Aetherochemical Research Facility
3 ?? ??
4 1 Elite Marks
5 ?? ??
6 2 Chitin Carapace and Corona on Bismarck (presumably targets of Major Bosses that don't fight themselves)

Status Effects

Status effects start at 0x1850 and are 12 bytes long with the following structure:

Offset Type Name
0x00 Int16 Id
0x02 Int8 Stacks
0x03 Int8 ???
0x04 float Duration
0x08 Int32 CasterId

It seems that only 30 status effect fit in there as seen in the attached picture. Enemies which are not PCs seem to have more, however Ravahn mentioned once they are not actually stored in the momory but communicated using network packages. I'll be trying to track the status effects on some S ranks and big FATE mobs with many people to find it out.

Status Effects

Metadata

I am not entirely sure but I do think that the entire struct is 0x2730 bytes long for 64bit. Here is a ToDo list as well to keep track on what is still missing to recreate a compatible structure with your ActorEntity class without my custom additions and findings.


Camera

Right at ffxiv_dx11.exe+0x16BE8C0 there is a 4 byte pointer that points to the camera structure. It contains a lot of different variables, but the most notable ones are the following:

Offset Type Description
+0x110 Int8 Boolean value indicating whether free camera mode (not first person mode) is enabled.
+0x118 float Distance of the camera. Value between 1.5 and 20 in steps of 0.25.
+0x134 float Azimuth of the camera. Can confirm that zero is north and facing south.
+0x138 float Elevation of the camera. Above the ground it is negative and caps at -pi/2 + epsilon. Below the ground it caps exactly at +pi/4.
+0x1A0 float X value of world coordinates of the camera.
+0x1A4 float Z value of world coordinates of the camera.
+0x1A8 float Y value of world coordinates of the camera.
+0x1B0 float X value of world coordinates of the focused object.
+0x1B4 float Z value of world coordinates of the focused object.
+0x1B8 float Y value of world coordinates of the focused object.

Map ID

The current map id (not to confuse with the zone id!) can be found directly at ffxiv_dx11.exe+0x186F940 as a Int32 value. However, some maps dont have this value, e.g. "The Topmast Subdivision" in "Mist". However there is another unique value right at ffxiv_dx11.exe+0x186F93C describing that map.


State

At ffxiv_dx11.exe+0x1870C60 you will find an Int8 which has the value 1 if the player is currently in-game; otherwise, 0 when the main menu or character selection are active. This wasn't the correct byte yet...

logicallysynced commented 7 years ago

You wouldn't happen to know the memory offsets for DX9 duty finder timer/pop would you? I've been trying to locate them in Cheat Engine but they're kinda elusive.. D:

ghost commented 7 years ago

@roxaskeyheart Actually I haven't had the need for that yet, but I'll add it to my todo. At the moment I am working more with 64bit than 32bit but I'll let you know if I find something.

logicallysynced commented 7 years ago

That's all good, I'm looking forward to the 64-bit offsets anyways~ :) but in the mean time I will keep digging.

Icehunter commented 7 years ago

@ChristianIvicevic I just saw this... omg... been so busy with family but I'm back playing now :D

BitMask for combat flags is now +16E7, the Icon to combine with it is +16D9

0=1 1=4 2=6 3=2 4=3 6=5

In regards to how you have them listed.