Sponsored Content
Top Forums Programming Editing or Adding to ELF string tables Post 302255255 by jim mcnamara on Thursday 6th of November 2008 05:57:30 AM
Old 11-06-2008
add:
Code:
static char *revision_string="@(#) Revision: myfile.cpp 1.1.0 2008/10/03";

To your source code then use the what command to identify revisions
(see also: ident man page for a similar idea using "$... text here $")
Code:
what compile_file

will produce the string above.
 

8 More Discussions You Might Find Interesting

1. Linux

editing ELF file

Hello, This is not exactly relevant to Linux kernel but I'm gonna ask any way. Is there any way I can modify a 64-bit ELF object file to make it look like 32-bit ELF object file and link it (using `ld`) with 32-bit ELF file? I tried libelf but was unsuccessful. I had this pretty link... (1 Reply)
Discussion started by: tejuwala
1 Replies

2. Shell Programming and Scripting

string editing in files

Hi all, I'm fairly new to scripting in linux and need some help. I have an file that looks something like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Some comments # Some comments # Some comments # Some comments # Some comments # Some comments abc:/path/to/somewhere:X... (3 Replies)
Discussion started by: Avatar Gixxer
3 Replies

3. Shell Programming and Scripting

SH Script help. editing string

I have a string that looks like this username|field1|field2|field3 the data has a delimiter of "|" how can i edit field1, keeping the rest of the data the same also how can i edit field2 and 3. (3 Replies)
Discussion started by: nookie
3 Replies

4. Programming

ELF-string table

hello everybody! I want to read the string table of an object file(which is in ELF format). I get the sh_name value but i cant find a way to read the value in the string table that this index represent. I program in C. thanx a lot folks! (3 Replies)
Discussion started by: nicos
3 Replies

5. UNIX for Dummies Questions & Answers

Help with editing string elements

Hi All I have a question. I would like to edit some string characters by replacing with characters of choice located in another file. For example in sample file>S5_SK1.chr01 NNNNNNNNNNNNNNNNNNNCAGCATGCAATAAGGTGACATAGATATACCCACACACCACACCCTAACACTAACCCTAATCTAACCCTGGCCAACCTGTTT... (9 Replies)
Discussion started by: pawannoel
9 Replies

6. Shell Programming and Scripting

Editing part of the string

Hi guys got a problem here hope u all can help me. I learn that sed can actually edit a string but you need to know the old attribute to change to new 1. Example: sed "s/$title:$author/$title:$Nauthor/g" "Harry Potter - The Half Blood Prince:J.K Rowling:40.30:10:50" Each delimiter : represent... (4 Replies)
Discussion started by: GQiang
4 Replies

7. Shell Programming and Scripting

Need help regarding String editing

Hi Geeks I am working on trimming the logs and extracting the XMLs from it. I am facing one problem here. My XML String is ending with ...........Request></Body></Envelope>S/R sometimes there is more then just S/R in the end. I want to delete anything comes after </Envelope>... (3 Replies)
Discussion started by: santy00110011
3 Replies

8. Shell Programming and Scripting

Editing in vi - adding words to a line

i have lines in a file similar to this: results=$(echo Total: ${res} | command | command) now I need to add text before the word "results", but i dont know how to do it. here's what i tried: %s~results=.*echo Total:.* ${7}~PROCESS \; results=.*echo Total:.* ${7}~g the problem is,... (1 Reply)
Discussion started by: SkySmart
1 Replies
ELF_STRPTR(3)						   BSD Library Functions Manual 					     ELF_STRPTR(3)

NAME
elf_strptr -- retrieve a string pointer in a string table LIBRARY
ELF Access Library (libelf, -lelf) SYNOPSIS
#include <libelf.h> char * elf_strptr(Elf *elf, size_t scndx, size_t stroffset); DESCRIPTION
Function elf_strptr() allows an application to convert a string table offset to a string pointer, correctly translating the offset in the presence of multiple Elf_Data descriptors covering the contents of the section. Argument elf is a descriptor for an ELF object. Argument scndx is the section index for an ELF string table. Argument stroffset is the index of the desired string in the string table. RETURN VALUES
Function elf_strptr() returns a valid pointer on success or NULL in case an error was encountered. ERRORS
[ELF_E_ARGUMENT] Argument elf was NULL [ELF_E_ARGUMENT] Argument elf was not a descriptor for an ELF object. [ELF_E_ARGUMENT] Argument scndx was not the section index for a string table. [ELF_E_ARGUMENT] Argument stroffset exceeeded the size of the string table. [ELF_E_ARGUMENT] Argument stroffset index an unallocated region of the string table. [ELF_E_DATA] Offset stroffset indexed a region that was not covered by any Elf_Data descriptor. [ELF_E_DATA] An erroneous Elf_Data descriptor was part of the section specified by argument scndx. [ELF_E_HEADER] ELF descriptor elf contained an invalid section header. [ELF_E_RESOURCE] An out of memory condition was detected. [ELF_E_SECTION] Section scndx contained a malformed section header. [ELF_E_SECTION] The ELF descriptor in argument elf did not adhere to the conventions used for extended numbering. SEE ALSO
elf(3), elf32_getshdr(3), elf64_getshdr(3), elf_getdata(3), elf_rawdata(3), gelf(3), gelf_getshdr(3) BSD
December 16, 2006 BSD
All times are GMT -4. The time now is 10:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy