agnosticbin: Add casting to fix problems in 32bits architectures

Change-Id: Iff3b8bede3d427446c2b8fefc25a62f98dec7bca