Reading binary (MACH-O) file load commands [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How does otool and similar tools read load commands? I could not find any open source tools to figure this out (even though otool is partially open source). How does it parse the binary file? Where does it start?
Thanks

I would expect that the otool command would open the file and parse the header of the binary according to the OSX ABI Mach-O File Format

Related

Build and execute C file in Vim using a shortcut [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to be able to build and execute the currently opened C file using a shortcut like in IDEs as I don't want to type a command every time I run.
Use a shell script that compiles and executes the file.
gcc file.c
./a.out
only works if you work with one file or #include, or you have to add the other files to the compiler.
As you probably work with a text editor, there are no other options than this, or doing it manually.

Can I compile a .c file to .exe file without a compiler? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have recently downloaded an application file in the .c format. I want to convert it to an exe file so that i can run it. I also tried to download a compiler but I was unsuccessful. Can anyone help?
you could use an online complier such as this website
Can I compile a .c file to .exe file without a compiler?
No

Building go linker as a stand alone tool [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I was browsing the go source and I wanted to build it as a standalone linker for osx that can generate mach-o files. Is there anyway to do this?
The linker is already a standalone tool. You can see it by running
go tool -n 6l
which will print the location of the 6l (x86 64 bit linker) executable.
The source code of 6l can be found in GOROOT/src/cmd/6l.
In that directory you can use make to build it.

Reading .log file using C language in Linux [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have some information in a .log file. Is there any way to read a .log file in C language and convert it to .txt file? Are there any include files or API's I can use?
Most of the time a log file is just a formatted text file, so there is no need to convert.
Just use the rename() function from stdio.h. Here a reference: http://www.cplusplus.com/reference/cstdio/rename/.

How to find built directory string in C exec.file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
while reading docs for FreeBSD 7.3 gdb, I saw a mention of built directory info stored in binary files. How is it stored, and how could it be retrieved?
If a binary is built with debug info, then it will contain debug symbol information that contains full path names, so when you debug, your debugger can find source files and correlate source code with execution. Open the binary file in any hex editor and you will be able to see the path strings

Resources