PE format reading in JavaScript (well, TypeScript actually, but they are interchangeable anyway)