📄 orlentry.c
字号:
orl_sec_type ORLENTRY ORLSecGetType( orl_sec_handle orl_sec_hnd )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfSecGetType( (elf_sec_handle) orl_sec_hnd ) );
case( ORL_COFF ):
return( CoffSecGetType( (coff_sec_handle) orl_sec_hnd ) );
case( ORL_OMF ):
return( OmfSecGetType( (omf_sec_handle) orl_sec_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( 0 );
}
orl_sec_alignment ORLENTRY ORLSecGetAlignment( orl_sec_handle orl_sec_hnd )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfSecGetAlignment( (elf_sec_handle) orl_sec_hnd ) );
case( ORL_COFF ):
return( CoffSecGetAlignment( (coff_sec_handle) orl_sec_hnd ) );
case( ORL_OMF ):
return( OmfSecGetAlignment( (omf_sec_handle) orl_sec_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( 0 );
}
orl_sec_flags ORLENTRY ORLSecGetFlags( orl_sec_handle orl_sec_hnd )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfSecGetFlags( (elf_sec_handle) orl_sec_hnd ) );
case( ORL_COFF ):
return( CoffSecGetFlags( (coff_sec_handle) orl_sec_hnd ) );
case( ORL_OMF ):
return( OmfSecGetFlags( (omf_sec_handle) orl_sec_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( 0 );
}
orl_sec_handle ORLENTRY ORLSecGetStringTable( orl_sec_handle orl_sec_hnd )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( (orl_sec_handle) ElfSecGetStringTable( (elf_sec_handle) orl_sec_hnd ) );
case( ORL_COFF ):
return( (orl_sec_handle) CoffSecGetStringTable( (coff_sec_handle) orl_sec_hnd ) );
case( ORL_OMF ):
return( (orl_sec_handle) OmfSecGetStringTable( (omf_sec_handle) orl_sec_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( NULL );
}
orl_sec_handle ORLENTRY ORLSecGetSymbolTable( orl_sec_handle orl_sec_hnd )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( (orl_sec_handle) ElfSecGetSymbolTable( (elf_sec_handle) orl_sec_hnd ) );
case( ORL_COFF ):
return( (orl_sec_handle) CoffSecGetSymbolTable( (coff_sec_handle) orl_sec_hnd ) );
case( ORL_OMF ):
return( (orl_sec_handle) OmfSecGetSymbolTable( (omf_sec_handle) orl_sec_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( NULL );
}
orl_sec_handle ORLENTRY ORLSecGetRelocTable( orl_sec_handle orl_sec_hnd )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( (orl_sec_handle) ElfSecGetRelocTable( (elf_sec_handle) orl_sec_hnd ) );
case( ORL_COFF ):
return( (orl_sec_handle) CoffSecGetRelocTable( (coff_sec_handle) orl_sec_hnd ) );
case( ORL_OMF ):
return( (orl_sec_handle) OmfSecGetRelocTable( (omf_sec_handle) orl_sec_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( NULL );
}
orl_linnum * ORLENTRY ORLSecGetLines( orl_sec_handle orl_sec_hnd )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( NULL );
case( ORL_COFF ):
return( CoffSecGetLines( (coff_sec_handle) orl_sec_hnd ) );
case( ORL_OMF ):
return( OmfSecGetLines( (omf_sec_handle) orl_sec_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return NULL;
}
orl_table_index ORLENTRY ORLSecGetNumLines( orl_sec_handle orl_sec_hnd )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( 0 );
case( ORL_COFF ):
return( CoffSecGetNumLines( (coff_sec_handle) orl_sec_hnd ) );
case( ORL_OMF ):
return( OmfSecGetNumLines( (omf_sec_handle) orl_sec_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return 0;
}
orl_sec_offset ORLENTRY ORLSecGetOffset( orl_sec_handle orl_sec_hnd )
{
if( orl_sec_hnd->type == ORL_COFF ) {
return( CoffSecGetOffset( (coff_sec_handle) orl_sec_hnd ) );
}
return 0;
}
char * ORLENTRY ORLSecGetClassName( orl_sec_handle orl_sec_hnd )
{
if( orl_sec_hnd->type == ORL_OMF ) {
return( OmfSecGetClassName( (omf_sec_handle) orl_sec_hnd ) );
}
return 0;
}
orl_sec_combine ORLENTRY ORLSecGetCombine( orl_sec_handle orl_sec_hnd )
{
if( orl_sec_hnd->type == ORL_OMF ) {
return( OmfSecGetCombine( (omf_sec_handle) orl_sec_hnd ) );
}
return ORL_SEC_COMBINE_NONE;
}
orl_sec_frame ORLENTRY ORLSecGetAbsFrame( orl_sec_handle orl_sec_hnd )
{
if( orl_sec_hnd->type == ORL_OMF ) {
return( OmfSecGetAbsFrame( (omf_sec_handle) orl_sec_hnd ) );
}
return ORL_SEC_NO_ABS_FRAME;
}
orl_sec_handle ORLENTRY ORLSecGetAssociated( orl_sec_handle orl_sec_hnd )
{
if( orl_sec_hnd->type == ORL_OMF ) {
return( OmfSecGetAssociated( (omf_sec_handle) orl_sec_hnd ) );
}
return NULL;
}
orl_group_handle ORLENTRY ORLSecGetGroup( orl_sec_handle orl_sec_hnd )
{
if( orl_sec_hnd->type == ORL_OMF ) {
return( OmfSecGetGroup( (omf_sec_handle) orl_sec_hnd ) );
}
return NULL;
}
orl_return ORLENTRY ORLSecGetContents( orl_sec_handle orl_sec_hnd, char **buffer )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfSecGetContents( (elf_sec_handle) orl_sec_hnd, buffer ) );
case( ORL_COFF ):
return( CoffSecGetContents( (coff_sec_handle) orl_sec_hnd, buffer ) );
case( ORL_OMF ):
return( OmfSecGetContents( (omf_sec_handle) orl_sec_hnd, buffer ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( ORL_ERROR );
}
orl_return ORLENTRY ORLSecQueryReloc( orl_sec_handle orl_sec_hnd, orl_sec_offset sec_offset, orl_reloc_return_func return_func )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfSecQueryReloc( (elf_sec_handle) orl_sec_hnd, sec_offset, return_func ) );
case( ORL_COFF ):
return( CoffSecQueryReloc( (coff_sec_handle) orl_sec_hnd, sec_offset, return_func ) );
case( ORL_OMF ):
return( OmfSecQueryReloc( (omf_sec_handle) orl_sec_hnd, sec_offset, return_func ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( ORL_ERROR );
}
orl_return ORLENTRY ORLSecScanReloc( orl_sec_handle orl_sec_hnd, orl_reloc_return_func return_func )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfSecScanReloc( (elf_sec_handle) orl_sec_hnd, return_func ) );
case( ORL_COFF ):
return( CoffSecScanReloc( (coff_sec_handle) orl_sec_hnd, return_func ) );
case( ORL_OMF ):
return( OmfSecScanReloc( (omf_sec_handle) orl_sec_hnd, return_func ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( ORL_ERROR );
}
orl_table_index ORLENTRY ORLCvtSecHdlToIdx( orl_sec_handle shdl )
/***************************************************************/
{
switch( shdl->type ) {
case( ORL_ELF ):
return ElfCvtSecHdlToIdx( (elf_sec_handle) shdl );
case( ORL_COFF ):
return CoffCvtSecHdlToIdx( (coff_sec_handle) shdl );
case( ORL_OMF ):
return OmfCvtSecHdlToIdx( (omf_sec_handle) shdl );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( 0 );
}
orl_sec_handle ORLENTRY ORLCvtIdxToSecHdl( orl_file_handle fhdl,
orl_table_index idx )
/**************************************************************/
{
switch( fhdl->type ) {
case( ORL_ELF ):
return (orl_sec_handle) ElfCvtIdxToSecHdl( fhdl->file_hnd.elf, idx );
case( ORL_COFF ):
return (orl_sec_handle) CoffCvtIdxToSecHdl( fhdl->file_hnd.coff, idx );
case( ORL_OMF ):
return (orl_sec_handle) OmfCvtIdxToSecHdl( fhdl->file_hnd.omf, idx );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( NULL );
}
orl_return ORLENTRY ORLRelocSecScan( orl_sec_handle orl_sec_hnd, orl_reloc_return_func return_func )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfRelocSecScan( (elf_sec_handle) orl_sec_hnd, return_func ) );
case( ORL_COFF ):
return( CoffRelocSecScan( (coff_sec_handle) orl_sec_hnd, return_func ) );
case( ORL_OMF ):
return( OmfRelocSecScan( (omf_sec_handle) orl_sec_hnd, return_func ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( ORL_ERROR );
}
orl_return ORLENTRY ORLSymbolSecScan( orl_sec_handle orl_sec_hnd, orl_symbol_return_func return_func )
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfSymbolSecScan( (elf_sec_handle) orl_sec_hnd, return_func ) );
case( ORL_COFF ):
return( CoffSymbolSecScan( (coff_sec_handle) orl_sec_hnd, return_func ) );
case( ORL_OMF ):
return( OmfSymbolSecScan( (omf_sec_handle) orl_sec_hnd, return_func ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( ORL_ERROR );
}
orl_return ORLENTRY ORLNoteSecScan( orl_sec_handle orl_sec_hnd,
orl_note_callbacks * fn, void *cookie )
/*************************************************************************/
{
switch( orl_sec_hnd->type ) {
case( ORL_ELF ):
return( ElfNoteSecScan( (elf_sec_handle) orl_sec_hnd, fn, cookie ) );
case( ORL_COFF ):
return( CoffNoteSecScan( (coff_sec_handle) orl_sec_hnd, fn, cookie ) );
case( ORL_OMF ):
return( OmfNoteSecScan( (omf_sec_handle) orl_sec_hnd, fn, cookie ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( ORL_ERROR );
}
char * ORLENTRY ORLSymbolGetName( orl_symbol_handle orl_symbol_hnd )
{
switch( orl_symbol_hnd->type ) {
case( ORL_ELF ):
return( ElfSymbolGetName( (elf_symbol_handle) orl_symbol_hnd ) );
case( ORL_COFF ):
return( CoffSymbolGetName( (coff_symbol_handle) orl_symbol_hnd ) );
case( ORL_OMF ):
return( OmfSymbolGetName( (omf_symbol_handle) orl_symbol_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( NULL );
}
orl_symbol_value ORLENTRY ORLSymbolGetValue( orl_symbol_handle orl_symbol_hnd )
{
switch( orl_symbol_hnd->type ) {
case( ORL_ELF ):
return( ElfSymbolGetValue( (elf_symbol_handle) orl_symbol_hnd ) );
case( ORL_COFF ):
return( CoffSymbolGetValue( (coff_symbol_handle) orl_symbol_hnd ) );
case( ORL_OMF ):
return( OmfSymbolGetValue( (omf_symbol_handle) orl_symbol_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( 0 );
}
orl_symbol_binding ORLENTRY ORLSymbolGetBinding( orl_symbol_handle orl_symbol_hnd )
{
switch( orl_symbol_hnd->type ) {
case( ORL_ELF ):
return( ElfSymbolGetBinding( (elf_symbol_handle) orl_symbol_hnd ) );
case( ORL_COFF ):
return( CoffSymbolGetBinding( (coff_symbol_handle) orl_symbol_hnd ) );
case( ORL_OMF ):
return( OmfSymbolGetBinding( (omf_symbol_handle) orl_symbol_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( 0 );
}
orl_symbol_type ORLENTRY ORLSymbolGetType( orl_symbol_handle orl_symbol_hnd )
{
switch( orl_symbol_hnd->type ) {
case( ORL_ELF ):
return( ElfSymbolGetType( (elf_symbol_handle) orl_symbol_hnd ) );
case( ORL_COFF ):
return( CoffSymbolGetType( (coff_symbol_handle) orl_symbol_hnd ) );
case( ORL_OMF ):
return( OmfSymbolGetType( (omf_symbol_handle) orl_symbol_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( 0 );
}
unsigned char ORLENTRY ORLSymbolGetRawInfo( orl_symbol_handle orl_symbol_hnd )
{
switch( orl_symbol_hnd->type ) {
case( ORL_ELF ):
return( ElfSymbolGetRawInfo( (elf_symbol_handle) orl_symbol_hnd ) );
case( ORL_COFF ):
return 0; // no COFF equivilent
case( ORL_OMF ):
return( OmfSymbolGetRawInfo( (omf_symbol_handle) orl_symbol_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( 0 );
}
orl_sec_handle ORLENTRY ORLSymbolGetSecHandle( orl_symbol_handle orl_symbol_hnd )
{
switch( orl_symbol_hnd->type ) {
case( ORL_ELF ):
return( (orl_sec_handle) ElfSymbolGetSecHandle( (elf_symbol_handle) orl_symbol_hnd ) );
case( ORL_COFF ):
return( (orl_sec_handle) CoffSymbolGetSecHandle( (coff_symbol_handle) orl_symbol_hnd ) );
case( ORL_OMF ):
return( (orl_sec_handle) OmfSymbolGetSecHandle( (omf_symbol_handle) orl_symbol_hnd ) );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( NULL );
}
orl_symbol_handle ORLENTRY ORLSymbolGetAssociated( orl_symbol_handle hnd )
{
switch( hnd->type ) {
case( ORL_ELF ):
return (orl_symbol_handle) ElfSymbolGetAssociated( (elf_symbol_handle) hnd );
case( ORL_COFF ):
return (orl_symbol_handle) CoffSymbolGetAssociated( (coff_symbol_handle) hnd );
case( ORL_OMF ):
return NULL; // NYI: call to an OMF func. here.
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( NULL );
}
orl_return ORLENTRY ORLGroupsScan( orl_file_handle hnd,
orl_group_return_func func )
{
switch( hnd->type ) {
case( ORL_ELF ):
case( ORL_COFF ):
return ORL_OKAY;
case( ORL_OMF ):
return OmfGroupsScan( hnd->file_hnd.omf, func );
default: break;//ORL_UNRECOGNIZED_FORMAT
}
return( ORL_ERROR );
}
char * ORLENTRY ORLGroupName( orl_group_handle hnd )
{
if( hnd->type == ORL_OMF ) {
return OmfGroupName( (omf_grp_handle)hnd );
}
return( NULL );
}
orl_table_index ORLENTRY ORLGroupSize( orl_group_handle hnd )
{
if( hnd->type == ORL_OMF ) {
return OmfGroupSize( (omf_grp_handle)hnd );
}
return( 0 );
}
char * ORLENTRY ORLGroupMember( orl_group_handle hnd, orl_table_index idx )
{
if( hnd->type == ORL_OMF ) {
return OmfGroupMember( (omf_grp_handle)hnd, idx );
}
return( NULL );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -