Finding patterns in binary files using deep learning
Your network is essentially memorizing data but not extracting features. You need to apply CNN. 

That said the CNN architecture will need to be kind of unusual, each bit will need to be turned into representing a positional element.