Extracting the code from a printer cartridge chip-P2

Would it be legal to copy and re-use the code from one of these printer cartridges ?