I'm trying to keep track of some file information via Endpoint Security APIs. When I exec a file which is quarantined, the file is translocated to a different directory and the translocated path is what Endpoint Security shows (which makes sense because that's the path that's being executed).
If that file is blocked due to XProtect, I get a message from XProtect via Endpoint Security saying that malware was detected and a path to the offending bundle. Unfortunately, the path is to the original bundle--not the translocated one--making it difficult to reconcile with the data collected above.
I discovered a handy function, SecTranslocateCreateOriginalPathForURL, in Security frameworks which, given the translocated URL, will return the original URL. Works great. But there's no header for it.
Is this safe to use, or do I have to do some other odd things to get the two to reconcile?