mirror of https://github.com/0intro/libelf
export type, machine, version and entry header fields
This commit is contained in:
parent
d62e3c29b5
commit
25e679c0c2
|
@ -28,6 +28,10 @@ struct Fhdr {
|
||||||
...
|
...
|
||||||
|
|
||||||
/* ELF Header */
|
/* ELF Header */
|
||||||
|
uint16_t type;
|
||||||
|
uint16_t machine;
|
||||||
|
uint32_t version;
|
||||||
|
uint64_t entry;
|
||||||
uint64_t phoff;
|
uint64_t phoff;
|
||||||
uint64_t shoff;
|
uint64_t shoff;
|
||||||
uint16_t ehsize; /* ELF Header size */
|
uint16_t ehsize; /* ELF Header size */
|
||||||
|
|
10
elf.c
10
elf.c
|
@ -164,6 +164,11 @@ readelf32ehdr(FILE *f, Fhdr *fp)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fp->type = e.type;
|
||||||
|
fp->machine = e.machine;
|
||||||
|
fp->version = e.version;
|
||||||
|
fp->entry = e.entry;
|
||||||
|
|
||||||
fp->shoff = e.shoff;
|
fp->shoff = e.shoff;
|
||||||
fp->phoff = e.phoff;
|
fp->phoff = e.phoff;
|
||||||
fp->phnum = e.phnum;
|
fp->phnum = e.phnum;
|
||||||
|
@ -229,6 +234,11 @@ readelf64ehdr(FILE *f, Fhdr *fp)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fp->type = e.type;
|
||||||
|
fp->machine = e.machine;
|
||||||
|
fp->version = e.version;
|
||||||
|
fp->entry = e.entry;
|
||||||
|
|
||||||
fp->shoff = e.shoff;
|
fp->shoff = e.shoff;
|
||||||
fp->phoff = e.phoff;
|
fp->phoff = e.phoff;
|
||||||
fp->phnum = e.phnum;
|
fp->phnum = e.phnum;
|
||||||
|
|
4
elf.h
4
elf.h
|
@ -17,6 +17,10 @@ struct Fhdr {
|
||||||
int (*readelfstrndx)(FILE*, Fhdr*);
|
int (*readelfstrndx)(FILE*, Fhdr*);
|
||||||
|
|
||||||
/* ELF Header */
|
/* ELF Header */
|
||||||
|
uint16_t type;
|
||||||
|
uint16_t machine;
|
||||||
|
uint32_t version;
|
||||||
|
uint64_t entry;
|
||||||
uint64_t phoff;
|
uint64_t phoff;
|
||||||
uint64_t shoff;
|
uint64_t shoff;
|
||||||
uint16_t ehsize; /* ELF Header size */
|
uint16_t ehsize; /* ELF Header size */
|
||||||
|
|
Loading…
Reference in New Issue