I'm using otool to get information about my binary. Here is part of my output:
Load command 0
cmd LC_SEGMENT_64
cmdsize 72
segname __PAGEZERO
vmaddr 0x0000000000000000
vmsize 0x0000000100000000
fileoff 0
filesize 0
maxprot 0x00000000
initprot 0x00000000
nsects 0
flags 0x0
Load command 1
cmd LC_SEGMENT_64
cmdsize 952
segname __TEXT
vmaddr 0x0000000100000000
vmsize 0x0000000000268000
fileoff 0
filesize 2523136
maxprot 0x00000005
initprot 0x00000005
nsects 11
flags 0x0
We can see here that command 1
with segname __TEXT
starts at vmaddr 0x0000000100000000
The problem is that binary size is 2.3MB and 0x0000000100000000 is 4 GB!
I assume that "one" in the middle of address is related to the 64 bit architecture, and 0x0000000100000000
in fact address 0x00
. I was looking for some information about that but I didn't find anything useful. Can anyone confirms my assumptions and explain how exactly this is working?