executable

LINUX: Is it possible to write a working program that does not rely on the libc library?

纵饮孤独 提交于 2019-12-03 13:35:58
I wonder if I could write a program in the C -programming language that is executable, albeit not using a single library call, e.g. not even exit()? If so, it obviously wouldn't depend on libraries (libc, ld-linux) at all. I suspect you could write such a thing, but it would need to have an endless loop at the end, because you can't ask the operation system to exit your process. And you couldn't do anything useful. Well start with compiling an ELF program, look into the ELF spec and craft together the header, the program segments and the other parts you need for a program. The kernel would

how to make a python file run without py extension

◇◆丶佛笑我妖孽 提交于 2019-12-03 13:07:59
I had a small python script that takes input from the command line arguments and done some operations using the inputs taken and display the result Below is the working example code some_file.py import sys arguments = sys.argv first_name = sys.argv[1] second_name = sys.argv[2] print "Hello {0} {1} !!!!".format(first_name,second_name) Now i am executing this as python some_file.py Steve jobs Result : Hello Steve Jobs !!!! Now what all i want is, i don't want to use python command before file name and extension of python file name, that is i want to run the file as a command tool as below some

Effects of removing all symbol table and relocation information from an executable?

血红的双手。 提交于 2019-12-03 12:28:20
Compilation using gcc -s and Unix strip remove all symbol table and relocation information from an executable (making it smaller in size). Could this ever affect the functioning of the executable? Do some operating systems which perform ASLR need this information? If not, why keep them around in the first place? A slightly- detailed overview of the above would be helpful. It seems pretty clear that removing relocation information would interfere with ASLR. However, I've taken a look at man strip on a couple of my systems, and none of them suggest that strip does (or indeed can?) remove

Meaning of a Common String In Executables?

我只是一个虾纸丫 提交于 2019-12-03 11:04:54
There appear to be some similar-looking long alphanumeric strings that commonly occur in Mach-O 64 bit executables and ELF 64-bit LSB executables among other symbols that are not alphanumeric: cat /bin/bash | grep -c "AWAVAUATSH" has 181 results, and cat /usr/bin/gzip | grep -c "AWAVAUATSH" has 9 results. What are these strings? Interesting question. Since I didn't know the answer, here are the steps I took to figure it out: Where in the file does the string occur? strings -otx /bin/gzip | grep AWAVAUATUSH 35e0 AWAVAUATUSH 69a0 AWAVAUATUSH 7920 AWAVAUATUSH 8900 AWAVAUATUSH 92a0 AWAVAUATUSH

How are PE Base Relocations build up?

丶灬走出姿态 提交于 2019-12-03 10:39:01
问题 I'm currently having trouble understanding how PE Base Relocations are build up. I understand there can be more then one relocation, I understand also why and how this is done, but I just don't understand it programmatically: Which of the following is true (IMAGE_BASE_RELOCATION in WinNT.h)? // Base relocation #1 DWORD VirtualAddress; DWORD SizeOfBlock; // size of current relocation WORD TypeOffset[1]; // Base relocation #2 DWORD VirtualAddress; DWORD SizeOfBlock; // size of current

Running .sh scripts in Git Bash

二次信任 提交于 2019-12-03 08:06:25
问题 I'm on a Windows machine using Git 2.7.2.windows.1 with MinGW 64. I have a script in C:/path/to/scripts/myScript.sh . How do I execute this script from my Git Bash instance? It was possible to add it to the .bashrc file and then just execute the entire bashrc file. But I want to add the script to a separate file and execute it from there. 回答1: Let's say you have a script script.sh . To run it ( using Git Bash ), you do the following chmod +x script.sh ./script.sh You can change the chmod to

Usage differences between. a.out, .ELF, .EXE, and .COFF

a 夏天 提交于 2019-12-03 07:21:19
问题 Don't get me wrong by looking at the question title - I know what they are (format for portable executable files). But my interest scope is slightly different MY CONFUSION I am involved in re-hosting/retargeting applications that are originally from third parties. The problem is that sometimes the formats for object codes are also in .elf, .COFF formats and still says, "Executable and linkable". I am primarily a Windows user and know that when you compile and assemble your C/C++ code, you get

Equivalent of double-clickable .sh and .bat on Mac?

荒凉一梦 提交于 2019-12-03 06:53:50
问题 I am distributing a Java program where I want a double-clickable file to run java -cp MyProgram.jar;MyLib.jar my.program.Main On Windows I simply distribute a .bat file, for *nix an executable .sh file. Problem is, double-clicking the .sh file just opens it up in a text editor on Mac. What should I do for Mac? 回答1: On mac, there is a specific extension for executing shell scripts by double clicking them: this is .command . 回答2: For Java applications on Mac, you really should use Apple's Jar

chrome/chromium extension: run a executable/script via the context menu

ⅰ亾dé卋堺 提交于 2019-12-03 06:37:47
I'm writing a small chrome extension for personal use and I would like to run an executable via the context menu and pass certain information as arguments to said executable. What the simplest and/or cleanest way to achieve this? To me it seems that it is impossible due to chrome's sandboxing. JSuar This can be accomplished via NPAPI Plugins . Code running in an NPAPI plugin has the full permissions of the current user and is not sandboxed or shielded from malicious input by Google Chrome in any way. You should be especially cautious when processing input from untrusted sources, such as when

Creating an executable .exe file from a PowerShell Script?

梦想与她 提交于 2019-12-03 06:23:34
问题 Is it possible to create an executable file.exe file from a PowerShell Script? 回答1: No. At least, not yet, and after 5 versions of PowerShell, it seems unlikely ever. I wish I could just leave it at that, but other people have provided a bunch of "workaround" type answers I feel compelled to address: You can wrap your .ps1 script in another script type to make it double-clickable, and you can even generate an executable with the script embedded (see the other answers on this thread) ... but