The C language, the C preprocessor, and the linker do not work that way.
Besides, altering what you stuff into a pair of double quotes doesn't move it into the code segment. It will be in the data segment, just like before, when he couldn't find it.
To stuff non-code content into the code segment, assembly language might be required.
You could try inline assembler inside your C code using a simple short jump to a NOP and filling the gap with define bytes with the hex values of the string you want to display:
Pseudo-code...
This will safely give 120 characters worth of define byte[s], 'db'.
Where ?? are the hex values of the characters.
It might work under gcc...
I have no idea if this would work under gcc, (it does work on C compilers on other older platforms).
------ Post updated at 09:46 PM ------
This might attach itself to the previous code:
Results OSX 10.13.6, default bash terminal compiled under gcc.
Note the hex number 90 after the "Barry Walker![newline][EOF]" is the NOP instruction...
Hope this helps...
EDIT:
The JMP instruction is at the end of the upper line and is this: e9 0f 00 00 00 followed by the characters.
'e9' is jmp op-code.
'0f' is the little endian number of bytes, (from a signed 32 bit number), 15 decimal, to jump to the end-of-file/null byte '00' to execute the nop op-code.
Hope this helps too.
Last edited by wisecracker; 10-28-2018 at 07:28 PM..
Reason: Pointed out the jmp instruction.
These 2 Users Gave Thanks to wisecracker For This Post:
hi,
trying to embed an image to the html file to send out as an email.
img src="data:image/jpeg;base64,$(base64 /home/test/abc.jpg
but getting error as file not found after it aplies base64 on the file. (8 Replies)
Hi I would like to embed a sql query in my shell script.
Also, before any the sql query is executed, i would like to validate username and password. (1 Reply)
Hello everyone,
I am trying to embed some tcl code inside a ksh93 script but I am not having any success.
I even tried the simplest of code, something like this:
.
.
jk=$(echo $(tcl << |
write_file junkme "test"'
|
))
just to see if a file gets written. When I run there are no errors, but ... (3 Replies)
Hello;
When I try:
awk '/$(date "+%y\/%m\/%d")/,0'
It errors with:
awk: There is a regular expression error.
Invalid pattern.
Is there anyway to make this work ??
Thank you (2 Replies)
Folks,
can anyone throw a code snippet here to insert a comma " , " after each word in a line when doing a file read and output the delimited text to a file.
Appreciate your help
Venu (9 Replies)
Hey everyone,
I am just trying to figure out how to embed a function in an if statement.
I have the following test script so far:
PRIMARY=192.168.1.2
SECONDARY=192.168.1.1
function checkAlive {
ping -c 1 -q $1
}
if
then
echo "equaled 0"
fi
This... (1 Reply)
I'm looking to have a embed code for people be as short as possible. I'm trying to figure out how to do this. So something like...
<EMBED SRC="http://www.website.com/myembedscript.php?id=1"
HEIGHT=60 WIDTH=144>
I'm looking to figure out what "myembedscript.php" should do. I have it... (0 Replies)
hello everyone,
i am not well-versed with unix programming, but could you help me on how to embed an image(maybe a bitmap) to the output file?
how about animations(avi, etc)? can this also be embeded to the output?
thanks (0 Replies)
I have written a code to extract comma seperated values from a file and assign them to a variable inside awk code.i want to use one of these variable to be used in wget function i.e to pass the siteurl.How i can implement the shell command wget inside the awk for loop.code snippet is shown below. ... (8 Replies)