FireBirdLib - Topfield TMS PVR TAP Programming Library
ELFReadDWORD.c
Go to the documentation of this file.
1
#include "
ELF.h
"
2
#include "
FBLib_elf.h
"
3
4
bool
ELFReadDWORD
(dword SectionIndex, dword *Data)
5
{
6
TRACEENTER
();
7
8
Elf32_Shdr
*pSection = NULL;
//Shortcut to speed up access
9
10
pSection = &
SectionHeaders
[SectionIndex];
11
12
if
(pSection->
sh_size
!=
sizeof
(dword))
13
{
14
TRACEEXIT
();
15
return
FALSE;
16
}
17
18
if
(Data)
19
{
20
lseek(
fTAP
, pSection->
sh_offset
,
SEEK_SET
);
21
if
(read(
fTAP
, Data, pSection->
sh_size
) != (
int
)pSection->
sh_size
)
22
{
23
TRACEEXIT
();
24
25
return
FALSE;
26
}
27
}
28
29
TRACEEXIT
();
30
return
TRUE;
31
}
SectionHeaders
Elf32_Shdr * SectionHeaders
Definition:
ELFOpenFile.c:7
fTAP
int fTAP
Definition:
ELFOpenFile.c:5
ELFReadDWORD
bool ELFReadDWORD(dword SectionIndex, dword *Data)
Definition:
ELFReadDWORD.c:4
ELF.h
FBLib_elf.h
SEEK_SET
#define SEEK_SET
Definition:
libFireBird.h:1875
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
Elf32_Shdr
Definition:
ELF.h:49
Elf32_Shdr::sh_offset
Elf32_Off sh_offset
Definition:
ELF.h:54
Elf32_Shdr::sh_size
Elf32_Word sh_size
Definition:
ELF.h:55
elf
ELFReadDWORD.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3