문제

I was looking into the import section of a Mach-O file and realised that there are 2 different exit system calls (at different addresses) to libSystem.B.dylib? I want to hook onto the exit method which is called. Although I'm aware trial and error works. I want to understand why there are 2 exit calls which libSystem re-exports. Does anyone know why this mach-O file is using 2 different __exit calls from the same libSystem shared library? Thanks.

**0003e6dc: __exit (ord#0)**
0003e6f8: _abort (ord#0)
0003e6fc: _access (ord#0)
0003e700: _atexit (ord#0)
.
.
.
.
**0003e760: _exit (ord#0)**
도움이 되었습니까?

해결책

The first function is _exit and the second is exit. _exit will not call functions registered with atexit(), signal handlers, or flush open streams. It also has different process termination consequences as described in the link.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top