Open from objcopy

Source: Internet
Author: User

Open from objcopy

June 18, 2017 22:30:47

Objcopy is not so much a conversion tool as a simple compiler. It can be understood in this way,

What should I do if I want to embed an image into a program? Use WinHex to get all the bytes of the image, and then

It is copied to the Code, compiled, and handled. Very regular, very primitive. To write a program, you must be a hacker and find its essence.

Here, objCopy can be understood as a compiler. Its input can be anything. Although the compilation input we know is code, this tool extends the concept of compilation, it can compile any file. o. Note: This activity was previously done by the compiler. Now, it's a shortcut. At the same time, it can output some variables, which is more conscientious and more like a compiler.

The usage is as follows:

Objcopy-I binary-O elf32-i386-B I ?foo.jpg foo. o

Convert foo.jpg to a. o file and export the following variables:

Extern char _ binary_foo_jpg_start [];

Extern char _ binary_foo_jpg_end [];

Extern char _ binary_foo_jpg_size [];

The tool is finished, but it does not seem to be clear yet. The essence of writing a program is to change the code. o, and then generate executable files, so with. o, you can link it .. O sources generally consider the output of the compiler. Is there anything else besides the compiler that can output the. o file? Objcopy is one. You can manually write one according to the. o file format. This is like a Java. class file, not only can be generated in Java, as long as it complies with the. class file format, any language, such as Python can generate such a file.

Learning can be too difficult to learn and use.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.