Skip to content

Commit

Permalink
Use first dyld image that starts with the ios applications folder pat…
Browse files Browse the repository at this point in the history
…h to support the palera1n jailbreak.
  • Loading branch information
joeyjurjens committed Mar 19, 2023
1 parent 6948be0 commit 6a26b91
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
28 changes: 23 additions & 5 deletions template/KittyMemory/KittyMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion template/NIC/control
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion template/versionCheck.sh
Original file line number Diff line number Diff line change
@@ -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 '
Expand Down

0 comments on commit 6a26b91

Please sign in to comment.