diff --git a/template/KittyMemory/KittyMemory.cpp b/template/KittyMemory/KittyMemory.cpp index 382b7fc..d0e975e 100644 --- a/template/KittyMemory/KittyMemory.cpp +++ b/template/KittyMemory/KittyMemory.cpp @@ -140,11 +140,29 @@ namespace KittyMemory { MemoryFileInfo _info; - _info.index = 0, - _info.header = _dyld_get_image_header(0); - _info.name = _dyld_get_image_name(0); - _info.address = _dyld_get_image_vmaddr_slide(0); - + // If no file name provided, KittyMemory will use this method. + // This method goes over all images and uses the first image + // that starts with "/private/var/containers/Bundle/Application" + // as taking the first one (at index 0) isn't reliable anymore with the + // palera1n jailbreak. This new approach seems decent enough to me + // as it's very unlikely that there's another image in the above path. + // Unless it's a Unity Framework game but that's where the + // getMemoryFileInfo method is for, where you would provide the file name. + std::string applicationsPath = "/private/var/containers/Bundle/Application"; + for (uint32_t i = 0; i < _dyld_image_count(); i++) + { + const char *name = _dyld_get_image_name(i); + if (!name) continue; + std::string fullpath(name); + if (strncmp(fullpath.c_str(), applicationsPath.c_str(), applicationsPath.size()) == 0) + { + _info.index = i; + _info.header = _dyld_get_image_header(i); + _info.name = _dyld_get_image_name(i); + _info.address = _dyld_get_image_vmaddr_slide(i); + break; + } + } return _info; } diff --git a/template/NIC/control b/template/NIC/control index 7db1205..60100a2 100644 --- a/template/NIC/control +++ b/template/NIC/control @@ -1,4 +1,4 @@ -name "Ted2's Mod Menu Template v0.9.4" +name "Ted2's Mod Menu Template v1.0.0" prompt FILTER "Bundle filter" "com.company.appname" constrain file "control" to package constrain "theos" to link_theos diff --git a/template/versionCheck.sh b/template/versionCheck.sh index 7113a9d..226d2a4 100755 --- a/template/versionCheck.sh +++ b/template/versionCheck.sh @@ -1,5 +1,5 @@ #!/bin/bash -VERSION='0.9.4' +VERSION='1.0.0' # Don't remove the above line. Serves as the version this script will fetch. Only update when a new version is out. ERROR='\033[1;31m[*] Error:\033[1;37m '