Cross Reference: elfextract.h
xref
: /
pkg
/
src
/
modules
/
elfextract.h
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
154
N/A
/*
154
N/A
* CDDL HEADER START
154
N/A
*
154
N/A
* The contents of this file are subject to the terms of the
154
N/A
* Common Development and Distribution License (the "License").
154
N/A
* You may not use this file except in compliance with the License.
154
N/A
*
154
N/A
* You can obtain a copy of the license at
usr
/
src
/
OPENSOLARIS.LICENSE
154
N/A
* or
http://www.opensolaris.org/os/licensing
.
154
N/A
* See the License for the specific language governing permissions
154
N/A
* and limitations under the License.
154
N/A
*
154
N/A
* When distributing Covered Code, include this CDDL HEADER in each
154
N/A
* file and include the License file at
usr
/
src
/
OPENSOLARIS.LICENSE
.
154
N/A
* If applicable, add the following below this CDDL HEADER, with the
154
N/A
* fields enclosed by brackets "[]" replaced with your own identifying
154
N/A
* information: Portions Copyright [yyyy] [name of copyright owner]
154
N/A
*
154
N/A
* CDDL HEADER END
154
N/A
*/
533
N/A
154
N/A
/*
3402
N/A
* Copyright (c) 2008, 2016, Oracle
and
/
or
its affiliates. All rights reserved.
154
N/A
*/
154
N/A
155
N/A
#
ifndef
_ELFEXTRACT_H
155
N/A
#
define
_ELFEXTRACT_H
61
N/A
61
N/A
#
include
<
sys
/
types.h
>
155
N/A
#
include
<
liblist.h
>
533
N/A
#
include
<
Python.h
>
155
N/A
155
N/A
#
ifdef
__cplusplus
155
N/A
extern
"C"
{
155
N/A
#
endif
61
N/A
61
N/A
#
ifndef
MIN
155
N/A
#
define
MIN
(a, b) ((a) < (b) ? (a) : (b))
61
N/A
#
endif
61
N/A
61
N/A
typedef
struct
dyninfo
{
155
N/A
off_t
runpath
;
/* offset in table of the runpath */
155
N/A
off_t
def
;
/* offset in table of the vdefname */
155
N/A
off_t
dynstr
;
/* string table */
155
N/A
liblist_t
*
deps
;
/* dependency list (also contains */
155
N/A
/* offsets) */
155
N/A
liblist_t
*
vers
;
/* version provided list (also */
155
N/A
/* contains offsets) */
3236
N/A
Elf
*
elf
;
/* elf data -- must be freed */
3236
N/A
}
dyninfo_t
;
3236
N/A
3236
N/A
typedef
struct
hashinfo
{
3402
N/A
/* Legacy SHA1 hash of subset of sections */
3402
N/A
char
elfhash
[
41
];
3402
N/A
3402
N/A
/*
3402
N/A
* SHA-256 hash of data extracted via
3402
N/A
* gelf_sign_range(ELF_SR_SIGNED_INTERPRET)
3402
N/A
*/
3402
N/A
char
hash_sha256
[
77
];
3402
N/A
3402
N/A
/*
3402
N/A
* SHA-256 hash of data extracted via
3402
N/A
* gelf_sign_range(ELF_SR_INTERPRET)
3402
N/A
*/
3402
N/A
char
uhash_sha256
[
86
];
3402
N/A
3402
N/A
/*
3402
N/A
* SHA-512/256 hash of data extracted via
3402
N/A
* gelf_sign_range(ELF_SR_SIGNED_INTERPRET)
3402
N/A
*/
3402
N/A
char
hash_sha512t_256
[
82
];
3402
N/A
3402
N/A
/*
3402
N/A
* SHA-512/256 hash of data extracted via
3402
N/A
* gelf_sign_range(ELF_SR_INTERPRET)
3402
N/A
*/
3402
N/A
char
uhash_sha512t_256
[
91
];
3236
N/A
}
hashinfo_t
;
61
N/A
62
N/A
typedef
struct
hdrinfo
{
62
N/A
int
type
;
/* e_type */
62
N/A
int
bits
;
/* 32/64 */
62
N/A
int
arch
;
/* e_machine */
62
N/A
int
data
;
/* e_ident[EI_DATA] */
62
N/A
int
osabi
;
/* e_ident[EI_OSABI] */
62
N/A
}
hdrinfo_t
;
62
N/A
154
N/A
extern
int
iself
(
int
fd
);
154
N/A
extern
int
iself32
(
int
fd
);
3236
N/A
extern
dyninfo_t
*
getdynamic
(
int
fd
);
3402
N/A
extern
hashinfo_t
*
gethashes
(
int
fd
,
int
elfhash
,
int
sha2_256
,
int
sha2_512
);
154
N/A
extern
void
dyninfo_free
(
dyninfo_t
*
dyn
);
154
N/A
extern
hdrinfo_t
*
getheaderinfo
(
int
fd
);
62
N/A
154
N/A
extern
char
*
pkg_string_from_type
(
int
type
);
154
N/A
extern
char
*
pkg_string_from_arch
(
int
arch
);
154
N/A
extern
char
*
pkg_string_from_data
(
int
data
);
154
N/A
extern
char
*
pkg_string_from_osabi
(
int
osabi
);
61
N/A
533
N/A
PyObject
*
ElfError
;
533
N/A
155
N/A
#
ifdef
__cplusplus
155
N/A
}
61
N/A
#
endif
155
N/A
155
N/A
#
endif
/* _ELFEXTRACT_H */