Extracted the function FetchExistingHeader(void *ptr)