[*] Binary protection state of miio_recv_line

  
  	No RELRO       No Canary found   NX disabled  No PIE       No RPATH     No RUNPATH   No Symbols


[*] Function printf tear down of miio_recv_line

    ; assembly                               | /* r2dec pseudo code output */
                                             | /* /logs/firmware/unblob_extracted/firmware_extract/6225984-11075644.jffs2_new_extract/etc/miio_client/miio_recv_line @ 0x400640 */
                                             | #include <stdint.h>
                                             |  
    ; (fcn) main ()                          | int32_t main () {
                                             |     /* [09] -r-x section size 1024 named .text */
    0x00400640 lui gp, 0x42                  |     
    0x00400644 addiu gp, gp, -0x7410         |     
    0x00400648 addiu sp, sp, -0x438          |     
    0x0040064c lw t9, -0x7fac(gp)            |     t9 = sym.imp.socket;
    0x00400650 addiu a1, zero, 2             |     a1 = 2;
    0x00400654 sw ra, 0x434(sp)              |     *(var_434h) = ra;
    0x00400658 move a2, zero                 |     a2 = 0;
    0x0040065c sw s2, 0x430(sp)              |     *(var_430h) = s2;
    0x00400660 sw s1, 0x42c(sp)              |     *(var_42ch) = s1;
    0x00400664 sw s0, 0x428(sp)              |     *(var_428h) = s0;
    0x00400668 sw gp, 0x10(sp)               |     *(var_10h) = gp;
    0x0040066c addiu a0, zero, 2             |     a0 = 2;
    0x00400670 jalr t9                       |     t9 ();
    0x00400674 lw gp, 0x10(sp)               |     gp = *(var_10h);
    0x00400678 move s1, v0                   |     s1 = v0;
    0x0040067c lw t9, -0x7fb4(gp)            |     t9 = sym.imp.inet_addr;
    0x00400680 addiu v0, zero, 2             |     v0 = 2;
    0x00400684 lui s2, 0x40                  |     s2 = 0x400000;
    0x00400688 sw zero, 0x418(sp)            |     *(var_418h) = 0;
                                             |     /* str.127.0.0.1 */
    0x0040068c addiu a0, s2, 0xb2c           |     a0 = s2 + 0xb2c;
    0x00400690 sw zero, 0x41c(sp)            |     *(var_41ch) = 0;
    0x00400694 sw zero, 0x420(sp)            |     *(var_420h) = 0;
    0x00400698 sw zero, 0x424(sp)            |     *(var_424h) = 0;
    0x0040069c sh v0, 0x418(sp)              |     *(var_418h) = v0;
    0x004006a0 jalr t9                       |     t9 ();
    0x004006a4 lw gp, 0x10(sp)               |     gp = *(var_10h);
    0x004006a8 sw v0, 0x41c(sp)              |     *(var_41ch) = v0;
    0x004006ac lw t9, -0x7fa4(gp)            |     t9 = sym.imp.connect;
    0x004006b0 addiu v0, zero, 0x32d4        |     v0 = 0x32d4;
    0x004006b4 addiu s0, sp, 0x418           |     s0 = sp + 0x418;
    0x004006b8 sh v0, 0x41a(sp)              |     *(var_41ah) = v0;
    0x004006bc move a0, s1                   |     a0 = s1;
    0x004006c0 move a1, s0                   |     a1 = s0;
    0x004006c4 addiu a2, zero, 0x10          |     a2 = 0x10;
    0x004006c8 jalr t9                       |     t9 ();
    0x004006cc lw gp, 0x10(sp)               |     gp = *(var_10h);
                                             |     if (v0 < 0) {
    0x004006d0 bgez v0, 0x4006e8             |         
    0x004006d4 lui a0, 0x40                  |         a0 = "Connect to server error: %s:%d\n";
                                             |         /* str.Connect_to_server_error:__s:_d_n */
    0x004006d8 addiu a0, a0, 0xb38           |         
                                             |         /* str.127.0.0.1 */
    0x004006dc addiu a1, s2, 0xb2c           |         a1 = s2 + 0xb2c;
    0x004006e0 j 0x40077c                    |         goto label_0;
    0x004006e4 ori a2, zero, 0xd432          |         a2 = 0xd432;
                                             |     }
    0x004006e8 lw t9, -0x7fb0(gp)            |     t9 = sym.imp.send;
    0x004006ec lui a1, 0x40                  |     a1 = 0x400000;
    0x004006f0 move a0, s1                   |     a0 = s1;
                                             |     /* str._method_:__internal.hello_ */
    0x004006f4 addiu a1, a1, 0xb58           |     a1 += 0xb58;
    0x004006f8 addiu a2, zero, 0x1c          |     a2 = 0x1c;
    0x004006fc move a3, zero                 |     a3 = 0;
    0x00400700 jalr t9                       |     t9 ();
    0x00400704 lw gp, 0x10(sp)               |     gp = *(var_10h);
                                             |     if (v0 >= 0) {
    0x00400708 bgez v0, 0x400728             |         goto label_1;
                                             |     }
    0x0040070c lui a0, 0x40                  |     a0 = 0x400000;
    0x00400710 lw t9, -0x7f9c(gp)            |     t9 = sym.imp.printf
                                             |     /* str.send_error__sockfd:__d__error:__m_n */
    0x00400714 addiu a0, a0, 0xb78           |     a0 += 0xb78;
    0x00400718 move a1, s1                   |     a1 = s1;
    0x0040071c jalr t9                       |     t9 ();
                                             |     do {
    0x00400720 j 0x4007a8                    |         goto label_2;
    0x00400724 addiu v0, zero, -1            |         v0 = -1;
                                             | label_1:
    0x00400728 lw t9, -0x7fc8(gp)            |         t9 = sym.imp.memset;
    0x0040072c addiu s0, sp, 0x18            |         s0 = sp + 0x18;
    0x00400730 move a0, s0                   |         a0 = s0;
    0x00400734 move a1, zero                 |         a1 = 0;
    0x00400738 addiu a2, zero, 0x400         |         a2 = 0x400;
    0x0040073c jalr t9                       |         t9 ();
    0x00400740 lw gp, 0x10(sp)               |         gp = *(var_10h);
    0x00400744 move a0, s1                   |         a0 = s1;
    0x00400748 lw t9, -0x7fa0(gp)            |         t9 = sym.imp.recv;
    0x0040074c move a1, s0                   |         a1 = s0;
    0x00400750 addiu a2, zero, 0x400         |         a2 = 0x400;
    0x00400754 move a3, zero                 |         a3 = 0;
    0x00400758 jalr t9                       |         t9 ();
    0x0040075c addiu s2, zero, 0x400         |         s2 = 0x400;
    0x00400760 lw gp, 0x10(sp)               |         gp = *(var_10h);
    0x00400764 move v1, v0                   |         v1 = v0;
                                             |         if (v0 != s2) {
    0x00400768 bne v0, s2, 0x400790          |             goto label_3;
                                             |         }
    0x0040076c lui a0, 0x40                  |         a0 = "ERROR, buffer too small: %lu <= %d\n";
                                             |         /* str.ERROR__buffer_too_small:__lu____d_n */
    0x00400770 addiu a0, a0, 0xb9c           |         
    0x00400774 addiu a1, zero, 0x400         |         a1 = 0x400;
    0x00400778 addiu a2, zero, 0x400         |         a2 = 0x400;
                                             | label_0:
    0x0040077c lw t9, -0x7f9c(gp)            |         t9 = sym.imp.printf
    0x00400780 jalr t9                       |         t9 ();
    0x00400784 nop                           |         
    0x00400788 j 0x400720                    |         
                                             |     } while (1);
    0x0040078c nop                           |     
                                             | label_3:
    0x00400790 addiu v0, zero, -1            |     v0 = -1;
                                             |     if (v1 != 0) {
    0x00400794 beqz v1, 0x4007a8             |         
    0x00400798 lw t9, -0x7fa8(gp)            |         t9 = sym.imp.puts;
    0x0040079c move a0, s0                   |         a0 = s0;
    0x004007a0 jalr t9                       |         t9 ();
    0x004007a4 move v0, zero                 |         v0 = 0;
                                             |     }
                                             | label_2:
    0x004007a8 lw ra, 0x434(sp)              |     ra = *(var_434h);
    0x004007ac lw s2, 0x430(sp)              |     s2 = *(var_430h);
    0x004007b0 lw s1, 0x42c(sp)              |     s1 = *(var_42ch);
    0x004007b4 lw s0, 0x428(sp)              |     s0 = *(var_428h);
    0x004007b8 addiu sp, sp, 0x438           |     
    0x004007bc jr ra                         |     return v0;
                                             | }

[*] Function printf used 3 times miio_recv_line