Author Topic: 64bit - Wrong PE image  (Read 2814 times)

0 Members and 1 Guest are viewing this topic.

efgee

  • Guest
64bit - Wrong PE image
« on: October 19, 2011, 11:01:54 AM »
Charles,
it looks like when compiling the "test64bit.bas" file some things goes wrong:

1.) The magic number in the optional header is "0x0202" instead of "0x020B".
2.) The address of the entry point is invalid
3.) The ImageBase needs to be "Qword"  instead of "Dword"
4.) ...

Hope you can fix it.

BTW: If you need a good tool to look into the exe file the CFF explorer is great:
http://www.oxygenbasic.org/forum/index.php?topic=26.0

EDIT: typos... who invented these? they are everywhere...
« Last Edit: October 19, 2011, 12:18:57 PM by efgee »

Charles Pegge

  • Guest
Re: 64bit - Wrong PE image
« Reply #1 on: October 19, 2011, 11:54:19 PM »

Hi Frank,

Thanks for the link to CFF explorer.

I am up to my elbows in code at the moment with a new string management system that works with multiple threads.

64-bit needs to be brought back into sync and there is a lot of other tasks in hand before I can produce a 64 bit run-time library. But I'll see if there is a quick fix to the immediate problem.

Charles

efgee

  • Guest
Re: 64bit - Wrong PE image
« Reply #2 on: October 20, 2011, 07:50:35 AM »
Thanks.

Here:

http://www.godevtool.com/GoasmHelp/64bits.htm

I found more information about the new relative addressing (in certain cases) that is done on x64.

Also his site:

http://www.godevtool.com

is a good source of information about x64 programming:

http://www.godevtool.com/#64

and here (this one I like):

http://www.godevtool.com/GoasmHelp/Hello64World3

Maybe Oxygen can use the same technique.

bye
« Last Edit: October 20, 2011, 09:08:11 AM by efgee »

efgee

  • Guest
Re: 64bit - Wrong PE image
« Reply #3 on: October 28, 2011, 10:16:36 AM »
Charles,
just tested the current in progress version and the compiled PE64 file looks OK.

nice  8)

Charles Pegge

  • Guest
Re: 64bit - Wrong PE image
« Reply #4 on: October 28, 2011, 11:04:45 AM »

Thanks Frank,

I am 3000 lines into the 64bit library. Good to get a work-flow running smoothly.

RIP (Relative Instruction Pointer) mode addressing is very good. I use it for resolving the absolute address of labels. Oxygen code will run from any address without fixups, so any absolute addresses have to be  resolved at run time.

.bssdata
....

lea rip rbx,bssdata


Charles