Rewriting PEX file