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