[*] Binary protection state of miio_client
No RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function strcpy tear down of miio_client
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/6225984-11075644.jffs2_new_extract/etc/miio_client/miio_client @ 0x405c84 */
| #include <stdint.h>
|
; (fcn) fcn.00405c84 () | void fcn_00405c84 () {
0x00405c84 lui gp, 0x43 |
0x00405c88 addiu gp, gp, 0x1620 |
0x00405c8c addiu sp, sp, -0x1058 |
0x00405c90 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x00405c94 sw ra, 0x1054(sp) | *(var_1054h) = ra;
0x00405c98 sw s4, 0x104c(sp) | *(var_104ch) = s4;
0x00405c9c sw gp, 0x28(sp) | *(var_28h) = gp;
0x00405ca0 sw s5, 0x1050(sp) | *(var_1050h) = s5;
0x00405ca4 sw s3, 0x1048(sp) | *(var_1048h) = s3;
0x00405ca8 sw s2, 0x1044(sp) | *(var_1044h) = s2;
0x00405cac sw s1, 0x1040(sp) | *(var_1040h) = s1;
0x00405cb0 sw s0, 0x103c(sp) | *(var_103ch) = s0;
0x00405cb4 jalr t9 | t9 ();
0x00405cb8 lw gp, 0x28(sp) | gp = *(var_28h);
0x00405cbc lui a1, 0x41 | a1 = 0x410000;
0x00405cc0 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00405cc4 move a0, v0 | a0 = v0;
| /* str.params */
0x00405cc8 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x00405ccc addiu a2, sp, 0x1030 | a2 = sp + 0x1030;
0x00405cd0 move s4, v0 | s4 = v0;
0x00405cd4 jalr t9 | t9 ();
0x00405cd8 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == 0) {
0x00405cdc bnez v0, 0x405cf0 |
0x00405ce0 lui a1, 0x41 | a1 = 0x410000;
0x00405ce4 move a0, zero | a0 = 0;
0x00405ce8 j 0x405d14 | goto label_0;
| /* str.msg_does_not_have__params_._n */
0x00405cec addiu a1, a1, 0x56cc | a1 += 0x56cc;
| }
0x00405cf0 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00405cf4 lw a0, 0x1030(sp) | a0 = *(var_1030h);
0x00405cf8 addiu a1, zero, 6 | a1 = 6;
0x00405cfc jalr t9 | t9 ();
0x00405d00 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == 0) {
0x00405d04 bnez v0, 0x405d28 |
0x00405d08 lui a1, 0x41 | a1 = 0x410000;
0x00405d0c move a0, zero | a0 = 0;
| /* str.debug_param_is_not_string_n */
0x00405d10 addiu a1, a1, 0x56ec | a1 += 0x56ec;
| label_0:
0x00405d14 lw t9, -0x7fc8(gp) | t9 = sym.log_printf;
0x00405d18 jalr t9 | t9 ();
0x00405d1c nop |
0x00405d20 j 0x405fa4 | goto label_1;
0x00405d24 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00405d28 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x00405d2c lw a0, 0x1030(sp) | a0 = *(var_1030h);
0x00405d30 addiu s1, sp, 0x30 | s1 = sp + 0x30;
0x00405d34 jalr t9 | t9 ();
0x00405d38 lw gp, 0x28(sp) | gp = *(var_28h);
0x00405d3c move a0, s1 | a0 = s1;
0x00405d40 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00405d44 move a1, zero | a1 = 0;
0x00405d48 addiu a2, zero, 0x1000 | a2 = 0x1000;
0x00405d4c move s0, v0 | s0 = v0;
0x00405d50 jalr t9 | t9 ();
0x00405d54 lw gp, 0x28(sp) | gp = *(var_28h);
0x00405d58 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00405d5c move a0, s0 | a0 = s0;
0x00405d60 jalr t9 | t9 ();
0x00405d64 addiu v1, zero, 4 | v1 = 4;
0x00405d68 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == v1) {
0x00405d6c bne v0, v1, 0x405e10 |
0x00405d70 lw t9, -0x7df4(gp) | t9 = sym.imp.strcmp;
0x00405d74 lui a1, 0x41 | a1 = 0x410000;
0x00405d78 move a0, s0 | a0 = s0;
| /* str.ping */
0x00405d7c addiu a1, a1, 0x5708 | a1 += 0x5708;
0x00405d80 jalr t9 | t9 ();
0x00405d84 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == 0) {
0x00405d88 bnez v0, 0x405d9c |
0x00405d8c lui a1, 0x41 | a1 = 0x410000;
0x00405d90 move a0, s1 | a0 = s1;
0x00405d94 j 0x405f78 | goto label_2;
| /* str._result_:_debug:_pong_ */
0x00405d98 addiu a1, a1, 0x5710 | a1 += 0x5710;
| }
0x00405d9c lw t9, -0x7df4(gp) | t9 = sym.imp.strcmp;
0x00405da0 lui a1, 0x41 | a1 = 0x410000;
0x00405da4 move a0, s0 | a0 = s0;
| /* str.miio */
0x00405da8 addiu a1, a1, 0x572c | a1 += 0x572c;
0x00405dac jalr t9 | t9 ();
0x00405db0 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 != 0) {
0x00405db4 bnez v0, 0x405f6c | goto label_3;
| }
0x00405db8 lui v1, 0x43 | v1 = 0x430000;
0x00405dbc lui v0, 0x43 | v0 = 0x430000;
0x00405dc0 lw a2, -0x6dd0(v1) | a2 = *((v1 - 7028));
0x00405dc4 addiu v0, v0, -0x6bac | v0 += -0x6bac;
| /* obj.miio */
0x00405dc8 addiu v1, v1, -0x6dd0 | v1 += -0x6dd0;
0x00405dcc lw a3, 0x194(v1) | a3 = *((v1 + 101));
0x00405dd0 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00405dd4 lw a0, 0x2e0(v1) | a0 = *((v1 + 184));
0x00405dd8 lw a1, 0x2e4(v1) | a1 = *((v1 + 185));
0x00405ddc sw a0, 0x18(sp) | *(var_18h) = a0;
0x00405de0 sw a1, 0x1c(sp) | *(var_1ch) = a1;
0x00405de4 lw v0, 0x2c4(v1) | v0 = *((v1 + 177));
0x00405de8 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf;
0x00405dec sw v0, 0x20(sp) | *(var_20h) = v0;
0x00405df0 lw v0, 0x2c8(v1) | v0 = *((v1 + 178));
0x00405df4 lui a1, 0x41 | a1 = 0x410000;
0x00405df8 sw v0, 0x24(sp) | *(var_24h) = v0;
0x00405dfc move a0, s1 | a0 = s1;
| /* str._result_:_debug:_state:__d__count_pollfds:__d__host:__s__did:__llu__retry:__d__d_ */
0x00405e00 addiu a1, a1, 0x5734 | a1 += 0x5734;
0x00405e04 jalr t9 | t9 ();
0x00405e08 j 0x405f88 | goto label_4;
0x00405e0c lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00405e10 addiu v1, zero, 5 | v1 = 5;
0x00405e14 lw t9, -0x7df4(gp) | t9 = sym.imp.strcmp;
| if (v0 != v1) {
0x00405e18 bne v0, v1, 0x405f6c | goto label_3;
| }
0x00405e1c lui a1, 0x41 | a1 = 0x410000;
0x00405e20 move a0, s0 | a0 = s0;
| /* str.queue */
0x00405e24 addiu a1, a1, 0x5788 | a1 += 0x5788;
0x00405e28 jalr t9 | t9 ();
0x00405e2c lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 != 0) {
0x00405e30 bnez v0, 0x405f6c | goto label_3;
| }
0x00405e34 lui s2, 0x43 | s2 = miio;
| /* obj.miio */
0x00405e38 addiu s2, s2, -0x6dd0 |
0x00405e3c lw v0, 0x3ac(s2) | v0 = *((s2 + 235));
0x00405e40 lui a2, 0x41 | a2 = 0x410000;
| if (v0 != 0) {
0x00405e44 beqz v0, 0x405e50 |
0x00405e48 j 0x405e58 | goto label_5;
| /* str.not_null:_ */
0x00405e4c addiu a2, a2, 0x56b0 | a2 += 0x56b0;
| }
0x00405e50 lui a2, 0x41 | a2 = "NULL;";
| /* str.NULL_ */
0x00405e54 addiu a2, a2, 0x56a8 |
| label_5:
0x00405e58 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf;
0x00405e5c lui a1, 0x41 | a1 = 0x410000;
0x00405e60 move a0, s1 | a0 = s1;
| /* str._result_:_debug:_data_queue:__s */
0x00405e64 addiu a1, a1, 0x5790 | a1 += 0x5790;
0x00405e68 jalr t9 | t9 ();
0x00405e6c lw s3, 0x3ac(s2) | s3 = *((s2 + 235));
0x00405e70 lw gp, 0x28(sp) | gp = *(var_28h);
0x00405e74 move s0, v0 | s0 = v0;
| if (s3 == 0) {
0x00405e78 beqz s3, 0x405ecc | goto label_6;
| }
0x00405e7c lui s5, 0x41 | s5 = "id:%d, size:%d, retry:%d, ack_timeout:%llu;";
| /* str.id:_d__size:_d__retry:_d__ack_timeout:_llu_ */
0x00405e80 addiu s5, s5, 0x57b4 |
| do {
0x00405e84 sltiu v0, s0, 0x1000 | v0 = (s0 < 0x1000) ? 1 : 0;
0x00405e88 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf;
| if (v0 == 0) {
0x00405e8c beqz v0, 0x405ecc | goto label_6;
| }
0x00405e90 lw v0, 0xc(s3) | v0 = *((s3 + 3));
0x00405e94 lw a2, (s3) | a2 = *(s3);
0x00405e98 lw a3, 8(s3) | a3 = *((s3 + 2));
0x00405e9c sw v0, 0x10(sp) | *(var_10h) = v0;
0x00405ea0 lw v0, 0x10(s3) | v0 = *((s3 + 4));
0x00405ea4 lw v1, 0x14(s3) | v1 = *((s3 + 5));
0x00405ea8 addu a0, s1, s0 | a0 = s1 + s0;
0x00405eac sw v0, 0x18(sp) | *(var_18h) = v0;
0x00405eb0 sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x00405eb4 move a1, s5 | a1 = s5;
0x00405eb8 jalr t9 | t9 ();
0x00405ebc lw s3, 0x18(s3) | s3 = *((s3 + 6));
0x00405ec0 lw gp, 0x28(sp) | gp = *(var_28h);
0x00405ec4 addu s0, s0, v0 | s0 += v0;
0x00405ec8 bnez s3, 0x405e84 |
| } while (s3 != 0);
| label_6:
0x00405ecc lw v0, 0x3b0(s2) | v0 = *((s2 + 236));
0x00405ed0 addu a0, s1, s0 | a0 = s1 + s0;
| if (v0 != 0) {
0x00405ed4 beqz v0, 0x405ee4 |
0x00405ed8 lui a2, 0x41 | a2 = 0x410000;
0x00405edc j 0x405eec | goto label_7;
| /* str.not_null:_ */
0x00405ee0 addiu a2, a2, 0x56b0 | a2 += 0x56b0;
| }
0x00405ee4 lui a2, 0x41 | a2 = "NULL";
| /* str.NULL */
0x00405ee8 addiu a2, a2, 0x56bc |
| label_7:
0x00405eec lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf;
0x00405ef0 lui a1, 0x41 | a1 = " data_queue_noack: %s";
| /* str._data_queue_noack:__s */
0x00405ef4 addiu a1, a1, 0x57e0 |
0x00405ef8 jalr t9 | t9 ();
0x00405efc lw s2, 0x3b0(s2) | s2 = *((s2 + 236));
0x00405f00 lw gp, 0x28(sp) | gp = *(var_28h);
0x00405f04 addu s0, s0, v0 | s0 += v0;
| if (s2 == 0) {
0x00405f08 beqz s2, 0x405f5c | goto label_8;
| }
0x00405f0c lui s3, 0x41 | s3 = "id:%d, size:%d, retry:%d, ack_timeout:%llu;";
| /* str.id:_d__size:_d__retry:_d__ack_timeout:_llu_ */
0x00405f10 addiu s3, s3, 0x57b4 |
| do {
0x00405f14 sltiu v0, s0, 0x1000 | v0 = (s0 < 0x1000) ? 1 : 0;
0x00405f18 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf;
| if (v0 == 0) {
0x00405f1c beqz v0, 0x405f5c | goto label_8;
| }
0x00405f20 lw v0, 0xc(s2) | v0 = *((s2 + 3));
0x00405f24 lw a2, (s2) | a2 = *(s2);
0x00405f28 lw a3, 8(s2) | a3 = *((s2 + 2));
0x00405f2c sw v0, 0x10(sp) | *(var_10h) = v0;
0x00405f30 lw v0, 0x10(s2) | v0 = *((s2 + 4));
0x00405f34 lw v1, 0x14(s2) | v1 = *((s2 + 5));
0x00405f38 addu a0, s1, s0 | a0 = s1 + s0;
0x00405f3c sw v0, 0x18(sp) | *(var_18h) = v0;
0x00405f40 sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x00405f44 move a1, s3 | a1 = s3;
0x00405f48 jalr t9 | t9 ();
0x00405f4c lw s2, 0x18(s2) | s2 = *((s2 + 6));
0x00405f50 lw gp, 0x28(sp) | gp = *(var_28h);
0x00405f54 addu s0, s0, v0 | s0 += v0;
0x00405f58 bnez s2, 0x405f14 |
| } while (s2 != 0);
| label_8:
0x00405f5c lui a1, 0x41 | a1 = 0x410000;
0x00405f60 addu a0, s1, s0 | a0 = s1 + s0;
0x00405f64 j 0x405f78 | goto label_2;
| /* esilref: '"}' */
0x00405f68 addiu a1, a1, 0x605c | a1 += 0x605c;
| label_3:
0x00405f6c lui a1, 0x41 | a1 = 0x410000;
0x00405f70 move a0, s1 | a0 = s1;
| /* str._result_:_debug:_unknown_ */
0x00405f74 addiu a1, a1, 0x57f8 | a1 += 0x57f8;
| label_2:
0x00405f78 lw t9, -0x7cd4(gp) | t9 = sym.imp.strcpy
0x00405f7c jalr t9 | t9 ();
0x00405f80 nop |
0x00405f84 lw gp, 0x28(sp) | gp = *(var_28h);
| label_4:
0x00405f88 lui a1, 0x41 | a1 = 0x410000;
0x00405f8c lw t9, -0x7fc8(gp) | t9 = sym.log_printf;
0x00405f90 addiu a0, zero, 3 | a0 = 3;
| /* str._internal.debug:__s_n */
0x00405f94 addiu a1, a1, 0x5814 | a1 += 0x5814;
0x00405f98 move a2, s1 | a2 = s1;
0x00405f9c jalr t9 | t9 ();
0x00405fa0 lw gp, 0x28(sp) | gp = *(var_28h);
| label_1:
0x00405fa4 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x00405fa8 move a0, s4 | a0 = s4;
0x00405fac jalr t9 | t9 ();
0x00405fb0 lw ra, 0x1054(sp) | ra = *(var_1054h);
0x00405fb4 lw s5, 0x1050(sp) | s5 = *(var_1050h);
0x00405fb8 lw s4, 0x104c(sp) | s4 = *(var_104ch);
0x00405fbc lw s3, 0x1048(sp) | s3 = *(var_1048h);
0x00405fc0 lw s2, 0x1044(sp) | s2 = *(var_1044h);
0x00405fc4 lw s1, 0x1040(sp) | s1 = *(var_1040h);
0x00405fc8 lw s0, 0x103c(sp) | s0 = *(var_103ch);
0x00405fcc addiu sp, sp, 0x1058 |
0x00405fd0 jr ra | return v1;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/6225984-11075644.jffs2_new_extract/etc/miio_client/miio_client @ 0x40d270 */
| #include <stdint.h>
|
; (fcn) sym.cmd_internal_get_info_callback () | void cmd_internal_get_info_callback () {
0x0040d270 lui gp, 0x43 |
0x0040d274 addiu sp, sp, -0x38 |
0x0040d278 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040d27c lw t9, -0x7fc8(gp) | t9 = sym.log_printf;
0x0040d280 sw s4, 0x30(sp) | *(var_30h) = s4;
0x0040d284 lui a2, 0x42 | a2 = 0x420000;
0x0040d288 move s4, a1 | s4 = a1;
0x0040d28c lui a1, 0x41 | a1 = 0x410000;
0x0040d290 sw ra, 0x34(sp) | *(var_34h) = ra;
| /* str.cmd_internal_get_info_callback */
0x0040d294 addiu a2, a2, -0x779c | a2 += -0x779c;
| /* esilref: '&s
' */
0x0040d298 addiu a1, a1, 0x6510 | a1 += 0x6510;
0x0040d29c sw s2, 0x28(sp) | *(var_28h) = s2;
0x0040d2a0 sw s1, 0x24(sp) | *(var_24h) = s1;
0x0040d2a4 sw s0, 0x20(sp) | *(var_20h) = s0;
0x0040d2a8 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d2ac move s0, a0 | s0 = a0;
0x0040d2b0 sw s3, 0x2c(sp) | *(var_2ch) = s3;
0x0040d2b4 addiu a0, zero, 2 | a0 = 2;
0x0040d2b8 jalr t9 | t9 ();
0x0040d2bc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d2c0 addiu v0, zero, 1 | v0 = 1;
0x0040d2c4 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d2c8 move a0, s0 | a0 = s0;
0x0040d2cc sb v0, 0xc0(s4) | *((s4 + 192)) = v0;
0x0040d2d0 jalr t9 | t9 ();
0x0040d2d4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d2d8 lui a1, 0x41 | a1 = 0x410000;
0x0040d2dc lw t9, -0x7db4(gp) | t9 = sym.imp.json_object_object_del;
0x0040d2e0 move a0, v0 | a0 = v0;
| /* str.method */
0x0040d2e4 addiu a1, a1, 0x55d4 | a1 += 0x55d4;
0x0040d2e8 move s0, v0 | s0 = v0;
0x0040d2ec jalr t9 | t9 ();
0x0040d2f0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d2f4 move a0, s0 | a0 = s0;
0x0040d2f8 lw t9, -0x7d08(gp) | t9 = sym.imp.json_object_to_json_string_ext;
0x0040d2fc move a1, zero | a1 = 0;
0x0040d300 jalr t9 | t9 ();
0x0040d304 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d308 lw s1, -0x7f28(gp) | s1 = *(gp);
0x0040d30c lw a0, 0x3a8(s1) | a0 = *((s1 + 234));
0x0040d310 move s2, v0 | s2 = v0;
| if (a0 != 0) {
0x0040d314 beqz a0, 0x40d32c |
0x0040d318 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x0040d31c jalr t9 | t9 ();
0x0040d320 nop |
0x0040d324 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d328 sw zero, 0x3a8(s1) | *((s1 + 234)) = 0;
| }
0x0040d32c lw t9, -0x7dd4(gp) | t9 = sym.imp.strdup;
0x0040d330 move a0, s2 | a0 = s2;
0x0040d334 jalr t9 | t9 ();
0x0040d338 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d33c sw v0, 0x3a8(s1) | *((s1 + 234)) = v0;
| if (v0 == 0) {
0x0040d340 bnez v0, 0x40d36c |
0x0040d344 lw t9, -0x7fc8(gp) | t9 = sym.log_printf;
0x0040d348 lui a1, 0x42 | a1 = 0x420000;
0x0040d34c move a0, zero | a0 = 0;
| /* str.strdup_error__exit._n */
0x0040d350 addiu a1, a1, -0x7920 | a1 += -0x7920;
0x0040d354 jalr t9 | t9 ();
0x0040d358 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d35c addiu v1, zero, 1 | v1 = 1;
0x0040d360 lw v0, -0x7f28(gp) | v0 = *(gp);
0x0040d364 j 0x40d3ac | goto label_1;
0x0040d368 sb v1, 0x20a(v0) | *((v0 + 522)) = v1;
| }
0x0040d36c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d370 lui a1, 0x41 | a1 = 0x410000;
0x0040d374 addiu s3, sp, 0x18 | s3 = sp + 0x18;
0x0040d378 move a0, s0 | a0 = s0;
| /* str.params */
0x0040d37c addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040d380 move a2, s3 | a2 = s3;
0x0040d384 jalr t9 | t9 ();
0x0040d388 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040d38c bnez v0, 0x40d3c0 | goto label_2;
| }
0x0040d390 lui a1, 0x42 | a1 = 0x420000;
0x0040d394 addiu a0, zero, 1 | a0 = 1;
| /* str.info_does_not_have__params_:__s._n */
0x0040d398 addiu a1, a1, -0x7908 | a1 += -0x7908;
| do {
| label_0:
0x0040d39c lw t9, -0x7fc8(gp) | t9 = sym.log_printf;
0x0040d3a0 move a2, s2 | a2 = s2;
0x0040d3a4 jalr t9 | t9 ();
0x0040d3a8 lw gp, 0x10(sp) | gp = *(var_10h);
| label_1:
0x0040d3ac lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d3b0 move a0, s0 | a0 = s0;
0x0040d3b4 jalr t9 | t9 ();
0x0040d3b8 j 0x40d4f8 | goto label_3;
0x0040d3bc addiu v0, zero, -1 | v0 = -1;
| label_2:
0x0040d3c0 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d3c4 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d3c8 lui a1, 0x42 | a1 = "netif";
| /* str.netif */
0x0040d3cc addiu a1, a1, -0x78e4 |
0x0040d3d0 move a2, s3 | a2 = s3;
0x0040d3d4 jalr t9 | t9 ();
0x0040d3d8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040d3dc bnez v0, 0x40d3f0 | goto label_4;
| }
0x0040d3e0 lui a1, 0x42 | a1 = 0x420000;
0x0040d3e4 addiu a0, zero, 1 | a0 = 1;
0x0040d3e8 j 0x40d39c |
| } while (1);
| /* str.info_does_not_have__netif_:__s._n */
0x0040d3ec addiu a1, a1, -0x78dc | a1 += -0x78dc;
| label_4:
0x0040d3f0 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d3f4 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d3f8 lui a1, 0x42 | a1 = "localIp";
| /* str.localIp */
0x0040d3fc addiu a1, a1, -0x78b8 |
0x0040d400 move a2, s3 | a2 = s3;
0x0040d404 jalr t9 | t9 ();
0x0040d408 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d40c bnez v0, 0x40d420 |
0x0040d410 lui a1, 0x42 | a1 = 0x420000;
0x0040d414 addiu a0, zero, 1 | a0 = 1;
0x0040d418 j 0x40d39c | goto label_0;
| /* str.info_does_not_have__localIp_:__s._n */
0x0040d41c addiu a1, a1, -0x78b0 | a1 += -0x78b0;
| }
0x0040d420 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040d424 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d428 addiu a1, zero, 6 | a1 = 6;
0x0040d42c jalr t9 | t9 ();
0x0040d430 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d434 bnez v0, 0x40d454 |
0x0040d438 lw t9, -0x7fc8(gp) | t9 = sym.log_printf;
0x0040d43c lui a1, 0x42 | a1 = 0x420000;
0x0040d440 addiu a0, zero, 1 | a0 = 1;
| /* str.localIp_not_string_n */
0x0040d444 addiu a1, a1, -0x788c | a1 += -0x788c;
0x0040d448 jalr t9 | t9 ();
0x0040d44c j 0x40d3ac | goto label_1;
0x0040d450 lw gp, 0x10(sp) | gp = *(var_10h);
| }
0x0040d454 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040d458 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d45c jalr t9 | t9 ();
0x0040d460 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d464 move a0, v0 | a0 = v0;
0x0040d468 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040d46c move s3, v0 | s3 = v0;
0x0040d470 jalr t9 | t9 ();
0x0040d474 move s2, v0 | s2 = v0;
0x0040d478 sltiu v0, v0, 0x10 | v0 = (v0 < 0x10) ? 1 : 0;
0x0040d47c lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d480 bnez v0, 0x40d4a0 |
0x0040d484 lw t9, -0x7fc8(gp) | t9 = sym.log_printf;
0x0040d488 lui a1, 0x42 | a1 = 0x420000;
0x0040d48c addiu a0, zero, 1 | a0 = 1;
| /* str.localIp_too_long._n */
0x0040d490 addiu a1, a1, -0x7878 | a1 += -0x7878;
0x0040d494 jalr t9 | t9 ();
0x0040d498 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d49c addiu s2, zero, 0xf | s2 = 0xf;
| }
0x0040d4a0 addiu v1, s1, 0x38a | v1 = s1 + 0x38a;
0x0040d4a4 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040d4a8 move a0, v1 | a0 = v1;
0x0040d4ac move a1, s3 | a1 = s3;
0x0040d4b0 move a2, s2 | a2 = s2;
0x0040d4b4 jalr t9 | t9 ();
0x0040d4b8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d4bc addu s1, s1, s2 | s1 += s2;
0x0040d4c0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf;
0x0040d4c4 lui a1, 0x42 | a1 = "ip=%s\n";
| /* str.ip_s_n */
0x0040d4c8 addiu a1, a1, -0x7864 |
0x0040d4cc move a2, v0 | a2 = v0;
0x0040d4d0 addiu a0, zero, 3 | a0 = 3;
0x0040d4d4 sb zero, 0x38a(s1) | *((s1 + 906)) = 0;
0x0040d4d8 jalr t9 | t9 ();
0x0040d4dc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d4e0 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d4e4 move a0, s0 | a0 = s0;
0x0040d4e8 jalr t9 | t9 ();
0x0040d4ec move a0, s4 | a0 = s4;
0x0040d4f0 jal 0x40abb0 | fcn_0040abb0 ();
0x0040d4f4 move v0, zero | v0 = 0;
| label_3:
0x0040d4f8 lw ra, 0x34(sp) | ra = *(var_34h);
0x0040d4fc lw s4, 0x30(sp) | s4 = *(var_30h);
0x0040d500 lw s3, 0x2c(sp) | s3 = *(var_2ch);
0x0040d504 lw s2, 0x28(sp) | s2 = *(var_28h);
0x0040d508 lw s1, 0x24(sp) | s1 = *(var_24h);
0x0040d50c lw s0, 0x20(sp) | s0 = *(var_20h);
0x0040d510 addiu sp, sp, 0x38 |
0x0040d514 jr ra | return v0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/6225984-11075644.jffs2_new_extract/etc/miio_client/miio_client @ 0x40d518 */
| #include <stdint.h>
|
; (fcn) sym.cmd_internal_get_info () | void cmd_internal_get_info () {
0x0040d518 lui gp, 0x43 |
0x0040d51c addiu sp, sp, -0x228 |
0x0040d520 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040d524 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040d528 sw s1, 0x21c(sp) | *(var_21ch) = s1;
0x0040d52c addiu s1, sp, 0x18 | s1 = sp + 0x18;
0x0040d530 sw ra, 0x224(sp) | *(var_224h) = ra;
0x0040d534 sw s2, 0x220(sp) | *(var_220h) = s2;
0x0040d538 sw s0, 0x218(sp) | *(var_218h) = s0;
0x0040d53c sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d540 move a0, s1 | a0 = s1;
0x0040d544 move a1, zero | a1 = 0;
0x0040d548 addiu a2, zero, 0x200 | a2 = 0x200;
0x0040d54c jalr t9 | t9 ();
0x0040d550 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d554 lui a1, 0x42 | a1 = 0x420000;
0x0040d558 lw t9, -0x7cd4(gp) | t9 = sym.imp.strcpy
0x0040d55c move a0, s1 | a0 = s1;
| /* str._method_:__internal.info_ */
0x0040d560 addiu a1, a1, -0x785c | a1 += -0x785c;
0x0040d564 jalr t9 | t9 ();
0x0040d568 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d56c lw s0, -0x7f28(gp) | s0 = *(gp);
0x0040d570 lw s2, 0x2d4(s0) | s2 = *((s0 + 181));
0x0040d574 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
| if (s2 > 0) {
0x0040d578 blez s2, 0x40d5b8 |
0x0040d57c move a0, s1 | a0 = s1;
0x0040d580 jalr t9 | t9 ();
0x0040d584 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d588 move a0, s2 | a0 = s2;
0x0040d58c lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x0040d590 move a1, s1 | a1 = s1;
0x0040d594 move a2, v0 | a2 = v0;
0x0040d598 jalr t9 | t9 ();
0x0040d59c lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 >= 0) {
0x0040d5a0 bgez v0, 0x40d5b8 | goto label_0;
| }
0x0040d5a4 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x0040d5a8 lw a1, 0x2d4(s0) | a1 = *((s0 + 181));
0x0040d5ac move a0, s0 | a0 = s0;
0x0040d5b0 jalr t9 | t9 ();
0x0040d5b4 sw zero, 0x2d4(s0) | *((s0 + 181)) = 0;
| }
| label_0:
0x0040d5b8 lw ra, 0x224(sp) | ra = *(var_224h);
0x0040d5bc lw s2, 0x220(sp) | s2 = *(var_220h);
0x0040d5c0 lw s1, 0x21c(sp) | s1 = *(var_21ch);
0x0040d5c4 lw s0, 0x218(sp) | s0 = *(var_218h);
0x0040d5c8 move v0, zero | v0 = 0;
0x0040d5cc addiu sp, sp, 0x228 |
0x0040d5d0 jr ra | return v0;
| }
[*] Function strcpy used 3 times miio_client