0

I almost finished to build a project when this code gave me an error:

    struct dyld_all_image_infos *dyldaii;
mach_msg_type_number_t size = sizeof(dyld_all_image_infos);
vm_offset_t readMem;
kern_return_t kr = vm_read(task, address, size, &readMem, &size);
if (kr != KERN_SUCCESS)
{
    return;
}

***dyldaii = (dyld_all_image_infos) readMem;***
int imageCount = dyldaii->infoArrayCount;
mach_msg_type_number_t dataCnt = imageCount * 24;
struct dyld_image_info *g_dii = NULL;

The line dyldaii = (dyld_all_image_infos) readMem; is giving me an error "expected expression". What would be needed to complete or fix this phrase?

4
  • Please post a minimal reproducible example Commented Nov 2, 2016 at 14:25
  • You're saying you want a pointer to a structure from the kernel, then you try to cast that pointer to the structure without dereferencing it. This cannot work. Commented Nov 2, 2016 at 14:50
  • The thing is called struct dyld_all_image_infos, not dyld_all_image_infos. Commented Nov 2, 2016 at 15:17
  • Thanks's a lot for the responses! Ill be sure to change this! Commented Nov 2, 2016 at 17:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.