IOS Reverse Analysis--gl script extraction

Source: Internet
Author: User

Summary: To reverse a program must clearly know the structure of the program and commonly used API functions, it is not clear a program to reverse the result is not possible to drop

First, the GLSL script runs the entire process, the first step is to create a container for shader run Gluint glcreateprogram (void), the second step is to attach the compiled shader to the program void Glattachshader (Gluint program, Gluint Shader), compiled shader can be multiple so the second step can repeat multiple steps to add each of the compiled one by one to the application, vertex shader and pixel shader one by one pair, the third step is void Gllinkprogram ( Gluint program) is used to connect these programs, and the fourth step void Gluseprogram (Gluint prog) uses it.

To extract the script, we need to know how to compile shader in the second step how to pass a string, compile shader is divided into three steps, one is to create a container gluint glcreateshader (Glenum shadertype), and the other is to add source code void Glshadersource (gluint shader, int numofstrings, const char **strings, int *lenofstrings), and three are compiled void Glcompileshader ( Gluint shader)

Understand these at a glance to know to extract shader is when it added the original code when the breakpoint, compile and other functions are not related to the string, only Glshadersource is to add the source, the other functions are useless, found the key function to see the parameters, the third parameter is a string pointer, After the broken down in the Register R2 print out, p * (char**) $r 2, run one time off to print once, all copied out all the shader are extracted.

The reverse process looks very simple, mainly familiar with the process of the program to find the key function, the fault is more and more away

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.