I am building a PE-COFF file reader, just for education purposes, and I keep getting a ConvException come up, stating:

---

  Unexpected '

---

Now, I have no idea how I'm getting this. The code at that point looks like the following:

---

  // look for the identifier
  // this gives us the offset to the magic number
  uint offs;
  file.seek(0x3c, SEEK_SET);

  file.readf("%d", &offs); // this is the problem line

  writefln("magic number offset: %d", offs);
  file.seek(offs, SEEK_SET);

---

With the exception being raised on the writefln. I have the same trouble with

  writeln("magic number offset: ", offs);

and I'm not sure how to go about fixing it. About the only clue I can come up with, is that if I were to look at the section of code in the hex editor, the number at that point generates a "'", the offending character, when represented as a character array.

Does anyone else see whatever it is that I'm doing wrong?

Reply via email to