[*] Binary protection state of miio_send_line
No RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf tear down of miio_send_line
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/6225984-11075644.jffs2_new_extract/etc/miio_client/miio_send_line @ 0x400620 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [09] -r-x section size 992 named .text */
0x00400620 lui gp, 0x42 |
0x00400624 addiu sp, sp, -0x38 |
0x00400628 addiu gp, gp, -0x74a0 | gp += -0x74a0;
0x0040062c addiu v0, zero, 2 | v0 = 2;
0x00400630 sw s2, 0x30(sp) | *(var_30h) = s2;
0x00400634 sw s0, 0x28(sp) | *(var_28h) = s0;
0x00400638 sw ra, 0x34(sp) | *(var_34h) = ra;
0x0040063c sw s1, 0x2c(sp) | *(var_2ch) = s1;
0x00400640 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00400644 move s2, a0 | s2 = a0;
0x00400648 move s0, a1 | s0 = a1;
| if (a0 != v0) {
0x0040064c beq a0, v0, 0x400660 |
0x00400650 lui a0, 0x40 | a0 = "Usage: %s msg\n";
| /* str.Usage:__s_msg_n */
0x00400654 addiu a0, a0, 0xadc |
0x00400658 j 0x400684 | goto label_0;
0x0040065c lw a1, (a1) | a1 = *(a1);
| }
0x00400660 lw t9, -0x7fc8(gp) | t9 = sym.imp.strlen;
0x00400664 lw a0, 4(a1) | a0 = *((a1 + 1));
0x00400668 jalr t9 | t9 ();
0x0040066c sltiu v0, v0, 0x400 | v0 = (v0 < 0x400) ? 1 : 0;
0x00400670 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00400674 bnez v0, 0x4006a0 |
0x00400678 lui a0, 0x40 | a0 = "msg too long, max %d\n";
| /* str.msg_too_long__max__d_n */
0x0040067c addiu a0, a0, 0xaec |
0x00400680 addiu a1, zero, 0x400 | a1 = 0x400;
| label_0:
0x00400684 lw t9, -0x7fa0(gp) | t9 = sym.imp.printf
0x00400688 jalr t9 | t9 ();
0x0040068c nop |
0x00400690 lw gp, 0x10(sp) | gp = *(var_10h);
0x00400694 lw t9, -0x7fc4(gp) | t9 = sym.imp.exit;
0x00400698 addiu a0, zero, -1 | a0 = -1;
0x0040069c jalr t9 | t9 ();
| }
0x004006a0 lw t9, -0x7fa8(gp) | t9 = sym.imp.socket;
0x004006a4 addiu a1, zero, 2 | a1 = 2;
0x004006a8 move a2, zero | a2 = 0;
0x004006ac addiu a0, zero, 2 | a0 = 2;
0x004006b0 jalr t9 | t9 ();
0x004006b4 lw gp, 0x10(sp) | gp = *(var_10h);
0x004006b8 sw zero, 0x18(sp) | *(var_18h) = 0;
0x004006bc lw t9, -0x7fb0(gp) | t9 = sym.imp.inet_addr;
0x004006c0 sh s2, 0x18(sp) | *(var_18h) = s2;
0x004006c4 lui s2, 0x40 | s2 = 0x400000;
| /* str.127.0.0.1 */
0x004006c8 addiu a0, s2, 0xb04 | a0 = "127.0.0.1";
0x004006cc sw zero, 0x1c(sp) | *(var_1ch) = 0;
0x004006d0 sw zero, 0x20(sp) | *(var_20h) = 0;
0x004006d4 sw zero, 0x24(sp) | *(var_24h) = 0;
0x004006d8 move s1, v0 | s1 = v0;
0x004006dc jalr t9 | t9 ();
0x004006e0 lw gp, 0x10(sp) | gp = *(var_10h);
0x004006e4 sw v0, 0x1c(sp) | *(var_1ch) = v0;
0x004006e8 lw t9, -0x7fa4(gp) | t9 = sym.imp.connect;
0x004006ec addiu v0, zero, 0x32d4 | v0 = 0x32d4;
0x004006f0 sh v0, 0x1a(sp) | *(var_1ah) = v0;
0x004006f4 move a0, s1 | a0 = s1;
0x004006f8 addiu a1, sp, 0x18 | a1 = sp + 0x18;
0x004006fc addiu a2, zero, 0x10 | a2 = 0x10;
0x00400700 jalr t9 | t9 ();
0x00400704 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x00400708 bgez v0, 0x40072c |
0x0040070c lw t9, -0x7fa0(gp) | t9 = sym.imp.printf
0x00400710 lui a0, 0x40 | a0 = "Connect to server error: %s:%d\n";
| /* str.Connect_to_server_error:__s:_d_n */
0x00400714 addiu a0, a0, 0xb10 |
| /* str.127.0.0.1 */
0x00400718 addiu a1, s2, 0xb04 | a1 = s2 + 0xb04;
0x0040071c ori a2, zero, 0xd432 | a2 = 0xd432;
0x00400720 jalr t9 | t9 ();
0x00400724 j 0x40075c | goto label_1;
0x00400728 addiu v0, zero, -1 | v0 = -1;
| }
0x0040072c lw s0, 4(s0) | s0 = *((s0 + 1));
0x00400730 lw t9, -0x7fc8(gp) | t9 = sym.imp.strlen;
0x00400734 move a0, s0 | a0 = s0;
0x00400738 jalr t9 | t9 ();
0x0040073c lw gp, 0x10(sp) | gp = *(var_10h);
0x00400740 move a0, s1 | a0 = s1;
0x00400744 lw t9, -0x7fac(gp) | t9 = sym.imp.send;
0x00400748 move a1, s0 | a1 = s0;
0x0040074c move a2, v0 | a2 = v0;
0x00400750 move a3, zero | a3 = 0;
0x00400754 jalr t9 | t9 ();
0x00400758 move v0, zero | v0 = 0;
| label_1:
0x0040075c lw ra, 0x34(sp) | ra = *(var_34h);
0x00400760 lw s2, 0x30(sp) | s2 = *(var_30h);
0x00400764 lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x00400768 lw s0, 0x28(sp) | s0 = *(var_28h);
0x0040076c addiu sp, sp, 0x38 |
0x00400770 jr ra | return v0;
| }
[*] Function printf used 3 times miio_send_line