Security Agent blocking startup
I'm using a mid-2012 2.9GHz 13" MacBook Pro with a replaced battery, hard drive, and SATA cable.
Every time I try to boot up the laptop, the screen goes black when the progress bar reaches about halfway, and an Invalid Caller popup appears saying that only Apple software and run the Security Agent. I'm unable to click on it, so I have to shut down the laptop again.
If I try to boot in safe mode, the progress bar makes it about three quarters of the way across the screen, but then some diagnostics appear in the top left corner of the screen, and the boot process starts again.
Recovery mode will start up, and running first aid on the hard drive and the partition works fine, however it has failed while running on the hard drive occasionally.
I've booted in single user mode, and tried run fsck -fy, and the first time it said that files had been modified. All of the subsequent times, it's run without issue, but exiting single user mode by typing reboot, or sometimes even waiting long enough will cause an error where "pci pause: SDXC" appears on the command prompt and then it freezes.
I've tried a PRAM reset and it didn't work.
I don't think I'm running the latest version of OS X (I haven't updated the laptop in the past few weeks, but if there hasn't been an update since about Christmas, I'm fine) and without being able to boot into it, I won't be able to.
Thank you for the help!
MacBook Pro, OS X El Capitan (10.11.2)