SamboyCoding / Cpp2IL

Work-in-progress tool to reverse unity's IL2CPP toolchain.
MIT License
1.68k stars 197 forks source link

Field offsets not loading correctly for `Among Us` #296

Closed OhMyGuus closed 3 months ago

OhMyGuus commented 3 months ago

Since the last few updates of the game Among Us this tool (and others) doesn't generate the correct Field Offsets for the class PlayerControl.


    private const int MAX_NETOBJECT_INIT_ATTEMPTS; //Field offset: 0x0
    private const float NETOBJECT_INIT_ATTEMPT_WAIT_SECONDS; //Field offset: 0x0
    public static List<PlayerControl> AllPlayerControls; //Field offset: 0x0
    public static PlayerControl LocalPlayer; //Field offset: 0x0
    private const float OFFSET_ANIM_CHARGE; //Field offset: 0x0
    public PlayerControl trackedPlayer; //Field offset: 0x0
    [SerializeField]
    private float killTimer; //Field offset: 0x0
    public int RemainingEmergencies; //Field offset: 0x0
    public LightSource LightPrefab; //Field offset: 0x0
    private LightSource lightSource; //Field offset: 0x0
    [HideInInspector]
    public Collider2D Collider; //Field offset: 0x0
    [HideInInspector]
    public PlayerPhysics MyPhysics; //Field offset: 0x0
    [HideInInspector]
    public CustomNetworkTransform NetTransform; //Field offset: 0x0
    [SerializeField]
    private Collider2D clickKillCollider; //Field offset: 0x0
    public Vector3 defaultCosmeticsScale; //Field offset: 0x0
    public List<PlayerTask> myTasks; //Field offset: 0x0
    public GameObject TargetFlashlight; //Field offset: 0x0
    public KillAnimation[] KillAnimations; //Field offset: 0x0
    public bool isDummy; //Field offset: 0x0
    public bool notRealPlayer; //Field offset: 0x0
    private readonly Logger logger; //Field offset: 0x0
    private readonly List<IPlayerVisibleItem> visibilityItems; //Field offset: 0x0
    private Collider2D[] hitBuffer; //Field offset: 0x0
    private IUsable closest; //Field offset: 0x0
    private bool isNew; //Field offset: 0x0
    private Rigidbody2D rigidbody2D; //Field offset: 0x0
    private Dictionary<Collider2D, IUsable[]> cache; //Field offset: 0x0
    private List<IUsable> itemsInRange; //Field offset: 0x0
    private List<IUsable> newItemsInRange; //Field offset: 0x0
    public List<RoleEffectAnimation> currentRoleAnimations; //Field offset: 0x0
    public AudioClip KillSfx; //Field offset: 0x0
    private bool roleAssigned; //Field offset: 0x0
    public int trackedPlayerColorID; //Field offset: 0x0
    public bool walkingToVent; //Field offset: 0x0
    public bool petting; //Field offset: 0x0
    public bool inMovingPlat; //Field offset: 0x0
    public AudioSource FootSteps; //Field offset: 0x0
    public bool protectedByGuardianThisRound; //Field offset: 0x0
    public bool shapeshifting; //Field offset: 0x0
    public bool waitingForShapeshiftResponse; //Field offset: 0x0
    public bool isKilling; //Field offset: 0x0
    public bool onLadder; //Field offset: 0x0
    private NetworkedPlayerInfo CachedPlayerData; //Field offset: 0x0
    private int protectedByGuardianId; //Field offset: 0x0
    private float flashlightAngle; //Field offset: 0x0
    private int shapeshiftTargetPlayerId; //Field offset: 0x0
    private bool shouldAppearInvisible; //Field offset: 0x0
    public bool isTrackingPlayer; //Field offset: 0x0
    private byte scannerCount; //Field offset: 0x0
    private float invisibilityAlpha; //Field offset: 0x0
    private int LastStartCounter; //Field offset: 0x24
    public byte PlayerId; //Field offset: 0x28
    public string FriendCode; //Field offset: 0x2C
    public string Puid; //Field offset: 0x30
    public float MaxReportDistance; //Field offset: 0x34
    public bool moveable; //Field offset: 0x38
    public CosmeticsLayer cosmetics; //Field offset: 0x3C
    [HideInInspector]
    public bool ForceKillTimerContinue; //Field offset: 0x40
    [CompilerGenerated]
    private PlayerOutfitType <CurrentOutfitType>k__BackingField; //Field offset: 0x44
    public bool inVent; //Field offset: 0x48

Correct field offsets, using CE: image

SamboyCoding commented 3 months ago

(Likely) Duplicate of #167