Open pgoodman opened 1 year ago
Good process to find them for IDA Pro:
strings -t x /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang | grep __builtin_xnu_
That gets us addresses like:
43f4550 __builtin_xnu_type_signature
43f456d __builtin_xnu_type_summary
43f4588 __builtin_xnu_types_compatible
4486b96 __builtin_xnu_type_signature
4486bb3 __builtin_xnu_type_summary
4486bce __builtin_xnu_types_compatible
4487788 __builtin_xnu_type_signature
44877a5 __builtin_xnu_type_summary
Then go to 10<address>
in IDA, e.g. 1043f4550
:
Then, double click on the data reference, and decompile:
Sometimes we won't find a coderef, and if IDA isn't telling us the DREFs, then we can go searching for them using search for bytes, using a hex string of bytes. Those results can get you the TARGET_BUILTIN
info, e.g. the feature set:
The order of TARGET_BUILTIN
info is:
#define TARGET_BUILTIN(id, type, attrs, features) \
{#id, type, attrs, kNoHeaderName, \
clang::LanguageID::ALL_LANGUAGES, features},
struct Info {
const char *Name, *Type, *Attributes, *HeaderName;
LanguageID Langs;
const char *Features;
};
We can type it as:
struct clang_Builtin_Info {
const char *Name, *Type, *Attributes, *HeaderName;
int Langs;
const char *Features;
};
In: Open Subviews > Local Types, right click insert.
Click on an address and key in y
to apply the new structure type, clang_Builtin_Info
. Then right click on the address to make an array if there are a bunch of them that you want to make.
To find them:
__builtin_altivec_vec_replace_elt
__builtin_altivec_vec_replace_unaligned
__builtin_coro_param
__builtin_get_pointer_
__builtin_get_pointer_lower_bound
__builtin_get_pointer_upper_bound
__builtin_get_vtable_pointer
__builtin_load_member_function_pointer
__builtin_ptrauth_auth
__builtin_ptrauth_auth_and_resign
__builtin_ptrauth_blend_discriminator
__builtin_ptrauth_sign_constant
__builtin_ptrauth_sign_generic_data
__builtin_ptrauth_sign_unauthenticated
__builtin_ptrauth_string_discriminator
__builtin_ptrauth_strip
__builtin_ptrauth_type_discriminator
__builtin_rvv_vmandnot_mm
__builtin_rvv_vmornot_mm
__builtin_rvv_vpopc_m
__builtin_rvv_vpopc_m_m
__builtin_terminated_by_to_indexable
__builtin_tmo_type_get_alignment
__builtin_tmo_type_get_metadata
__builtin_tmo_type_get_size
__builtin_unsafe_forge_bidi_indexable
__builtin_unsafe_forge_single
__builtin_unsafe_terminated_by_from_indexable
__builtin_unsafe_terminated_by_to_indexable
__builtin_va_lisodulemap
__builtin_virtual_member_address
__builtin_wasm_trunc_sat_zero_s_f64x2_i32x4
__builtin_wasm_trunc_sat_zero_u_f64x2_i32x4
__builtin_xnu_type_signature
__builtin_xnu_type_summary
__builtin_xnu_types_compatible