Andy fights for his own justice by exposing Warden Samuel Norton and Capt. Byron Hadley as the real criminals in Shawshank Prison. Through books, Andy reveals that they embezzle and launder money from the state and murdere and torture prisoners to cover it up.
Andy fights for his own justice by using the Warden's "books" against him. At first Andy tries to educate the prisoners by building the library, but then the Warden shuts it down and kills Tommy Williams, who threatens to free Andy through his testimony. Knowing he cannot win against the Warden legally, Andy resorts to crime: he steals the Warden's books.
Books are very important in the novella/movie. The Warden pretends to practice what the Bible preaches, but he is really corrupted by greed. As his secret middle-man, Andy replaces the ledger from the safe with the Bible in which he kept the rock hammer, thus enabling him to both escape and expose the Warden and Hadley.
Andy learns that another prisoner has admitted to the crime that he waas charged with. He goes to the warden and tells him so that thewarden will interview the prisoner and get him help. However, the warden needs Andy because he has enabled him to gain income through using Andy's skills. He has the man killed who could help and testify on Andy's behalf.
After Andy realizes the warden has tricked him Andy begins using his economic smarts to divert funds to a location that he will be able to access. He also begins to dig his way out of the prison a little at a time. Andy sets the warden up by using his ledger's against him so that it will all be exposed after he is gone.