-
Notifications
You must be signed in to change notification settings - Fork 264
Description
Version and Platform (required):
- Binary Ninja Version: 5.3.8651-dev Ultimate, 61182526
- OS: macos
- OS Version: 26.1
- CPU Architecture: arm64
Bug Description:
Instance variables of struct types have a type string formatted as {structTypeName="firstFieldName"firstFieldType"secondFieldName"secondFieldType"}
ObjCProcessor currently skips parsing the contents of the {…} and replaces the field with a void*.
Here are a couple of example seen in /usr/libexec/locationd on macOS 26.1:
100895648 struct objc_ivar_list_t ivar_list_CLDaemonStatusStateTracker =
100895648 {
100895648 uint32_t entsize = 0x20
10089564c uint32_t count = 0x3
100895650 }
100895650 struct objc_ivar_t ivar__state =
100895650 {
100895650 uint32_t* offset = data_1008b590c
100895658 char* name = ivarName__state {"_state"}
100895660 char* type = ivarType__state {"{_CLDaemonStatusStateTrackerState="batteryData"{Battery="level"d"charged"B"connected"B"chargerType"i"wasConnected"B"chargerFamily"i}"reachability"i"thermalLevel"i"thermalPressure"i"airplaneMode"B"batterySaverModeEnabled"B"restrictedMode"B}"}
100895668 uint32_t alignment = 0x3
10089566c uint32_t size = 0x28
100895670 }
The ivar should end up as struct _CLDaemonStatusStateTrackerState _state with:
struct _CLDaemonStatusStateTrackerState
{
struct
{
double level;
bool charged;
bool connected;
int32_t chargerType;
bool wasConnected;
int32_t chargerFamily;
} batteryData;
int32_t reachability;
int32_t thermalLevel;
int32_t thermalPressure;
bool airplaneMode;
bool batterySaverModeEnabled;
bool restrictedMode;
};
100893640 struct objc_ivar_t ivar__mostRecentVehicleState =
100893640 {
100893640 uint32_t* offset = data_1008b57f8
100893648 char* name = ivarName__mostRecentVehicleState {"_mostRecentVehicleState"}
100893650 char* type = ivarType__mostRecentVehicleState {"{?="version"C"timestamp"Q"state"I"confidence"C"hints"S}"}
100893658 uint32_t alignment = 0x0
10089365c uint32_t size = 0x10
100893660 }
This should be struct { unsigned char version; unsigned long long timestamp; unsigned int state; unsigned char confidence; unsigned short hints; } _mostRecentVehicleState;
100893660 struct objc_ivar_t ivar__wifiServiceClient =
100893660 {
100893660 uint32_t* offset = data_1008b57f4
100893668 char* name = ivarName__wifiServiceClient {"_wifiServiceClient"}
100893670 char* type = ivarType__wifiServiceClient {"{unique_ptr<CLWifiService_Type::Client, std::default_delete<CLWifiService_Type::Client>>="__ptr_"^{Client}}"}
100893678 uint32_t alignment = 0x3
10089367c uint32_t size = 0x8
100893680 }
This should be struct unique_ptr<CLWifiService_Type::Client, std::default_delete<CLWifiService_Type::Client>> _wifiServiceClient; with
struct unique_ptr<CLWifiService_Type::Client, std::default_delete<CLWifiService_Type::Client>> {
struct Client *__ptr_;
};
Binary:
alert glade matches well