Squashed commit from develop branch
not exactly true, order of memory writes is relevant
because pefile fails on CoST.exe