Hopper reverse pseudo-code makes the big surprise

Source: Internet
Author: User

Online Introduction Hopper has a lot of reverse pseudo-code articles, and think it is omnipotent and cool B. But no one to prove Hopper's inverse pseudo-code reference coefficient (reference value, we have done the development are clear, some features look very cool but not practical) how high, or the credibility of the correct rate (at least do not mislead people, this is more than their direct inverse analysis of the disassembly code error and MAD). The previous article has raised this question, this article to further proof, I only in high school political thought lesson in the theory of truth-seeking spirit, and a programmer of the Code of love, not pick up the trouble.

Pick out three of the functions I've reversed, use hopper to reverse output pseudocode, and compare the points I want to examine.

1.QuartzCore ' Ca::context::client_port See if Hopper can analyze the ^ () Block.

2.QuartzCore ' ca::context::commit_commands See if Hopper can analyze the switch.

3.QuartzCore ' DrawLine (c-style function) observes Hopper correctly when it is adapted to Quartzcore '-[catextlayer _drawline:incontext:atpoint:] to analyze the parameters.

The first is the Quartzcore ' ca::context::client_port, the result is hopper not able to analyze the ^ () Block, but also accidentally found Hopper in reverse pseudo-code without regard to the memory unit reference in other functions of the content of the modification.

The following is a reverse pseudo-code for the hopper. Comment on no parsing of the ^ () block

Followed by a comment about another problem that was discovered unexpectedly

The following is a comment on the disassembly

Then I reverse the code:

The test point of the second arrangement is the function Quartzcore ' ca::context::commit_commands, and the result Hopper does not parse the switch structure.

The last test point is the function Quartzcore ' drawLine, which results in the analysis of the error of the hopper in the inverse of its most good-length OC function call. Apply the Quartzcore ' DrawLine (c-style function) to Quartzcore '-[catextlayer _drawline:incontext:atpoint:]. Hopper will only follow the x64 system, the number of fingers abruptly to add a R8 register, brutally as the 5th parameter of the Msg_send to deal with, and did not pass the compiler parameters of the Convention to consider the problem.

This function is simple and short, with the disassembly code together.

Quartzcore ' DrawLine (objc_object*, void*, Cgpoint, __ctline const*): 0X1041CA4DC <+0: Pushq%rbp 0x1041ca4dd <+1: Movq%rsp,%RBP 0x1041ca4e0 <+4: Movq%rsi,%rax 0x1041ca4e3 <+7: Movq 0x50f2e (%rip),%rsi;"_drawline:incontext:atpoint:"0x1041ca4ea <+ -: Movq%rax,%RCX 0x1041ca4ed <+ -: Popq%rbp 0x1041ca4ee <+ -: JMPQ *0x55d44 (%rip);(void *) 0x000000010357d800:objc_msgsend

Hopper reverse pseudo-code makes the big surprise

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.