File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed
src/shared/pal/src/thread Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -2372,26 +2372,9 @@ CreateProcessModules(
23722372 }
23732373
23742374 // Does the offset in the module correspond to a valid MachO header?
2375- bool isMachO = false ;
2376- int fd = open (moduleName, O_RDONLY);
2377- if (fd != -1 )
2378- {
2379- if (lseek (fd, rwpi.prp_prinfo .pri_offset , SEEK_SET) != (off_t )-1 )
2380- {
2381- uint32_t magic = 0 ;
2382- ssize_t bytesRead = read (fd, &magic, sizeof (magic));
2383- if (bytesRead == sizeof (magic))
2384- {
2385- if (magic == 0xFEEDFACF )
2386- {
2387- isMachO = true ;
2388- }
2389- }
2390- }
2391- close (fd);
2392- }
2375+ bool mightBeMachOHeader = rwpi.prp_prinfo .pri_offset == 0 ;
23932376
2394- if (!dup && isMachO )
2377+ if (!dup && mightBeMachOHeader )
23952378 {
23962379 int cbModuleName = strlen (moduleName) + 1 ;
23972380 ProcessModules *entry = (ProcessModules *)malloc (sizeof (ProcessModules) + cbModuleName);
You can’t perform that action at this time.
0 commit comments