Looking at PHYSFS_write(file, pbase(), 1, size); in OFileStreambuf::overflow isn't the third parameter the size?
Yes, but that is fine. In this case the objects of interest are bytes, and we want to read 'size' of them.
Ultimately it shouldn't really matter, the operation should write size * count bytes, so even if they are the 'wrong way around', it should still work.
This is a rather odd one, the 'ProcessAttach' would suggest it is a DLL problem, but if this is happening in game, then they all would have been loaded long before . . .