逆向-beginners之C++流

#include <iostream>

int main()
{
    std::cout << "hello,world!\n";
    std::cout << "hello, " << "world!\n";
    // f(f(std::cout, "Hello, "), "world!");
}

#if 0
/*
 * intel
 */
0000000000001189 <main>:
    1189:    f3 0f 1e fa              endbr64
    118d:    55                       push   %rbp
    118e:    48 89 e5                 mov    %rsp,%rbp
    1191:    48 8d 35 6d 0e 00 00     lea    0xe6d(%rip),%rsi        # 2005 <_ZStL19piecewise_construct+0x1>
    1198:    48 8d 3d a1 2e 00 00     lea    0x2ea1(%rip),%rdi        # 4040 <_ZSt4cout@@GLIBCXX_3.4>
    119f:    e8 dc fe ff ff           callq  1080 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
    11a4:    48 8d 35 68 0e 00 00     lea    0xe68(%rip),%rsi        # 2013 <_ZStL19piecewise_construct+0xf>
    11ab:    48 8d 3d 8e 2e 00 00     lea    0x2e8e(%rip),%rdi        # 4040 <_ZSt4cout@@GLIBCXX_3.4>
    11b2:    e8 c9 fe ff ff           callq  1080 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
    11b7:    48 8d 35 5d 0e 00 00     lea    0xe5d(%rip),%rsi        # 201b <_ZStL19piecewise_construct+0x17>
    11be:    48 89 c7                 mov    %rax,%rdi
    11c1:    e8 ba fe ff ff           callq  1080 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
    11c6:    b8 00 00 00 00           mov    $0x0,%eax
    11cb:    5d                       pop    %rbp
    11cc:    c3                       retq   

/*
 * arm
 */
00000000004007dc <main>:
  4007dc:    a9bf7bfd     stp    x29, x30, [sp, #-16]!
  4007e0:    910003fd     mov    x29, sp
  4007e4:    90000000     adrp    x0, 400000 <_init-0x638>
  4007e8:    9125a001     add    x1, x0, #0x968
  4007ec:    b0000080     adrp    x0, 411000 <__libc_start_main@GLIBC_2.17>
  4007f0:    91012000     add    x0, x0, #0x48
  4007f4:    97ffffb3     bl    4006c0 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
  4007f8:    90000000     adrp    x0, 400000 <_init-0x638>
  4007fc:    9125e001     add    x1, x0, #0x978
  400800:    b0000080     adrp    x0, 411000 <__libc_start_main@GLIBC_2.17>
  400804:    91012000     add    x0, x0, #0x48
  400808:    97ffffae     bl    4006c0 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
  40080c:    aa0003e2     mov    x2, x0
  400810:    90000000     adrp    x0, 400000 <_init-0x638>
  400814:    91260000     add    x0, x0, #0x980
  400818:    aa0003e1     mov    x1, x0
  40081c:    aa0203e0     mov    x0, x2
  400820:    97ffffa8     bl    4006c0 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
  400824:    52800000     mov    w0, #0x0                       // #0
  400828:    a8c17bfd     ldp    x29, x30, [sp], #16
  40082c:    d65f03c0     ret

#endif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值