What passphrase are you talking about? Does your friend know exactly how he generated his addresses? The way that you're generating addresses would be similar to how brainwallet used to generate legacy addresses, which can work only if your friend generated his Bitcoin wallet in this way. Depending on how weak the passphrase is, they should be empty by now.
Anyhow, if your friend is sure that he generated his addresses this way, you can easily just query any blockexplorer with the addresses generated. Else, you should probably try to find out how exactly was he generating his addresses.
P2SH-P2WPKH is probably the most common method that people would utilize a passphrase for when used in conjunction with P2SH. However, it didn't exist in 2014.
Passphrase or password. In 2014, mining bitcoin was possible on a computer (he did on a mac) and it was all command line. That's what my friend was doing.
So we are trying to generate valid bitcoin addresses (not on the blockchain, nor wallets), to check if those addresses contain bitcoins.
I am trying to help him by having the script generate valid addresses but since 2014 the hashing to create the private/public keys have been changed so
I am trying to figure out if the script above is valid to create bitcoin addresses created at that time.
Does it make sense?
thx for the comments!