What happens if I change the architecture version, the value of the architecture version?
So currently, uh, if I see this, it is pointing to the AMD x86 64.
And if I do an hexdump on this and I say give me two.
So first 16 bytes are the identification header.
If you see here the first 16 bytes are the identification header.
Then comes two by uh here elf 64 half is.
Uh, 16 two byte.
So first 16 bytes are identification header, then the two bytes are for type which is 030003 uh zero
zero.
Then comes 300 and three is I think uh for.
X86 64.
So 62 is three, 63 is uh three and then four zero.
So x86 64 is having three, which is 62 and is present at this particular location.
Now I will open the hex editor and I will change this to a different value.
So I'll go three is present here.
I'll say zero three.
Save this one.
Now I'll again verify this is changed.
This is changed.
And now I'll use readelf f and h user space.
And it is now saying it is Intel 80386 and the class is 64.
So if you are changing something in this Elf file, uh header the Elf also output changes because elf
is very dumb.
It will just read the header size until pass it according to the values which are present in the header
file.
It does not see whether it is really a 64 bit or 32 bit binary.
If I run this thing, it is failing because it is saying cannot execute this binary exec format error
because we have, uh, we have, uh, touched the Elf file, we have made the modifications and all
that.
Hence it is failing.
Now I'll just go back and I'll change the file and see if I changed, uh, this to one.
And see whether it will work.
And now I have the version updated.
Still it is failing.
And now we'll change back to the real actual version, which is three.
So let's open edit again and change 033.
Save this one.
And now it is a x86 64.
Now it is aborted because the code is actually doing abort.
So the reason it was not working is it is a format error.
We have instructions for 64 bit, but we are specifying it as a 32 bit.
And that is the reason it was saying exact format error.