Jump to content

Unity framework support vmadder_slide


Go to solution Solved by Laxus,

5 posts in this topic

Recommended Posts

Posted

below is the code im working with im trying to get unity framework support but it crashes at launch. Any body has suggestions?
 

uint64_t getRealOffset(uint64_t offset){
    for (int i = 0; i < _dyld_image_count(); i++){
        const char *image_name = _dyld_get_image_name(i);
        if(strcmp(image_name,"UnityFramework") == 0){
            return _dyld_get_image_vmaddr_slide(i) + offset;
        }
    }
    return _dyld_get_image_vmaddr_slide(0) + offset;
}

  • Solution
Posted (edited)

Try this. If you trying to do a function pointer and it crash, create a function pointer inside a function then call it

uint64_t aslr_for_framework(const char* framework)
{
  int image_count = _dyld_image_count();
	  for (int i = 0; i < image_count; i++)
  {
    if (strstr(_dyld_get_image_name(i), framework))
    {
      return _dyld_get_image_vmaddr_slide(i);
      }
    }
    return 0; // could not find image
}
	uint64_t getRealOffset(uint64_t offset)
{
    uint64_t aslr = aslr_for_framework("UnityFramework"); //frameworks binary name
	    NSLog(@"ASLR %#llx", aslr);
    return aslr+offset;
}
	uint64_t getRealOffset(uint64_t offset);
Updated by Laxus
Posted (edited)

ayo thanks brother this is working looks like i didn’t return 0 but instead returned regular vmadder slide that fixed the issue:)

Updated by Red16
  • Like 1
Posted
On 12/1/2020 at 7:01 AM, Laxus said:

Try this. If you trying to do a function pointer and it crash, create a function pointer inside a function then call it


uint64_t aslr_for_framework(const char* framework)
{
  int image_count = _dyld_image_count();
	  for (int i = 0; i < image_count; i++)
  {
    if (strstr(_dyld_get_image_name(i), framework))
    {
      return _dyld_get_image_vmaddr_slide(i);
      }
    }
    return 0; // could not find image
}
	uint64_t getRealOffset(uint64_t offset)
{
    uint64_t aslr = aslr_for_framework("UnityFramework"); //frameworks binary name
	    NSLog(@"ASLR %#llx", aslr);
    return aslr+offset;
}
	uint64_t getRealOffset(uint64_t offset);

nothing happened when I used this code any help plz :(

@Red16

@Laxus

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines