Currently this function gets passed a fixed size (4k) buffer. That might not be big enough for all segment commands. This needs to be changed so that it gets passed 'actual_fd'. Then inside ML_(check_macho_and_get_rw_loads) it should - open the file - allocate a buffer on the heap of size struct MACH_HEADER - read the header - realloc the buf with size struct MACH_HEADER + header->sizeofcmds - process as previously - free the buffer - close the file
commit 6999f18906f0b16d407eda3a9975cb3845dedcfe (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Fri Mar 7 23:12:13 2025 +0100 Bug 501194 - Fix ML_(check_macho_and_get_rw_loads) so that it is correct for any number of segment commands