How to get a list of addresses from all zcash transactions?

I have a downloaded blockchain in zec wallet, how can I get all addresses from all transactions from it? How to read ~/.zcash/blocks/blk***.dat and ~/.zcash/blocks/rev***.dat files?

Easiest way is to use the rpc client (zcash-cli), see ‘zcash-cli help getblock’ for more info.