[*] Binary protection state of miio_client
No RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf 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 @ 0x4044ec */
| #include <stdint.h>
|
; (fcn) fcn.004044ec () | void fcn_004044ec () {
0x004044ec lui gp, 0x43 |
0x004044f0 addiu sp, sp, -0x1038 |
0x004044f4 addiu gp, gp, 0x1620 | gp += 0x1620;
0x004044f8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004044fc sw s1, 0x1028(sp) | *(var_1028h) = s1;
0x00404500 lui a1, 0x41 | a1 = 0x410000;
0x00404504 lui s1, 0x41 | s1 = 0x410000;
0x00404508 sw s0, 0x1024(sp) | *(var_1024h) = s0;
0x0040450c sw gp, 0x18(sp) | *(var_18h) = gp;
0x00404510 sw ra, 0x1034(sp) | *(var_1034h) = ra;
0x00404514 sw s3, 0x1030(sp) | *(var_1030h) = s3;
0x00404518 sw s2, 0x102c(sp) | *(var_102ch) = s2;
0x0040451c move s0, a0 | s0 = a0;
| /* esilref: '&s
' */
0x00404520 addiu a1, a1, 0x6510 | a1 += 0x6510;
0x00404524 addiu a0, zero, 3 | a0 = 3;
| /* str.cmd_internal_request_dinfo */
0x00404528 addiu a2, s1, 0x7e20 | a2 = s1 + 0x7e20;
0x0040452c jalr t9 | t9 ();
0x00404530 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s0 == 0) {
0x00404534 bnez s0, 0x404558 |
0x00404538 lui a1, 0x41 | a1 = 0x410000;
0x0040453c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404540 addiu a0, zero, 3 | a0 = 3;
| /* str._s:_dir_null_n */
0x00404544 addiu a1, a1, 0x5038 | a1 += 0x5038;
| /* str.cmd_internal_request_dinfo */
0x00404548 addiu a2, s1, 0x7e20 | a2 = s1 + 0x7e20;
0x0040454c jalr t9 | t9 ();
0x00404550 j 0x404654 | goto label_0;
0x00404554 addiu s1, zero, -1 | s1 = -1;
| }
0x00404558 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040455c move a0, s0 | a0 = s0;
0x00404560 jalr t9 | t9 ();
0x00404564 addiu v0, v0, 0x32 | v0 += 0x32;
0x00404568 sltiu v0, v0, 0xfff | v0 = (v0 < 0xfff) ? 1 : 0;
0x0040456c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00404570 bnez v0, 0x404598 |
0x00404574 lui a1, 0x41 | a1 = 0x410000;
0x00404578 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040457c addiu a0, zero, 3 | a0 = 3;
| /* str._s:_dir_too_long:__s_n */
0x00404580 addiu a1, a1, 0x5048 | a1 += 0x5048;
| /* str.cmd_internal_request_dinfo */
0x00404584 addiu a2, s1, 0x7e20 | a2 = s1 + 0x7e20;
0x00404588 move a3, s0 | a3 = s0;
0x0040458c jalr t9 | t9 ();
0x00404590 j 0x404654 | goto label_0;
0x00404594 addiu s1, zero, -1 | s1 = -1;
| }
0x00404598 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040459c addiu s2, sp, 0x20 | s2 = sp + 0x20;
0x004045a0 move a2, s0 | a2 = s0;
0x004045a4 lui a1, 0x41 | a1 = 0x410000;
0x004045a8 lui s0, 0x43 | s0 = 0x430000;
0x004045ac move a0, s2 | a0 = s2;
| /* str._method_:__internal.request_dinfo___params_:__s_ */
0x004045b0 addiu a1, a1, 0x5060 | a1 += 0x5060;
| /* obj.miio */
0x004045b4 addiu s0, s0, -0x6dd0 | s0 += -0x6dd0;
0x004045b8 jalr t9 | t9 ();
0x004045bc lw s3, 0x2d4(s0) | s3 = *((s0 + 181));
0x004045c0 addu v0, s2, v0 | v0 = s2 + v0;
0x004045c4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004045c8 sb zero, (v0) | *(v0) = 0;
| if (s3 > 0) {
0x004045cc blez s3, 0x404618 |
0x004045d0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004045d4 move a0, s2 | a0 = s2;
0x004045d8 jalr t9 | t9 ();
0x004045dc lw gp, 0x18(sp) | gp = *(var_18h);
0x004045e0 move a0, s3 | a0 = s3;
0x004045e4 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x004045e8 move a1, s2 | a1 = s2;
0x004045ec move a2, v0 | a2 = v0;
0x004045f0 jalr t9 | t9 ();
0x004045f4 move s1, v0 | s1 = v0;
0x004045f8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x004045fc bgez v0, 0x404654 | goto label_0;
| }
0x00404600 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x00404604 lw a1, 0x2d4(s0) | a1 = *((s0 + 181));
0x00404608 move a0, s0 | a0 = s0;
0x0040460c jalr t9 | t9 ();
0x00404610 j 0x404654 | goto label_0;
0x00404614 sw zero, 0x2d4(s0) | *((s0 + 181)) = 0;
| }
0x00404618 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040461c lui a1, 0x41 | a1 = 0x410000;
0x00404620 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_d__ot_agent_internalfd:__d_n */
0x00404624 addiu a1, a1, 0x5094 | a1 += 0x5094;
0x00404628 sw s3, 0x10(sp) | *(var_10h) = s3;
| /* str.cmd_internal_request_dinfo */
0x0040462c addiu a2, s1, 0x7e20 | a2 = s1 + 0x7e20;
0x00404630 addiu a3, zero, 0x464 | a3 = 0x464;
0x00404634 jalr t9 | t9 ();
0x00404638 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040463c lui a1, 0x41 | a1 = 0x410000;
0x00404640 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404644 addiu a0, zero, 1 | a0 = 1;
| /* str.No_helper_script__n */
0x00404648 addiu a1, a1, 0x50b4 | a1 += 0x50b4;
0x0040464c jalr t9 | t9 ();
0x00404650 addiu s1, zero, -1 | s1 = -1;
| label_0:
0x00404654 lw ra, 0x1034(sp) | ra = *(var_1034h);
0x00404658 move v0, s1 | v0 = s1;
0x0040465c lw s3, 0x1030(sp) | s3 = *(var_1030h);
0x00404660 lw s2, 0x102c(sp) | s2 = *(var_102ch);
0x00404664 lw s1, 0x1028(sp) | s1 = *(var_1028h);
0x00404668 lw s0, 0x1024(sp) | s0 = *(var_1024h);
0x0040466c addiu sp, sp, 0x1038 |
0x00404670 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 @ 0x404674 */
| #include <stdint.h>
|
; (fcn) fcn.00404674 () | void fcn_00404674 () {
0x00404674 addiu sp, sp, -0x28 |
0x00404678 sw s0, 0x20(sp) | *(var_20h) = s0;
0x0040467c lui s0, 0x43 | s0 = miio;
| /* obj.miio */
0x00404680 addiu s0, s0, -0x6dd0 |
0x00404684 lw v0, 0x200(s0) | v0 = *((s0 + 128));
0x00404688 lui gp, 0x43 |
0x0040468c addiu gp, gp, 0x1620 |
0x00404690 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00404694 lw v0, 0x204(s0) | v0 = *((s0 + 129));
0x00404698 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040469c lui a1, 0x41 | a1 = 0x410000;
0x004046a0 lui a2, 0x41 | a2 = 0x410000;
0x004046a4 sw ra, 0x24(sp) | *(var_24h) = ra;
0x004046a8 sw gp, 0x18(sp) | *(var_18h) = gp;
0x004046ac sw v0, 0x14(sp) | *(var_14h) = v0;
| /* str._s:_d__didkeyreq_timestamp:__d__didkeyreq_interval:__d._n */
0x004046b0 addiu a1, a1, 0x50c8 | a1 += 0x50c8;
| /* str.check_device_info */
0x004046b4 addiu a2, a2, 0x7e3c | a2 += 0x7e3c;
0x004046b8 addiu a3, zero, 0x4f4 | a3 = 0x4f4;
0x004046bc addiu a0, zero, 3 | a0 = 3;
0x004046c0 jalr t9 | t9 ();
0x004046c4 lw a0, 0x268(s0) | a0 = *((s0 + 154));
0x004046c8 jal 0x4044ec | fcn_004044ec ();
0x004046cc lw ra, 0x24(sp) | ra = *(var_24h);
0x004046d0 lw s0, 0x20(sp) | s0 = *(var_20h);
0x004046d4 move v0, zero | v0 = 0;
0x004046d8 addiu sp, sp, 0x28 |
0x004046dc 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 @ 0x4046e0 */
| #include <stdint.h>
|
; (fcn) fcn.004046e0 () | void fcn_004046e0 () {
0x004046e0 addiu sp, sp, -0x1028 |
0x004046e4 sw s0, 0x1018(sp) | *(var_1018h) = s0;
0x004046e8 lui s0, 0x43 | s0 = 0x430000;
0x004046ec lui gp, 0x43 |
| /* obj.miio */
0x004046f0 addiu s0, s0, -0x6dd0 | s0 += -0x6dd0;
0x004046f4 addiu gp, gp, 0x1620 | gp += 0x1620;
0x004046f8 sw s2, 0x1020(sp) | *(var_1020h) = s2;
0x004046fc lw s2, 0x268(s0) | s2 = *((s0 + 154));
0x00404700 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404704 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00404708 sw ra, 0x1024(sp) | *(var_1024h) = ra;
0x0040470c sw s1, 0x101c(sp) | *(var_101ch) = s1;
0x00404710 move a0, s2 | a0 = s2;
0x00404714 jalr t9 | t9 ();
0x00404718 addiu v0, v0, 0x32 | v0 += 0x32;
0x0040471c sltiu v0, v0, 0xfff | v0 = (v0 < 0xfff) ? 1 : 0;
0x00404720 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00404724 bnez v0, 0x404750 |
0x00404728 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040472c lui a1, 0x41 | a1 = 0x410000;
0x00404730 lui a2, 0x41 | a2 = 0x410000;
0x00404734 addiu a0, zero, 3 | a0 = 3;
| /* str._s:_dir_too_long:__s_n */
0x00404738 addiu a1, a1, 0x5048 | a1 += 0x5048;
| /* str.cmd_internal_request_didkeymac */
0x0040473c addiu a2, a2, 0x7dec | a2 += 0x7dec;
0x00404740 move a3, s2 | a3 = s2;
0x00404744 jalr t9 | t9 ();
0x00404748 j 0x4047c4 | goto label_0;
0x0040474c lw ra, 0x1024(sp) | ra = *(var_1024h);
| }
0x00404750 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x00404754 addiu s1, sp, 0x18 | s1 = sp + 0x18;
0x00404758 lui a1, 0x41 | a1 = 0x410000;
0x0040475c move a2, s2 | a2 = s2;
0x00404760 move a0, s1 | a0 = s1;
| /* str._method_:__internal.req_didkeymac___params_:__s_ */
0x00404764 addiu a1, a1, 0x5104 | a1 += 0x5104;
0x00404768 jalr t9 | t9 ();
0x0040476c lw s2, 0x2d4(s0) | s2 = *((s0 + 181));
0x00404770 addu v0, s1, v0 | v0 = s1 + v0;
0x00404774 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404778 sb zero, (v0) | *(v0) = 0;
| if (s2 > 0) {
0x0040477c blez s2, 0x4047c0 |
0x00404780 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404784 move a0, s1 | a0 = s1;
0x00404788 jalr t9 | t9 ();
0x0040478c lw gp, 0x10(sp) | gp = *(var_10h);
0x00404790 move a0, s2 | a0 = s2;
0x00404794 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x00404798 move a1, s1 | a1 = s1;
0x0040479c move a2, v0 | a2 = v0;
0x004047a0 jalr t9 | t9 ();
0x004047a4 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 >= 0) {
0x004047a8 bgez v0, 0x4047c0 | goto label_1;
| }
0x004047ac lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x004047b0 lw a1, 0x2d4(s0) | a1 = *((s0 + 181));
0x004047b4 move a0, s0 | a0 = s0;
0x004047b8 jalr t9 | t9 ();
0x004047bc sw zero, 0x2d4(s0) | *((s0 + 181)) = 0;
| }
| label_1:
0x004047c0 lw ra, 0x1024(sp) | ra = *(var_1024h);
| label_0:
0x004047c4 lw s2, 0x1020(sp) | s2 = *(var_1020h);
0x004047c8 lw s1, 0x101c(sp) | s1 = *(var_101ch);
0x004047cc lw s0, 0x1018(sp) | s0 = *(var_1018h);
0x004047d0 addiu sp, sp, 0x1028 |
0x004047d4 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 @ 0x4047d8 */
| #include <stdint.h>
|
; (fcn) fcn.004047d8 () | void fcn_004047d8 () {
0x004047d8 lui v0, 0x43 | v0 = 0x430000;
0x004047dc lui gp, 0x43 |
0x004047e0 lw v0, -0x6afc(v0) | v0 = *((v0 - 6847));
0x004047e4 addiu sp, sp, -0x28 |
0x004047e8 addiu gp, gp, 0x1620 | gp += 0x1620;
0x004047ec sw ra, 0x24(sp) | *(var_24h) = ra;
0x004047f0 sw gp, 0x18(sp) | *(var_18h) = gp;
| if (v0 <= 0) {
0x004047f4 bgtz v0, 0x40483c |
0x004047f8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004047fc lui a1, 0x41 | a1 = 0x410000;
0x00404800 lui a2, 0x41 | a2 = 0x410000;
0x00404804 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00404808 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_d__ot_agent_internalfd:__d_n */
0x0040480c addiu a1, a1, 0x5094 | a1 += 0x5094;
| /* str.request_didkeymac */
0x00404810 addiu a2, a2, 0x7e0c | a2 += 0x7e0c;
0x00404814 addiu a3, zero, 0x3af | a3 = 0x3af;
0x00404818 jalr t9 | t9 ();
0x0040481c lw gp, 0x18(sp) | gp = *(var_18h);
0x00404820 lui a1, 0x41 | a1 = 0x410000;
0x00404824 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404828 addiu a0, zero, 1 | a0 = 1;
| /* str.Please_start_helper_script._n */
0x0040482c addiu a1, a1, 0x5138 | a1 += 0x5138;
0x00404830 jalr t9 | t9 ();
0x00404834 j 0x404848 | goto label_0;
0x00404838 addiu v0, zero, -1 | v0 = -1;
| }
0x0040483c jal 0x4046e0 | fcn_004046e0 ();
0x00404840 nop |
0x00404844 move v0, zero | v0 = 0;
| label_0:
0x00404848 lw ra, 0x24(sp) | ra = *(var_24h);
0x0040484c addiu sp, sp, 0x28 |
0x00404850 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 @ 0x404854 */
| #include <stdint.h>
|
; (fcn) fcn.00404854 () | void fcn_00404854 () {
0x00404854 addiu sp, sp, -0x1028 |
0x00404858 sw s0, 0x1018(sp) | *(var_1018h) = s0;
0x0040485c lui s0, 0x43 | s0 = 0x430000;
0x00404860 lui gp, 0x43 |
| /* obj.miio */
0x00404864 addiu s0, s0, -0x6dd0 | s0 += -0x6dd0;
0x00404868 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040486c sw s2, 0x1020(sp) | *(var_1020h) = s2;
0x00404870 lw s2, 0x268(s0) | s2 = *((s0 + 154));
0x00404874 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404878 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040487c sw ra, 0x1024(sp) | *(var_1024h) = ra;
0x00404880 sw s1, 0x101c(sp) | *(var_101ch) = s1;
0x00404884 move a0, s2 | a0 = s2;
0x00404888 jalr t9 | t9 ();
0x0040488c addiu v0, v0, 0x33 | v0 += 0x33;
0x00404890 sltiu v0, v0, 0xfff | v0 = (v0 < 0xfff) ? 1 : 0;
0x00404894 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00404898 bnez v0, 0x4048c4 |
0x0040489c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004048a0 lui a1, 0x41 | a1 = 0x410000;
0x004048a4 lui a2, 0x41 | a2 = 0x410000;
0x004048a8 addiu a0, zero, 3 | a0 = 3;
| /* str._s:_dir_too_long:__s_n */
0x004048ac addiu a1, a1, 0x5048 | a1 += 0x5048;
| /* str.cmd_internal_request_didkeymac2 */
0x004048b0 addiu a2, a2, 0x7db8 | a2 += 0x7db8;
0x004048b4 move a3, s2 | a3 = s2;
0x004048b8 jalr t9 | t9 ();
0x004048bc j 0x404938 | goto label_0;
0x004048c0 lw ra, 0x1024(sp) | ra = *(var_1024h);
| }
0x004048c4 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x004048c8 addiu s1, sp, 0x18 | s1 = sp + 0x18;
0x004048cc lui a1, 0x41 | a1 = 0x410000;
0x004048d0 move a2, s2 | a2 = s2;
0x004048d4 move a0, s1 | a0 = s1;
| /* str._method_:__internal.req_didkeymac2___params_:__s_ */
0x004048d8 addiu a1, a1, 0x5158 | a1 += 0x5158;
0x004048dc jalr t9 | t9 ();
0x004048e0 lw s2, 0x2d4(s0) | s2 = *((s0 + 181));
0x004048e4 addu v0, s1, v0 | v0 = s1 + v0;
0x004048e8 lw gp, 0x10(sp) | gp = *(var_10h);
0x004048ec sb zero, (v0) | *(v0) = 0;
| if (s2 > 0) {
0x004048f0 blez s2, 0x404934 |
0x004048f4 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004048f8 move a0, s1 | a0 = s1;
0x004048fc jalr t9 | t9 ();
0x00404900 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404904 move a0, s2 | a0 = s2;
0x00404908 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x0040490c move a1, s1 | a1 = s1;
0x00404910 move a2, v0 | a2 = v0;
0x00404914 jalr t9 | t9 ();
0x00404918 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 >= 0) {
0x0040491c bgez v0, 0x404934 | goto label_1;
| }
0x00404920 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x00404924 lw a1, 0x2d4(s0) | a1 = *((s0 + 181));
0x00404928 move a0, s0 | a0 = s0;
0x0040492c jalr t9 | t9 ();
0x00404930 sw zero, 0x2d4(s0) | *((s0 + 181)) = 0;
| }
| label_1:
0x00404934 lw ra, 0x1024(sp) | ra = *(var_1024h);
| label_0:
0x00404938 lw s2, 0x1020(sp) | s2 = *(var_1020h);
0x0040493c lw s1, 0x101c(sp) | s1 = *(var_101ch);
0x00404940 lw s0, 0x1018(sp) | s0 = *(var_1018h);
0x00404944 addiu sp, sp, 0x1028 |
0x00404948 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 @ 0x40494c */
| #include <stdint.h>
|
; (fcn) fcn.0040494c () | void fcn_0040494c () {
0x0040494c lui v0, 0x43 | v0 = 0x430000;
0x00404950 lui gp, 0x43 |
0x00404954 lw v0, -0x6afc(v0) | v0 = *((v0 - 6847));
0x00404958 addiu sp, sp, -0x28 |
0x0040495c addiu gp, gp, 0x1620 | gp += 0x1620;
0x00404960 sw ra, 0x24(sp) | *(var_24h) = ra;
0x00404964 sw gp, 0x18(sp) | *(var_18h) = gp;
| if (v0 <= 0) {
0x00404968 bgtz v0, 0x4049b0 |
0x0040496c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404970 lui a1, 0x41 | a1 = 0x410000;
0x00404974 lui a2, 0x41 | a2 = 0x410000;
0x00404978 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040497c addiu a0, zero, 1 | a0 = 1;
| /* str._s:_d__ot_agent_internalfd:__d_n */
0x00404980 addiu a1, a1, 0x5094 | a1 += 0x5094;
| /* str.request_didkeymac2 */
0x00404984 addiu a2, a2, 0x7dd8 | a2 += 0x7dd8;
0x00404988 addiu a3, zero, 0x3bc | a3 = 0x3bc;
0x0040498c jalr t9 | t9 ();
0x00404990 lw gp, 0x18(sp) | gp = *(var_18h);
0x00404994 lui a1, 0x41 | a1 = 0x410000;
0x00404998 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040499c addiu a0, zero, 1 | a0 = 1;
| /* str.Please_start_helper_script._n */
0x004049a0 addiu a1, a1, 0x5138 | a1 += 0x5138;
0x004049a4 jalr t9 | t9 ();
0x004049a8 j 0x4049bc | goto label_0;
0x004049ac addiu v0, zero, -1 | v0 = -1;
| }
0x004049b0 jal 0x404854 | fcn_00404854 ();
0x004049b4 nop |
0x004049b8 move v0, zero | v0 = 0;
| label_0:
0x004049bc lw ra, 0x24(sp) | ra = *(var_24h);
0x004049c0 addiu sp, sp, 0x28 |
0x004049c4 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 @ 0x4049c8 */
| #include <stdint.h>
|
; (fcn) fcn.004049c8 () | void fcn_004049c8 () {
0x004049c8 lui gp, 0x43 |
0x004049cc addiu sp, sp, -0x1048 |
0x004049d0 addiu gp, gp, 0x1620 | gp += 0x1620;
0x004049d4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004049d8 sw s1, 0x1038(sp) | *(var_1038h) = s1;
0x004049dc lui a1, 0x41 | a1 = 0x410000;
0x004049e0 lui s1, 0x41 | s1 = 0x410000;
0x004049e4 sw s2, 0x103c(sp) | *(var_103ch) = s2;
0x004049e8 sw gp, 0x10(sp) | *(var_10h) = gp;
0x004049ec sw ra, 0x1044(sp) | *(var_1044h) = ra;
0x004049f0 sw s3, 0x1040(sp) | *(var_1040h) = s3;
0x004049f4 sw s0, 0x1034(sp) | *(var_1034h) = s0;
0x004049f8 move s2, a0 | s2 = a0;
| /* esilref: '&s
' */
0x004049fc addiu a1, a1, 0x6510 | a1 += 0x6510;
0x00404a00 addiu a0, zero, 3 | a0 = 3;
| /* str.cmd_internal_request_dtoken */
0x00404a04 addiu a2, s1, 0x7d9c | a2 = s1 + 0x7d9c;
0x00404a08 jalr t9 | t9 ();
0x00404a0c lw gp, 0x10(sp) | gp = *(var_10h);
| if (s2 == 0) {
0x00404a10 bnez s2, 0x404a34 |
0x00404a14 lui a1, 0x41 | a1 = 0x410000;
0x00404a18 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404a1c addiu a0, zero, 3 | a0 = 3;
| /* str._s:_dir_null_n */
0x00404a20 addiu a1, a1, 0x5038 | a1 += 0x5038;
| /* str.cmd_internal_request_dtoken */
0x00404a24 addiu a2, s1, 0x7d9c | a2 = s1 + 0x7d9c;
0x00404a28 jalr t9 | t9 ();
0x00404a2c j 0x404b44 | goto label_0;
0x00404a30 addiu s1, zero, -1 | s1 = -1;
| }
0x00404a34 lw t9, -0x7fbc(gp) | t9 = sym.rand_str;
0x00404a38 addiu s3, sp, 0x1018 | s3 = sp + 0x1018;
0x00404a3c addiu a1, zero, 0x10 | a1 = 0x10;
0x00404a40 move a0, s3 | a0 = s3;
0x00404a44 jalr t9 | t9 ();
0x00404a48 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404a4c move a0, s2 | a0 = s2;
0x00404a50 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404a54 sb zero, 0x1028(sp) | *(var_1028h) = 0;
0x00404a58 jalr t9 | t9 ();
0x00404a5c lw gp, 0x10(sp) | gp = *(var_10h);
0x00404a60 move a0, s3 | a0 = s3;
0x00404a64 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404a68 move s0, v0 | s0 = v0;
0x00404a6c jalr t9 | t9 ();
0x00404a70 addu v0, s0, v0 | v0 = s0 + v0;
0x00404a74 addiu v0, v0, 0x48 | v0 += 0x48;
0x00404a78 sltiu v0, v0, 0xfff | v0 = (v0 < 0xfff) ? 1 : 0;
0x00404a7c lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00404a80 bnez v0, 0x404aa8 |
0x00404a84 lui a1, 0x41 | a1 = 0x410000;
0x00404a88 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404a8c addiu a0, zero, 3 | a0 = 3;
| /* str._s:_dir__token_too_long:__s_n */
0x00404a90 addiu a1, a1, 0x518c | a1 += 0x518c;
| /* str.cmd_internal_request_dtoken */
0x00404a94 addiu a2, s1, 0x7d9c | a2 = s1 + 0x7d9c;
0x00404a98 move a3, s2 | a3 = s2;
0x00404a9c jalr t9 | t9 ();
0x00404aa0 j 0x404b44 | goto label_0;
0x00404aa4 addiu s1, zero, -1 | s1 = -1;
| }
0x00404aa8 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x00404aac addiu s1, sp, 0x18 | s1 = sp + 0x18;
0x00404ab0 lui a1, 0x41 | a1 = 0x410000;
0x00404ab4 lui s0, 0x43 | s0 = 0x430000;
0x00404ab8 move a2, s2 | a2 = s2;
0x00404abc move a0, s1 | a0 = s1;
| /* str._method_:__internal.request_dtoken___params_:_dir_:__s___ntoken_:__s_ */
0x00404ac0 addiu a1, a1, 0x51ac | a1 += 0x51ac;
0x00404ac4 move a3, s3 | a3 = s3;
| /* obj.miio */
0x00404ac8 addiu s0, s0, -0x6dd0 | s0 += -0x6dd0;
0x00404acc jalr t9 | t9 ();
0x00404ad0 lw s2, 0x2d4(s0) | s2 = *((s0 + 181));
0x00404ad4 addu v0, s1, v0 | v0 = s1 + v0;
0x00404ad8 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404adc sb zero, (v0) | *(v0) = 0;
| if (s2 > 0) {
0x00404ae0 blez s2, 0x404b2c |
0x00404ae4 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404ae8 move a0, s1 | a0 = s1;
0x00404aec jalr t9 | t9 ();
0x00404af0 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404af4 move a1, s1 | a1 = s1;
0x00404af8 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x00404afc move a0, s2 | a0 = s2;
0x00404b00 move a2, v0 | a2 = v0;
0x00404b04 jalr t9 | t9 ();
0x00404b08 move s1, v0 | s1 = v0;
0x00404b0c lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 >= 0) {
0x00404b10 bgez v0, 0x404b44 | goto label_0;
| }
0x00404b14 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x00404b18 lw a1, 0x2d4(s0) | a1 = *((s0 + 181));
0x00404b1c move a0, s0 | a0 = s0;
0x00404b20 jalr t9 | t9 ();
0x00404b24 j 0x404b44 | goto label_0;
0x00404b28 sw zero, 0x2d4(s0) | *((s0 + 181)) = 0;
| }
0x00404b2c lui a1, 0x41 | a1 = 0x410000;
0x00404b30 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404b34 addiu a0, zero, 1 | a0 = 1;
| /* str.No_helper_script__n */
0x00404b38 addiu a1, a1, 0x50b4 | a1 += 0x50b4;
0x00404b3c jalr t9 | t9 ();
0x00404b40 addiu s1, zero, -1 | s1 = -1;
| label_0:
0x00404b44 lw ra, 0x1044(sp) | ra = *(var_1044h);
0x00404b48 move v0, s1 | v0 = s1;
0x00404b4c lw s3, 0x1040(sp) | s3 = *(var_1040h);
0x00404b50 lw s2, 0x103c(sp) | s2 = *(var_103ch);
0x00404b54 lw s1, 0x1038(sp) | s1 = *(var_1038h);
0x00404b58 lw s0, 0x1034(sp) | s0 = *(var_1034h);
0x00404b5c addiu sp, sp, 0x1048 |
0x00404b60 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 @ 0x404b64 */
| #include <stdint.h>
|
; (fcn) fcn.00404b64 () | void fcn_00404b64 () {
0x00404b64 lui v0, 0x43 | v0 = 0x430000;
0x00404b68 addiu sp, sp, -0x430 |
0x00404b6c lui gp, 0x43 |
0x00404b70 lw a3, -0x6dd0(v0) | a3 = *((v0 - 7028));
0x00404b74 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00404b78 sw s2, 0x428(sp) | *(var_428h) = s2;
0x00404b7c move s2, a0 | s2 = a0;
0x00404b80 addiu a0, zero, 8 | a0 = 8;
0x00404b84 sw s1, 0x424(sp) | *(var_424h) = s1;
0x00404b88 sw ra, 0x42c(sp) | *(var_42ch) = ra;
0x00404b8c sw s0, 0x420(sp) | *(var_420h) = s0;
0x00404b90 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00404b94 move s1, a2 | s1 = a2;
| if (a3 != a0) {
0x00404b98 beq a3, a0, 0x404bb4 |
0x00404b9c lui a1, 0x41 | a1 = 0x410000;
0x00404ba0 lui a2, 0x41 | a2 = 0x410000;
0x00404ba4 addiu a0, zero, 3 | a0 = 3;
| /* str._s____miio_state_not_CLOUD_CONNECTED:__d_n */
0x00404ba8 addiu a1, a1, 0x51f8 | a1 += 0x51f8;
0x00404bac j 0x404bd8 | goto label_0;
| /* str.handle_local_msg_suspend */
0x00404bb0 addiu a2, a2, 0x7b64 | a2 += 0x7b64;
| }
0x00404bb4 slti a0, a1, 2 | a0 = (a1 < 2) ? 1 : 0;
0x00404bb8 move v1, a1 | v1 = a1;
| if (a0 != 0) {
0x00404bbc bnez a0, 0x404bf0 | goto label_1;
| }
0x00404bc0 lui a1, 0x41 | a1 = 0x410000;
0x00404bc4 lui a2, 0x41 | a2 = 0x410000;
0x00404bc8 addiu a0, zero, 3 | a0 = 3;
| /* str._s____poll:__d_n */
0x00404bcc addiu a1, a1, 0x5224 | a1 += 0x5224;
| /* str.handle_local_msg_suspend */
0x00404bd0 addiu a2, a2, 0x7b64 | a2 += 0x7b64;
0x00404bd4 move a3, v1 | a3 = v1;
| label_0:
0x00404bd8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404bdc jalr t9 | t9 ();
0x00404be0 nop |
0x00404be4 lw gp, 0x10(sp) | gp = *(var_10h);
| do {
0x00404be8 j 0x404c54 | goto label_2;
0x00404bec move s0, zero | s0 = 0;
| /* obj.miio */
| label_1:
0x00404bf0 addiu v0, v0, -0x6dd0 | v0 += -0x6dd0;
0x00404bf4 lw v1, 0x3ac(v0) | v1 = *((v0 + 235));
0x00404bf8 lui a1, 0x41 | a1 = 0x410000;
| if (v1 != 0) {
0x00404bfc beqz v1, 0x404c0c |
0x00404c00 addiu a0, zero, 3 | a0 = 3;
0x00404c04 j 0x404c20 | goto label_3;
| /* str._s____miio.data_queue_not_NULL_n */
0x00404c08 addiu a1, a1, 0x5234 | a1 += 0x5234;
| }
0x00404c0c lw v1, 0x3b0(v0) | v1 = *((v0 + 236));
0x00404c10 lui a1, 0x41 | a1 = 0x410000;
| if (v1 == 0) {
0x00404c14 beqz v1, 0x404c34 | goto label_4;
| }
0x00404c18 addiu a0, zero, 3 | a0 = 3;
| /* str._s____miio.data_queue_noack_not_NULL_n */
0x00404c1c addiu a1, a1, 0x5254 | a1 += 0x5254;
| label_3:
0x00404c20 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404c24 jalr t9 | t9 ();
0x00404c28 nop |
0x00404c2c j 0x404be8 |
| } while (1);
0x00404c30 lw gp, 0x10(sp) | gp = *(var_10h);
| label_4:
0x00404c34 lw t9, -0x7d9c(gp) | t9 = sym.imp.timerfd_gettime;
0x00404c38 lw a0, 0x1f0(v0) | a0 = *((v0 + 124));
0x00404c3c addiu a1, sp, 0x18 | a1 = sp + 0x18;
0x00404c40 jalr t9 | t9 ();
0x00404c44 lw s0, 0x20(sp) | s0 = *(var_20h);
0x00404c48 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404c4c slti v0, s0, 2 | v0 = (s0 < 2) ? 1 : 0;
| if (v0 == 0) {
0x00404c50 movn s0, zero, v0 | s0 = 0;
| }
| label_2:
0x00404c54 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x00404c58 lui a1, 0x41 | a1 = 0x410000;
0x00404c5c move a0, s1 | a0 = s1;
| /* esilref: 'id' */
0x00404c60 addiu a1, a1, 0x527c | a1 += 0x527c;
0x00404c64 addiu a2, sp, 0x418 | a2 = sp + 0x418;
0x00404c68 jalr t9 | t9 ();
0x00404c6c lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x00404c70 bgez v0, 0x404c9c |
0x00404c74 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404c78 lui a1, 0x41 | a1 = 0x410000;
0x00404c7c lui a2, 0x41 | a2 = 0x410000;
0x00404c80 addiu a0, zero, 3 | a0 = 3;
| /* str._s____msg_does_not_have_id:__s_n */
0x00404c84 addiu a1, a1, 0x5280 | a1 += 0x5280;
| /* str.handle_local_msg_suspend */
0x00404c88 addiu a2, a2, 0x7b64 | a2 += 0x7b64;
0x00404c8c move a3, s1 | a3 = s1;
0x00404c90 jalr t9 | t9 ();
0x00404c94 j 0x404d00 | goto label_5;
0x00404c98 addiu v0, zero, -1 | v0 = -1;
| }
0x00404c9c addiu s1, sp, 0x18 | s1 = sp + 0x18;
0x00404ca0 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00404ca4 move a0, s1 | a0 = s1;
0x00404ca8 move a1, zero | a1 = 0;
0x00404cac addiu a2, zero, 0x400 | a2 = 0x400;
0x00404cb0 jalr t9 | t9 ();
0x00404cb4 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404cb8 lw a2, 0x418(sp) | a2 = *(var_418h);
0x00404cbc lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x00404cc0 lui a1, 0x41 | a1 = "{\"id\":%d,\"method\":\"local.resp_suspend\",\"params\":{\"wakeup_time\":%d}}";
| /* str._id_:_d__method_:_local.resp_suspend___params_:_wakeup_time_:_d */
0x00404cc4 addiu a1, a1, 0x52a4 |
0x00404cc8 move a3, s0 | a3 = s0;
0x00404ccc move a0, s1 | a0 = s1;
0x00404cd0 jalr t9 | t9 ();
0x00404cd4 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404cd8 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404cdc move a0, s1 | a0 = s1;
0x00404ce0 jalr t9 | t9 ();
0x00404ce4 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404ce8 move a0, s2 | a0 = s2;
0x00404cec lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x00404cf0 move a1, s1 | a1 = s1;
0x00404cf4 move a2, v0 | a2 = v0;
0x00404cf8 jalr t9 | t9 ();
0x00404cfc move v0, zero | v0 = 0;
| label_5:
0x00404d00 lw ra, 0x42c(sp) | ra = *(var_42ch);
0x00404d04 lw s2, 0x428(sp) | s2 = *(var_428h);
0x00404d08 lw s1, 0x424(sp) | s1 = *(var_424h);
0x00404d0c lw s0, 0x420(sp) | s0 = *(var_420h);
0x00404d10 addiu sp, sp, 0x430 |
0x00404d14 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 @ 0x404d60 */
| #include <stdint.h>
|
; (fcn) fcn.00404d60 () | void fcn_00404d60 () {
0x00404d60 lui gp, 0x43 |
0x00404d64 addiu sp, sp, -0x70 |
0x00404d68 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00404d6c sw s0, 0x50(sp) | *(var_50h) = s0;
0x00404d70 sw ra, 0x6c(sp) | *(var_6ch) = ra;
0x00404d74 sw s6, 0x68(sp) | *(var_68h) = s6;
0x00404d78 sw s5, 0x64(sp) | *(var_64h) = s5;
0x00404d7c sw s4, 0x60(sp) | *(var_60h) = s4;
0x00404d80 sw s3, 0x5c(sp) | *(var_5ch) = s3;
0x00404d84 sw s2, 0x58(sp) | *(var_58h) = s2;
0x00404d88 sw s1, 0x54(sp) | *(var_54h) = s1;
0x00404d8c sw gp, 0x18(sp) | *(var_18h) = gp;
0x00404d90 move s0, a0 | s0 = a0;
| if (a0 == 0) {
0x00404d94 bnez a0, 0x404dbc |
0x00404d98 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404d9c lui a1, 0x41 | a1 = 0x410000;
0x00404da0 lui a2, 0x41 | a2 = 0x410000;
0x00404da4 addiu a0, zero, 3 | a0 = 3;
| /* str._s__server_list_NULL._n */
0x00404da8 addiu a1, a1, 0x52f0 | a1 += 0x52f0;
| /* str.dump_server_list */
0x00404dac addiu a2, a2, 0x7d50 | a2 += 0x7d50;
0x00404db0 jalr t9 | t9 ();
0x00404db4 j 0x404e44 | goto label_0;
0x00404db8 addiu v0, zero, -1 | v0 = -1;
| }
0x00404dbc lui s1, 0x41 | s1 = 0x410000;
0x00404dc0 addiu s2, sp, 0x20 | s2 = sp + 0x20;
0x00404dc4 addiu s3, zero, 1 | s3 = 1;
0x00404dc8 lui s5, 0x41 | s5 = 0x410000;
0x00404dcc lui s4, 0x41 | s4 = 0x410000;
| /* str._s_server__ip:__s__port:__d_n */
0x00404dd0 addiu s1, s1, 0x5308 | s1 += 0x5308;
| do {
0x00404dd4 lw t9, -0x7fb0(gp) | t9 = sym.get_ip_str;
0x00404dd8 addiu s6, s0, 4 | s6 = s0 + 4;
0x00404ddc move a1, s2 | a1 = s2;
0x00404de0 addiu a2, zero, 0x2e | a2 = 0x2e;
0x00404de4 move a0, s6 | a0 = s6;
0x00404de8 jalr t9 | t9 ();
0x00404dec lw gp, 0x18(sp) | gp = *(var_18h);
0x00404df0 lw t9, -0x7fac(gp) | t9 = sym.get_port;
0x00404df4 move a0, s6 | a0 = s6;
0x00404df8 jalr t9 | t9 ();
0x00404dfc lw v1, (s0) | v1 = *(s0);
0x00404e00 lw gp, 0x18(sp) | gp = *(var_18h);
| /* esilref: 'UDP' */
0x00404e04 addiu a2, s5, 0x52ec | a2 = s5 + 0x52ec;
| /* esilref: 'TCP' */
0x00404e08 addiu a1, s4, 0x52e8 | a1 = s4 + 0x52e8;
0x00404e0c move a0, a2 | a0 = a2;
0x00404e10 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404e14 xor v1, v1, s3 | v1 ^= s3;
0x00404e18 move a2, a1 | a2 = a1;
| if (v1 == 0) {
0x00404e1c movn a2, a0, v1 | a2 = a0;
| }
0x00404e20 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00404e24 addiu a0, zero, 3 | a0 = 3;
0x00404e28 move a1, s1 | a1 = s1;
0x00404e2c move a3, s2 | a3 = s2;
0x00404e30 jalr t9 | t9 ();
0x00404e34 lw s0, 0x18(s0) | s0 = *((s0 + 6));
0x00404e38 lw gp, 0x18(sp) | gp = *(var_18h);
0x00404e3c bnez s0, 0x404dd4 |
| } while (s0 != 0);
0x00404e40 move v0, zero | v0 = 0;
| label_0:
0x00404e44 lw ra, 0x6c(sp) | ra = *(var_6ch);
0x00404e48 lw s6, 0x68(sp) | s6 = *(var_68h);
0x00404e4c lw s5, 0x64(sp) | s5 = *(var_64h);
0x00404e50 lw s4, 0x60(sp) | s4 = *(var_60h);
0x00404e54 lw s3, 0x5c(sp) | s3 = *(var_5ch);
0x00404e58 lw s2, 0x58(sp) | s2 = *(var_58h);
0x00404e5c lw s1, 0x54(sp) | s1 = *(var_54h);
0x00404e60 lw s0, 0x50(sp) | s0 = *(var_50h);
0x00404e64 addiu sp, sp, 0x70 |
0x00404e68 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 @ 0x404e6c */
| #include <stdint.h>
|
; (fcn) fcn.00404e6c () | void fcn_00404e6c () {
0x00404e6c addiu sp, sp, -0x1028 |
0x00404e70 sw s0, 0x1018(sp) | *(var_1018h) = s0;
0x00404e74 lui s0, 0x43 | s0 = 0x430000;
0x00404e78 lui gp, 0x43 |
| /* obj.miio */
0x00404e7c addiu s0, s0, -0x6dd0 | s0 += -0x6dd0;
0x00404e80 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00404e84 sw s2, 0x1020(sp) | *(var_1020h) = s2;
0x00404e88 lw s2, 0x268(s0) | s2 = *((s0 + 154));
0x00404e8c lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404e90 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00404e94 sw ra, 0x1024(sp) | *(var_1024h) = ra;
0x00404e98 sw s1, 0x101c(sp) | *(var_101ch) = s1;
0x00404e9c move a0, s2 | a0 = s2;
0x00404ea0 jalr t9 | t9 ();
0x00404ea4 addiu v0, v0, 0x39 | v0 += 0x39;
0x00404ea8 sltiu v0, v0, 0xfff | v0 = (v0 < 0xfff) ? 1 : 0;
0x00404eac lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00404eb0 bnez v0, 0x404edc |
0x00404eb4 lui a1, 0x41 | a1 = 0x410000;
0x00404eb8 lui a2, 0x41 | a2 = 0x410000;
0x00404ebc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404ec0 addiu a0, zero, 3 | a0 = 3;
| /* str._s:_dir_too_long:__s_n */
0x00404ec4 addiu a1, a1, 0x5048 | a1 += 0x5048;
| /* str.cmd_internal_req_wifi_conf_status */
0x00404ec8 addiu a2, a2, 0x7d78 | a2 += 0x7d78;
0x00404ecc move a3, s2 | a3 = s2;
0x00404ed0 jalr t9 | t9 ();
0x00404ed4 j 0x404f64 | goto label_0;
0x00404ed8 nop |
| }
0x00404edc lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x00404ee0 addiu s1, sp, 0x18 | s1 = sp + 0x18;
0x00404ee4 lui a1, 0x41 | a1 = 0x410000;
0x00404ee8 move a2, s2 | a2 = s2;
0x00404eec move a0, s1 | a0 = s1;
| /* str._method_:__internal.req_wifi_conf_status___params_:__s_ */
0x00404ef0 addiu a1, a1, 0x5328 | a1 += 0x5328;
0x00404ef4 jalr t9 | t9 ();
0x00404ef8 lw s2, 0x2d4(s0) | s2 = *((s0 + 181));
0x00404efc addu v0, s1, v0 | v0 = s1 + v0;
0x00404f00 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404f04 sb zero, (v0) | *(v0) = 0;
| if (s2 > 0) {
0x00404f08 blez s2, 0x404f50 |
0x00404f0c lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00404f10 move a0, s1 | a0 = s1;
0x00404f14 jalr t9 | t9 ();
0x00404f18 lw gp, 0x10(sp) | gp = *(var_10h);
0x00404f1c move a0, s2 | a0 = s2;
0x00404f20 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x00404f24 move a1, s1 | a1 = s1;
0x00404f28 move a2, v0 | a2 = v0;
0x00404f2c jalr t9 | t9 ();
0x00404f30 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 >= 0) {
0x00404f34 bgez v0, 0x404f64 | goto label_0;
| }
0x00404f38 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x00404f3c lw a1, 0x2d4(s0) | a1 = *((s0 + 181));
0x00404f40 move a0, s0 | a0 = s0;
0x00404f44 jalr t9 | t9 ();
0x00404f48 j 0x404f64 | goto label_0;
0x00404f4c sw zero, 0x2d4(s0) | *((s0 + 181)) = 0;
| }
0x00404f50 lui a1, 0x41 | a1 = 0x410000;
0x00404f54 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404f58 addiu a0, zero, 1 | a0 = 1;
| /* str.No_helper_script__n */
0x00404f5c addiu a1, a1, 0x50b4 | a1 += 0x50b4;
0x00404f60 jalr t9 | t9 ();
| label_0:
0x00404f64 lw ra, 0x1024(sp) | ra = *(var_1024h);
0x00404f68 lw s2, 0x1020(sp) | s2 = *(var_1020h);
0x00404f6c lw s1, 0x101c(sp) | s1 = *(var_101ch);
0x00404f70 lw s0, 0x1018(sp) | s0 = *(var_1018h);
0x00404f74 addiu sp, sp, 0x1028 |
0x00404f78 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 @ 0x404f7c */
| #include <stdint.h>
|
; (fcn) fcn.00404f7c () | void fcn_00404f7c () {
0x00404f7c lui gp, 0x43 |
0x00404f80 addiu gp, gp, 0x1620 |
0x00404f84 addiu sp, sp, -0xd0 |
0x00404f88 lw t9, -0x7e70(gp) | t9 = sym.imp.__res_nclose;
0x00404f8c sw ra, 0xcc(sp) | *(var_cch) = ra;
0x00404f90 sw s2, 0xb0(sp) | *(var_b0h) = s2;
0x00404f94 sw s0, 0xa8(sp) | *(var_a8h) = s0;
0x00404f98 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00404f9c sw fp, 0xc8(sp) | *(var_c8h) = fp;
0x00404fa0 sw s7, 0xc4(sp) | *(var_c4h) = s7;
0x00404fa4 sw s6, 0xc0(sp) | *(var_c0h) = s6;
0x00404fa8 sw s5, 0xbc(sp) | *(var_bch) = s5;
0x00404fac sw s4, 0xb8(sp) | *(var_b8h) = s4;
0x00404fb0 sw s3, 0xb4(sp) | *(var_b4h) = s3;
0x00404fb4 sw s1, 0xac(sp) | *(var_ach) = s1;
0x00404fb8 move s2, a0 | s2 = a0;
0x00404fbc move a0, zero | a0 = 0;
0x00404fc0 jalr t9 | t9 ();
0x00404fc4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00404fc8 lw t9, -0x7dc8(gp) | t9 = sym.imp.__res_init;
0x00404fcc jalr t9 | t9 ();
0x00404fd0 nop |
0x00404fd4 move s0, v0 | s0 = v0;
0x00404fd8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00404fdc beqz v0, 0x404ffc |
0x00404fe0 lui a1, 0x41 | a1 = 0x410000;
0x00404fe4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00404fe8 addiu a0, zero, 1 | a0 = 1;
| /* str.res_init_error._n */
0x00404fec addiu a1, a1, 0x536c | a1 += 0x536c;
0x00404ff0 jalr t9 | t9 ();
0x00404ff4 j 0x4050c8 | goto label_1;
0x00404ff8 nop |
| }
0x00404ffc lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00405000 addiu s0, sp, 0x80 | s0 = sp + 0x80;
0x00405004 move a0, s0 | a0 = s0;
0x00405008 move a1, zero | a1 = 0;
0x0040500c addiu a2, zero, 0x20 | a2 = 0x20;
0x00405010 jalr t9 | t9 ();
0x00405014 addiu a0, zero, 2 | a0 = 2;
0x00405018 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040501c addiu v1, zero, 1 | v1 = 1;
0x00405020 xori v0, s2, 1 | v0 = s2 ^ 1;
0x00405024 sw a0, 0x84(sp) | *(var_84h) = a0;
| if (v0 == 0) {
0x00405028 movn a0, v1, v0 | a0 = v1;
| }
0x0040502c sw a0, 0x88(sp) | *(var_88h) = a0;
0x00405030 addiu a3, sp, 0xa4 | a3 = sp + 0xa4;
0x00405034 lw t9, -0x7e14(gp) | t9 = sym.imp.getaddrinfo;
| if (s2 == v1) {
0x00405038 bne s2, v1, 0x40506c |
0x0040503c lui s3, 0x43 | s3 = miio;
| /* obj.miio */
0x00405040 addiu s3, s3, -0x6dd0 |
0x00405044 lui s1, 0x43 | s1 = 0x430000;
0x00405048 lw a1, 0x264(s3) | a1 = *((s3 + 153));
0x0040504c move a2, s0 | a2 = s0;
0x00405050 addiu a0, s1, -0x6bac | a0 = s1 + -0x6bac;
0x00405054 jalr t9 | t9 ();
0x00405058 move s0, v0 | s0 = v0;
0x0040505c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00405060 bnez v0, 0x4053ac | goto label_2;
| }
0x00405064 j 0x4050d4 | goto label_3;
0x00405068 lui s4, 0x41 | s4 = 0x410000;
| }
0x0040506c lui s1, 0x43 | s1 = 0x430000;
0x00405070 lui s3, 0x41 | s3 = 0x410000;
0x00405074 move a2, s0 | a2 = s0;
0x00405078 addiu a0, s1, -0x6b8c | a0 = s1 + -0x6b8c;
| /* str.8053 */
0x0040507c addiu a1, s3, 0x5364 | a1 = s3 + 0x5364;
0x00405080 jalr t9 | t9 ();
0x00405084 move s0, v0 | s0 = v0;
0x00405088 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040508c beqz v0, 0x4050d0 |
0x00405090 addiu s1, s1, -0x6b8c | s1 += -0x6b8c;
| /* str.8053 */
0x00405094 addiu s3, s3, 0x5364 | s3 += 0x5364;
| label_0:
0x00405098 lw t9, -0x7d60(gp) | t9 = sym.imp.gai_strerror;
0x0040509c move a0, s0 | a0 = s0;
0x004050a0 jalr t9 | t9 ();
0x004050a4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004050a8 lui a1, 0x41 | a1 = 0x410000;
0x004050ac lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004050b0 sw v0, 0x10(sp) | *(var_10h) = v0;
0x004050b4 addiu a0, zero, 2 | a0 = 2;
| /* str.getaddrinfo___s:_s_:__s_n */
0x004050b8 addiu a1, a1, 0x5380 | a1 += 0x5380;
0x004050bc move a2, s1 | a2 = s1;
0x004050c0 move a3, s3 | a3 = s3;
0x004050c4 jalr t9 | t9 ();
| label_1:
0x004050c8 j 0x4053b8 | goto label_4;
0x004050cc move v0, s0 | v0 = s0;
| }
0x004050d0 lui s4, 0x41 | s4 = 0x410000;
| label_3:
0x004050d4 lui s5, 0x41 | s5 = 0x410000;
0x004050d8 lw s0, 0xa4(sp) | s0 = *(var_a4h);
| /* str.server_ip__s___my_ip__s___we_might_be_using_a_buggy_router._n */
0x004050dc addiu s4, s4, 0x5404 | s4 += 0x5404;
| /* str.strange_ip_2:__s_n */
0x004050e0 addiu s5, s5, 0x53f0 | s5 += 0x53f0;
0x004050e4 lui s6, 0x41 | s6 = 0x410000;
| do {
0x004050e8 lw t9, -0x7d2c(gp) | t9 = sym.imp.socket;
| if (s0 == 0) {
0x004050ec beqz s0, 0x405398 | goto label_5;
| }
0x004050f0 addiu v0, zero, 0x10 | v0 = 0x10;
0x004050f4 lw a0, 4(s0) | a0 = *((s0 + 1));
0x004050f8 lw a1, 8(s0) | a1 = *((s0 + 2));
0x004050fc lw a2, 0xc(s0) | a2 = *((s0 + 3));
0x00405100 sw v0, 0xa0(sp) | *(var_a0h) = v0;
0x00405104 jalr t9 | t9 ();
0x00405108 move s7, v0 | s7 = v0;
0x0040510c addiu v0, zero, -1 | v0 = -1;
0x00405110 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s7 == v0) {
0x00405114 bne s7, v0, 0x405138 |
0x00405118 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040511c lui a1, 0x41 | a1 = 0x410000;
0x00405120 addiu a0, zero, 1 | a0 = 1;
| /* str.error_in_create_socket:__m_n */
0x00405124 addiu a1, a1, 0x539c | a1 += 0x539c;
0x00405128 jalr t9 | t9 ();
0x0040512c addiu s1, zero, -1 | s1 = -1;
0x00405130 j 0x40528c | goto label_6;
0x00405134 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00405138 lw t9, -0x7ce4(gp) | t9 = sym.imp.connect;
0x0040513c lw a1, 0x14(s0) | a1 = *((s0 + 5));
0x00405140 lw a2, 0x10(s0) | a2 = *((s0 + 4));
0x00405144 move a0, s7 | a0 = s7;
0x00405148 jalr t9 | t9 ();
0x0040514c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00405150 beqz v0, 0x405170 |
0x00405154 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405158 lui a1, 0x41 | a1 = 0x410000;
0x0040515c addiu a0, zero, 1 | a0 = 1;
| /* str.error_in_trying_to_connect_socket:__m_n */
0x00405160 addiu a1, a1, 0x53b8 | a1 += 0x53b8;
0x00405164 jalr t9 | t9 ();
0x00405168 j 0x405278 | goto label_7;
0x0040516c lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00405170 lw t9, -0x7e74(gp) | t9 = sym.imp.getsockname;
0x00405174 lw a1, 0x14(s0) | a1 = *((s0 + 5));
0x00405178 addiu s1, sp, 0xa0 | s1 = sp + 0xa0;
0x0040517c move a0, s7 | a0 = s7;
0x00405180 move a2, s1 | a2 = s1;
0x00405184 jalr t9 | t9 ();
0x00405188 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040518c sb zero, 0x50(sp) | *(var_50h) = 0;
0x00405190 addiu s3, sp, 0x50 | s3 = sp + 0x50;
0x00405194 lw t9, -0x7fb0(gp) | t9 = sym.get_ip_str;
0x00405198 lw a0, 0x14(s0) | a0 = *((s0 + 5));
0x0040519c move a1, s3 | a1 = s3;
0x004051a0 addiu a2, zero, 0x2e | a2 = 0x2e;
0x004051a4 jalr t9 | t9 ();
0x004051a8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004051ac lw a1, 0x14(s0) | a1 = *((s0 + 5));
0x004051b0 lw t9, -0x7e04(gp) | t9 = sym.imp.getpeername;
0x004051b4 move a0, s7 | a0 = s7;
0x004051b8 move a2, s1 | a2 = s1;
0x004051bc jalr t9 | t9 ();
0x004051c0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004051c4 sb zero, 0x20(sp) | *(var_20h) = 0;
0x004051c8 lw a0, 0x14(s0) | a0 = *((s0 + 5));
0x004051cc lw t9, -0x7fb0(gp) | t9 = sym.get_ip_str;
0x004051d0 addiu fp, sp, 0x20 | fp = sp + 0x20;
0x004051d4 move a1, fp | a1 = fp;
0x004051d8 addiu a2, zero, 0x2e | a2 = 0x2e;
0x004051dc jalr t9 | t9 ();
0x004051e0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004051e4 move a0, s3 | a0 = s3;
0x004051e8 lw t9, -0x7e50(gp) | t9 = sym.imp.strchr;
0x004051ec addiu a1, zero, 0x2e | a1 = 0x2e;
0x004051f0 jalr t9 | t9 ();
0x004051f4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004051f8 bnez v0, 0x405208 |
0x004051fc addiu a0, zero, 1 | a0 = 1;
0x00405200 j 0x405228 | goto label_8;
| /* str.strange_ip:__s_n */
0x00405204 addiu a1, s6, 0x53e0 | a1 = s6 + 0x53e0;
| }
0x00405208 lw t9, -0x7e50(gp) | t9 = sym.imp.strchr;
0x0040520c move a0, v0 | a0 = v0;
0x00405210 addiu a1, zero, 0x2e | a1 = 0x2e;
0x00405214 jalr t9 | t9 ();
0x00405218 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040521c bnez v0, 0x40523c |
0x00405220 addiu a0, zero, 1 | a0 = 1;
0x00405224 move a1, s5 | a1 = s5;
| label_8:
0x00405228 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040522c move a2, s3 | a2 = s3;
0x00405230 jalr t9 | t9 ();
0x00405234 j 0x405278 | goto label_7;
0x00405238 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040523c lw t9, -0x7da0(gp) | t9 = sym.imp.strncmp;
0x00405240 move a0, s3 | a0 = s3;
0x00405244 move a1, fp | a1 = fp;
0x00405248 subu a2, v0, s3 | __asm ("subu a2, v0, s3");
0x0040524c jalr t9 | t9 ();
0x00405250 move s1, zero | s1 = 0;
0x00405254 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00405258 bnez v0, 0x40527c |
0x0040525c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405260 addiu a0, zero, 1 | a0 = 1;
0x00405264 move a1, s4 | a1 = s4;
0x00405268 move a2, fp | a2 = fp;
0x0040526c move a3, s3 | a3 = s3;
0x00405270 jalr t9 | t9 ();
0x00405274 lw gp, 0x18(sp) | gp = *(var_18h);
| label_7:
0x00405278 addiu s1, zero, -1 | s1 = -1;
| }
0x0040527c lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x00405280 move a0, s7 | a0 = s7;
0x00405284 jalr t9 | t9 ();
0x00405288 lw gp, 0x18(sp) | gp = *(var_18h);
| label_6:
0x0040528c addiu v0, zero, -1 | v0 = -1;
0x00405290 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
| if (s1 != v0) {
0x00405294 beq s1, v0, 0x405390 |
0x00405298 addiu a0, zero, 0x1c | a0 = 0x1c;
0x0040529c jalr t9 | t9 ();
0x004052a0 move s1, v0 | s1 = v0;
0x004052a4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004052a8 bnez v0, 0x4052d4 |
0x004052ac lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004052b0 lui a1, 0x41 | a1 = 0x410000;
0x004052b4 lui a2, 0x41 | a2 = 0x410000;
0x004052b8 move a0, zero | a0 = 0;
| /* str._s___d:_malloc_fail_n */
0x004052bc addiu a1, a1, 0x5444 | a1 += 0x5444;
| /* str.miio_client.c */
0x004052c0 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x004052c4 addiu a3, zero, 0xc5b | a3 = 0xc5b;
0x004052c8 jalr t9 | t9 ();
0x004052cc j 0x405390 | goto label_9;
0x004052d0 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x004052d4 addiu s3, v0, 4 | s3 = v0 + 4;
0x004052d8 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x004052dc lw a1, 0x14(s0) | a1 = *((s0 + 5));
0x004052e0 move a0, s3 | a0 = s3;
0x004052e4 addiu a2, zero, 0x10 | a2 = 0x10;
0x004052e8 sw s2, (v0) | *(v0) = s2;
0x004052ec jalr t9 | t9 ();
0x004052f0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004052f4 lw v0, 0x10(s0) | v0 = *((s0 + 4));
0x004052f8 addiu s7, sp, 0x20 | s7 = sp + 0x20;
0x004052fc lw t9, -0x7fb0(gp) | t9 = sym.get_ip_str;
0x00405300 move a0, s3 | a0 = s3;
0x00405304 move a1, s7 | a1 = s7;
0x00405308 addiu a2, zero, 0x2e | a2 = 0x2e;
0x0040530c sw v0, 0x14(s1) | *((s1 + 5)) = v0;
0x00405310 jalr t9 | t9 ();
0x00405314 lw gp, 0x18(sp) | gp = *(var_18h);
0x00405318 lw t9, -0x7fac(gp) | t9 = sym.get_port;
0x0040531c move a0, s3 | a0 = s3;
0x00405320 jalr t9 | t9 ();
0x00405324 addiu v1, zero, 1 | v1 = 1;
0x00405328 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s2 != v1) {
0x0040532c beq s2, v1, 0x40533c |
0x00405330 lui a2, 0x41 | a2 = 0x410000;
0x00405334 j 0x405344 | goto label_10;
| /* esilref: 'UDP' */
0x00405338 addiu a2, a2, 0x52ec | a2 += 0x52ec;
| }
0x0040533c lui a2, 0x41 | a2 = 0x4152e8;
| /* esilref: 'TCP' */
0x00405340 addiu a2, a2, 0x52e8 |
| label_10:
0x00405344 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405348 lui a1, 0x41 | a1 = 0x410000;
0x0040534c sw v0, 0x10(sp) | *(var_10h) = v0;
0x00405350 addiu a0, zero, 2 | a0 = 2;
| /* str.Add__s_server_into_list__host_ip:__s__port:__d_n */
0x00405354 addiu a1, a1, 0x545c | a1 += 0x545c;
0x00405358 move a3, s7 | a3 = s7;
0x0040535c jalr t9 | t9 ();
0x00405360 lui v0, 0x43 | v0 = 0x430000;
0x00405364 addiu v1, zero, 2 | v1 = 2;
0x00405368 lw gp, 0x18(sp) | gp = *(var_18h);
| /* obj.miio */
0x0040536c addiu v0, v0, -0x6dd0 | v0 += -0x6dd0;
| if (s2 == v1) {
0x00405370 bne s2, v1, 0x405384 |
0x00405374 lw v1, 0x270(v0) | v1 = *((v0 + 156));
0x00405378 sw s1, 0x270(v0) | *((v0 + 156)) = s1;
0x0040537c j 0x405390 | goto label_9;
0x00405380 sw v1, 0x18(s1) | *((s1 + 6)) = v1;
| }
0x00405384 lw v1, 0x274(v0) | v1 = *((v0 + 157));
0x00405388 sw s1, 0x274(v0) | *((v0 + 157)) = s1;
0x0040538c sw v1, 0x18(s1) | *((s1 + 6)) = v1;
| }
| label_9:
0x00405390 j 0x4050e8 |
| } while (1);
0x00405394 lw s0, 0x1c(s0) | s0 = *((s0 + 7));
| label_5:
0x00405398 lw t9, -0x7d48(gp) | t9 = sym.imp.freeaddrinfo;
0x0040539c lw a0, 0xa4(sp) | a0 = *(var_a4h);
0x004053a0 jalr t9 | t9 ();
0x004053a4 j 0x4053b8 | goto label_4;
0x004053a8 move v0, zero | v0 = 0;
| label_2:
0x004053ac lw s3, 0x264(s3) | s3 = *((s3 + 153));
0x004053b0 j 0x405098 | goto label_0;
0x004053b4 addiu s1, s1, -0x6bac | s1 += -0x6bac;
| label_4:
0x004053b8 lw ra, 0xcc(sp) | ra = *(var_cch);
0x004053bc lw fp, 0xc8(sp) | fp = *(var_c8h);
0x004053c0 lw s7, 0xc4(sp) | s7 = *(var_c4h);
0x004053c4 lw s6, 0xc0(sp) | s6 = *(var_c0h);
0x004053c8 lw s5, 0xbc(sp) | s5 = *(var_bch);
0x004053cc lw s4, 0xb8(sp) | s4 = *(var_b8h);
0x004053d0 lw s3, 0xb4(sp) | s3 = *(var_b4h);
0x004053d4 lw s2, 0xb0(sp) | s2 = *(var_b0h);
0x004053d8 lw s1, 0xac(sp) | s1 = *(var_ach);
0x004053dc lw s0, 0xa8(sp) | s0 = *(var_a8h);
0x004053e0 addiu sp, sp, 0xd0 |
0x004053e4 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 @ 0x4053e8 */
| #include <stdint.h>
|
; (fcn) fcn.004053e8 () | void fcn_004053e8 () {
0x004053e8 lui gp, 0x43 |
0x004053ec addiu sp, sp, -0x430 |
0x004053f0 addiu gp, gp, 0x1620 | gp += 0x1620;
0x004053f4 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x004053f8 sw s1, 0x428(sp) | *(var_428h) = s1;
0x004053fc sw s0, 0x424(sp) | *(var_424h) = s0;
0x00405400 move s1, a0 | s1 = a0;
0x00405404 move s0, a1 | s0 = a1;
0x00405408 move a0, a1 | a0 = a1;
0x0040540c lui a1, 0x41 | a1 = 0x410000;
0x00405410 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00405414 sw ra, 0x42c(sp) | *(var_42ch) = ra;
| /* esilref: 'id' */
0x00405418 addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040541c addiu a2, sp, 0x418 | a2 = sp + 0x418;
0x00405420 jalr t9 | t9 ();
0x00405424 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x00405428 bgez v0, 0x405454 |
0x0040542c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405430 lui a1, 0x41 | a1 = 0x410000;
0x00405434 lui a2, 0x41 | a2 = 0x410000;
0x00405438 addiu a0, zero, 3 | a0 = 3;
| /* str._s____msg_does_not_have_id:__s_n */
0x0040543c addiu a1, a1, 0x5280 | a1 += 0x5280;
| /* str.handle_local_msg_state */
0x00405440 addiu a2, a2, 0x7b4c | a2 += 0x7b4c;
0x00405444 move a3, s0 | a3 = s0;
0x00405448 jalr t9 | t9 ();
0x0040544c j 0x4054d0 | goto label_0;
0x00405450 addiu v0, zero, -1 | v0 = -1;
| }
0x00405454 addiu s0, sp, 0x18 | s0 = sp + 0x18;
0x00405458 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040545c move a0, s0 | a0 = s0;
0x00405460 move a1, zero | a1 = 0;
0x00405464 addiu a2, zero, 0x400 | a2 = 0x400;
0x00405468 jalr t9 | t9 ();
0x0040546c lui v0, 0x43 | v0 = 0x430000;
0x00405470 lw v0, -0x6dd0(v0) | v0 = *((v0 - 7028));
0x00405474 lw gp, 0x10(sp) | gp = *(var_10h);
0x00405478 sll v1, v0, 2 | v1 = v0 << 2;
0x0040547c lui v0, 0x43 | v0 = 0x4295e8;
| /* esilref: 'device_init' */
0x00405480 addiu v0, v0, -0x6a18 |
0x00405484 addu v0, v1, v0 | v0 = v1 + v0;
0x00405488 lw a2, 0x418(sp) | a2 = *(var_418h);
0x0040548c lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x00405490 lw a3, (v0) | a3 = *(v0);
0x00405494 lui a1, 0x41 | a1 = "{\"id\":%d,\"method\":\"local.status\",\"params\":\"%s\"}";
| /* str._id_:_d__method_:_local.status___params_:__s_ */
0x00405498 addiu a1, a1, 0x548c |
0x0040549c move a0, s0 | a0 = s0;
0x004054a0 jalr t9 | t9 ();
0x004054a4 lw gp, 0x10(sp) | gp = *(var_10h);
0x004054a8 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004054ac move a0, s0 | a0 = s0;
0x004054b0 jalr t9 | t9 ();
0x004054b4 lw gp, 0x10(sp) | gp = *(var_10h);
0x004054b8 move a0, s1 | a0 = s1;
0x004054bc lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x004054c0 move a1, s0 | a1 = s0;
0x004054c4 move a2, v0 | a2 = v0;
0x004054c8 jalr t9 | t9 ();
0x004054cc move v0, zero | v0 = 0;
| label_0:
0x004054d0 lw ra, 0x42c(sp) | ra = *(var_42ch);
0x004054d4 lw s1, 0x428(sp) | s1 = *(var_428h);
0x004054d8 lw s0, 0x424(sp) | s0 = *(var_424h);
0x004054dc addiu sp, sp, 0x430 |
0x004054e0 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 @ 0x4054e4 */
| #include <stdint.h>
|
; (fcn) fcn.004054e4 () | void fcn_004054e4 () {
0x004054e4 lui gp, 0x43 |
0x004054e8 addiu sp, sp, -0x438 |
0x004054ec addiu gp, gp, 0x1620 | gp += 0x1620;
0x004054f0 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x004054f4 sw s1, 0x428(sp) | *(var_428h) = s1;
0x004054f8 sw s0, 0x424(sp) | *(var_424h) = s0;
0x004054fc move s1, a0 | s1 = a0;
0x00405500 move s0, a1 | s0 = a1;
0x00405504 move a0, a1 | a0 = a1;
0x00405508 lui a1, 0x41 | a1 = 0x410000;
0x0040550c sw gp, 0x10(sp) | *(var_10h) = gp;
0x00405510 sw ra, 0x434(sp) | *(var_434h) = ra;
0x00405514 sw s3, 0x430(sp) | *(var_430h) = s3;
0x00405518 sw s2, 0x42c(sp) | *(var_42ch) = s2;
| /* esilref: 'id' */
0x0040551c addiu a1, a1, 0x527c | a1 += 0x527c;
0x00405520 addiu a2, sp, 0x418 | a2 = sp + 0x418;
0x00405524 jalr t9 | t9 ();
0x00405528 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x0040552c bgez v0, 0x405558 |
0x00405530 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405534 lui a1, 0x41 | a1 = 0x410000;
0x00405538 lui a2, 0x41 | a2 = 0x410000;
0x0040553c addiu a0, zero, 3 | a0 = 3;
| /* str._s____msg_does_not_have_id:__s_n */
0x00405540 addiu a1, a1, 0x5280 | a1 += 0x5280;
| /* str.handle_local_msg_time */
0x00405544 addiu a2, a2, 0x7b34 | a2 += 0x7b34;
0x00405548 move a3, s0 | a3 = s0;
0x0040554c jalr t9 | t9 ();
0x00405550 j 0x4055d4 | goto label_0;
0x00405554 addiu v0, zero, -1 | v0 = -1;
| }
0x00405558 addiu s0, sp, 0x18 | s0 = sp + 0x18;
0x0040555c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00405560 move a0, s0 | a0 = s0;
0x00405564 move a1, zero | a1 = 0;
0x00405568 addiu a2, zero, 0x400 | a2 = 0x400;
0x0040556c jalr t9 | t9 ();
0x00405570 lw gp, 0x10(sp) | gp = *(var_10h);
0x00405574 lui v0, 0x43 | v0 = 0x430000;
0x00405578 lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
0x0040557c lw s3, 0x418(sp) | s3 = *(var_418h);
0x00405580 lw s2, -0x6bbc(v0) | s2 = *((v0 - 6895));
0x00405584 jalr t9 | t9 ();
0x00405588 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040558c lui a1, 0x41 | a1 = 0x410000;
0x00405590 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
| /* str._id_:_d__method_:_local.time___params_:_d */
0x00405594 addiu a1, a1, 0x54bc | a1 += 0x54bc;
0x00405598 move a2, s3 | a2 = s3;
0x0040559c addu a3, v0, s2 | a3 = v0 + s2;
0x004055a0 move a0, s0 | a0 = s0;
0x004055a4 jalr t9 | t9 ();
0x004055a8 lw gp, 0x10(sp) | gp = *(var_10h);
0x004055ac lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004055b0 move a0, s0 | a0 = s0;
0x004055b4 jalr t9 | t9 ();
0x004055b8 lw gp, 0x10(sp) | gp = *(var_10h);
0x004055bc move a0, s1 | a0 = s1;
0x004055c0 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x004055c4 move a1, s0 | a1 = s0;
0x004055c8 move a2, v0 | a2 = v0;
0x004055cc jalr t9 | t9 ();
0x004055d0 move v0, zero | v0 = 0;
| label_0:
0x004055d4 lw ra, 0x434(sp) | ra = *(var_434h);
0x004055d8 lw s3, 0x430(sp) | s3 = *(var_430h);
0x004055dc lw s2, 0x42c(sp) | s2 = *(var_42ch);
0x004055e0 lw s1, 0x428(sp) | s1 = *(var_428h);
0x004055e4 lw s0, 0x424(sp) | s0 = *(var_424h);
0x004055e8 addiu sp, sp, 0x438 |
0x004055ec 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 @ 0x4055f0 */
| #include <stdint.h>
|
; (fcn) fcn.004055f0 () | void fcn_004055f0 () {
0x004055f0 lui gp, 0x43 |
0x004055f4 addiu sp, sp, -0x430 |
0x004055f8 addiu gp, gp, 0x1620 | gp += 0x1620;
0x004055fc lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x00405600 sw s1, 0x428(sp) | *(var_428h) = s1;
0x00405604 sw s0, 0x424(sp) | *(var_424h) = s0;
0x00405608 move s1, a0 | s1 = a0;
0x0040560c move s0, a1 | s0 = a1;
0x00405610 move a0, a1 | a0 = a1;
0x00405614 lui a1, 0x41 | a1 = 0x410000;
0x00405618 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040561c sw ra, 0x42c(sp) | *(var_42ch) = ra;
| /* esilref: 'id' */
0x00405620 addiu a1, a1, 0x527c | a1 += 0x527c;
0x00405624 addiu a2, sp, 0x418 | a2 = sp + 0x418;
0x00405628 jalr t9 | t9 ();
0x0040562c lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x00405630 bgez v0, 0x40565c |
0x00405634 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405638 lui a1, 0x41 | a1 = 0x410000;
0x0040563c lui a2, 0x41 | a2 = 0x410000;
0x00405640 addiu a0, zero, 3 | a0 = 3;
| /* str._s____msg_does_not_have_id:__s_n */
0x00405644 addiu a1, a1, 0x5280 | a1 += 0x5280;
| /* str.handle_local_msg_country */
0x00405648 addiu a2, a2, 0x7af4 | a2 += 0x7af4;
0x0040564c move a3, s0 | a3 = s0;
0x00405650 jalr t9 | t9 ();
0x00405654 j 0x4056dc | goto label_0;
0x00405658 addiu v0, zero, -1 | v0 = -1;
| }
0x0040565c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00405660 addiu s0, sp, 0x18 | s0 = sp + 0x18;
0x00405664 addiu a2, zero, 0x400 | a2 = 0x400;
0x00405668 move a0, s0 | a0 = s0;
0x0040566c move a1, zero | a1 = 0;
0x00405670 jalr t9 | t9 ();
0x00405674 lui v0, 0x43 | v0 = 0x430000;
0x00405678 lb v0, -0x6bb4(v0) | v0 = *((v0 - 27572));
0x0040567c lw gp, 0x10(sp) | gp = *(var_10h);
0x00405680 lw a2, 0x418(sp) | a2 = *(var_418h);
| if (v0 != 0) {
0x00405684 beqz v0, 0x405694 |
0x00405688 lui a3, 0x43 | a3 = 0x430000;
0x0040568c j 0x40569c | goto label_1;
0x00405690 addiu a3, a3, -0x6bb4 | a3 += -0x6bb4;
| }
0x00405694 lui a3, 0x41 | a3 = 0x4154e8;
| /* esilref: 'prc' */
0x00405698 addiu a3, a3, 0x54e8 |
| label_1:
0x0040569c lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x004056a0 lui a1, 0x41 | a1 = "{\"id\":%d,\"method\":\"local.country\",\"params\":\"%s\"}";
| /* str._id_:_d__method_:_local.country___params_:__s_ */
0x004056a4 addiu a1, a1, 0x54ec |
0x004056a8 move a0, s0 | a0 = s0;
0x004056ac jalr t9 | t9 ();
0x004056b0 lw gp, 0x10(sp) | gp = *(var_10h);
0x004056b4 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004056b8 move a0, s0 | a0 = s0;
0x004056bc jalr t9 | t9 ();
0x004056c0 lw gp, 0x10(sp) | gp = *(var_10h);
0x004056c4 move a0, s1 | a0 = s1;
0x004056c8 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x004056cc move a1, s0 | a1 = s0;
0x004056d0 move a2, v0 | a2 = v0;
0x004056d4 jalr t9 | t9 ();
0x004056d8 move v0, zero | v0 = 0;
| label_0:
0x004056dc lw ra, 0x42c(sp) | ra = *(var_42ch);
0x004056e0 lw s1, 0x428(sp) | s1 = *(var_428h);
0x004056e4 lw s0, 0x424(sp) | s0 = *(var_424h);
0x004056e8 addiu sp, sp, 0x430 |
0x004056ec 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 @ 0x4056f0 */
| #include <stdint.h>
|
; (fcn) fcn.004056f0 () | void fcn_004056f0 () {
0x004056f0 lui gp, 0x43 |
0x004056f4 addiu sp, sp, -0x30 |
0x004056f8 addiu gp, gp, 0x1620 | gp += 0x1620;
0x004056fc lw t9, -0x7dac(gp) | t9 = sym.imp.sendto;
0x00405700 sw a2, 0x14(sp) | *(var_14h) = a2;
0x00405704 lw a2, 0x40(sp) | a2 = *(arg_40h);
0x00405708 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0040570c sw a1, 0x10(sp) | *(var_10h) = a1;
0x00405710 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00405714 move a1, a3 | a1 = a3;
0x00405718 move a3, zero | a3 = 0;
0x0040571c jalr t9 | t9 ();
0x00405720 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00405724 bgez v0, 0x405754 |
0x00405728 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040572c lui a1, 0x41 | a1 = 0x410000;
0x00405730 lui a2, 0x41 | a2 = 0x410000;
0x00405734 lui a3, 0x41 | a3 = 0x410000;
0x00405738 sw v0, 0x20(sp) | *(var_20h) = v0;
0x0040573c addiu a0, zero, 1 | a0 = 1;
| /* str._s__s:_sendto_error:__m_n */
0x00405740 addiu a1, a1, 0x5520 | a1 += 0x5520;
| /* str.miio_client.c */
0x00405744 addiu a2, a2, 0x5028 | a2 += 0x5028;
| /* str.otd_send_datagram */
0x00405748 addiu a3, a3, 0x7cb8 | a3 += 0x7cb8;
0x0040574c jalr t9 | t9 ();
0x00405750 lw v0, 0x20(sp) | v0 = *(var_20h);
| }
0x00405754 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00405758 addiu sp, sp, 0x30 |
0x0040575c 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 @ 0x4058a0 */
| #include <stdint.h>
|
; (fcn) fcn.004058a0 () | void fcn_004058a0 () {
0x004058a0 lui gp, 0x43 |
0x004058a4 addiu gp, gp, 0x1620 |
0x004058a8 addiu sp, sp, -0x430 |
0x004058ac lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004058b0 sw ra, 0x42c(sp) | *(var_42ch) = ra;
0x004058b4 sw s2, 0x428(sp) | *(var_428h) = s2;
0x004058b8 sw s1, 0x424(sp) | *(var_424h) = s1;
0x004058bc sw s0, 0x420(sp) | *(var_420h) = s0;
0x004058c0 sw gp, 0x10(sp) | *(var_10h) = gp;
0x004058c4 move s2, a0 | s2 = a0;
0x004058c8 sw zero, 0x418(sp) | *(var_418h) = 0;
0x004058cc move a0, a1 | a0 = a1;
0x004058d0 move s1, a1 | s1 = a1;
0x004058d4 jalr t9 | t9 ();
0x004058d8 lw gp, 0x10(sp) | gp = *(var_10h);
0x004058dc lui a1, 0x41 | a1 = 0x410000;
0x004058e0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004058e4 lui s0, 0x41 | s0 = 0x410000;
0x004058e8 addiu a0, zero, 3 | a0 = 3;
| /* str._s____strlen:__d_n */
0x004058ec addiu a1, a1, 0x555c | a1 += 0x555c;
| /* str.handle_local_msg_ble_config_router */
0x004058f0 addiu a2, s0, 0x7b10 | a2 = s0 + 0x7b10;
0x004058f4 move a3, v0 | a3 = v0;
0x004058f8 jalr t9 | t9 ();
0x004058fc lw gp, 0x10(sp) | gp = *(var_10h);
0x00405900 lui a1, 0x41 | a1 = 0x410000;
0x00405904 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x00405908 move a0, s1 | a0 = s1;
| /* esilref: 'id' */
0x0040590c addiu a1, a1, 0x527c | a1 += 0x527c;
0x00405910 addiu a2, sp, 0x418 | a2 = sp + 0x418;
0x00405914 jalr t9 | t9 ();
0x00405918 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x0040591c bgez v0, 0x405944 |
0x00405920 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405924 lui a1, 0x41 | a1 = 0x410000;
0x00405928 addiu a0, zero, 3 | a0 = 3;
| /* str._s____msg_does_not_have_id:__s_n */
0x0040592c addiu a1, a1, 0x5280 | a1 += 0x5280;
| /* str.handle_local_msg_ble_config_router */
0x00405930 addiu a2, s0, 0x7b10 | a2 = s0 + 0x7b10;
0x00405934 move a3, s1 | a3 = s1;
0x00405938 jalr t9 | t9 ();
0x0040593c j 0x4059e0 | goto label_0;
0x00405940 addiu v0, zero, -1 | v0 = -1;
| }
0x00405944 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00405948 addiu s0, sp, 0x18 | s0 = sp + 0x18;
0x0040594c move a0, s0 | a0 = s0;
0x00405950 move a1, zero | a1 = 0;
0x00405954 addiu a2, zero, 0x400 | a2 = 0x400;
0x00405958 jalr t9 | t9 ();
0x0040595c lw gp, 0x10(sp) | gp = *(var_10h);
0x00405960 move a0, s1 | a0 = s1;
0x00405964 lw t9, -0x7fa8(gp) | t9 = sym.method_miio_config_router;
0x00405968 move a1, s0 | a1 = s0;
0x0040596c addiu a2, zero, 0x400 | a2 = 0x400;
0x00405970 jalr t9 | t9 ();
0x00405974 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x00405978 bgez v0, 0x4059b8 |
0x0040597c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405980 lui a1, 0x41 | a1 = 0x410000;
0x00405984 move a0, zero | a0 = 0;
| /* str.ble_config_router_fail_n */
0x00405988 addiu a1, a1, 0x5570 | a1 += 0x5570;
0x0040598c jalr t9 | t9 ();
0x00405990 lw gp, 0x10(sp) | gp = *(var_10h);
0x00405994 lui a1, 0x41 | a1 = 0x410000;
0x00405998 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040599c lw a2, 0x418(sp) | a2 = *(var_418h);
0x004059a0 lui a3, 0x41 | a3 = 0x410000;
0x004059a4 move a0, s0 | a0 = s0;
| /* str._id_:_d__error_:_code_:_33020__message_:__s_ */
0x004059a8 addiu a1, a1, 0x5588 | a1 += 0x5588;
| /* str.ble_config_router_fail. */
0x004059ac addiu a3, a3, 0x55bc | a3 += 0x55bc;
0x004059b0 jalr t9 | t9 ();
0x004059b4 lw gp, 0x10(sp) | gp = *(var_10h);
| }
0x004059b8 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004059bc move a0, s0 | a0 = s0;
0x004059c0 jalr t9 | t9 ();
0x004059c4 lw gp, 0x10(sp) | gp = *(var_10h);
0x004059c8 move a0, s2 | a0 = s2;
0x004059cc lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x004059d0 move a1, s0 | a1 = s0;
0x004059d4 move a2, v0 | a2 = v0;
0x004059d8 jalr t9 | t9 ();
0x004059dc move v0, zero | v0 = 0;
| label_0:
0x004059e0 lw ra, 0x42c(sp) | ra = *(var_42ch);
0x004059e4 lw s2, 0x428(sp) | s2 = *(var_428h);
0x004059e8 lw s1, 0x424(sp) | s1 = *(var_424h);
0x004059ec lw s0, 0x420(sp) | s0 = *(var_420h);
0x004059f0 addiu sp, sp, 0x430 |
0x004059f4 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 @ 0x4059f8 */
| #include <stdint.h>
|
; (fcn) fcn.004059f8 () | void fcn_004059f8 () {
0x004059f8 lui gp, 0x43 |
0x004059fc addiu sp, sp, -0x48 |
0x00405a00 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00405a04 lw t9, -0x7fa4(gp) | t9 = *((gp - 8169));
0x00405a08 sw s5, 0x40(sp) | *(var_40h) = s5;
0x00405a0c move s5, a1 | s5 = a1;
0x00405a10 lui a1, 0x41 | a1 = 0x410000;
0x00405a14 sw s0, 0x2c(sp) | *(var_2ch) = s0;
0x00405a18 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00405a1c sw ra, 0x44(sp) | *(var_44h) = ra;
0x00405a20 sw s4, 0x3c(sp) | *(var_3ch) = s4;
0x00405a24 sw s3, 0x38(sp) | *(var_38h) = s3;
0x00405a28 sw s2, 0x34(sp) | *(var_34h) = s2;
0x00405a2c sw s1, 0x30(sp) | *(var_30h) = s1;
| /* str.method */
0x00405a30 addiu a1, a1, 0x55d4 | a1 += 0x55d4;
0x00405a34 move s0, a0 | s0 = a0;
0x00405a38 jalr t9 | t9 ();
0x00405a3c lw gp, 0x18(sp) | gp = *(var_18h);
0x00405a40 move a0, s0 | a0 = s0;
0x00405a44 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
| if (v0 != 0) {
0x00405a48 bnez v0, 0x405bb0 | goto label_0;
| }
0x00405a4c lui s1, 0x43 | s1 = 0x430000;
0x00405a50 jalr t9 | t9 ();
0x00405a54 lw gp, 0x18(sp) | gp = *(var_18h);
0x00405a58 lui a1, 0x41 | a1 = 0x410000;
0x00405a5c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405a60 move a3, v0 | a3 = v0;
0x00405a64 sw s5, 0x10(sp) | *(var_10h) = s5;
0x00405a68 addiu a0, zero, 3 | a0 = 3;
| /* str.cloud_mobile_cmd:__s__strlen:__d__len:__d_n */
0x00405a6c addiu a1, a1, 0x55dc | a1 += 0x55dc;
0x00405a70 move a2, s0 | a2 = s0;
| /* obj.miio */
0x00405a74 addiu s1, s1, -0x6dd0 | s1 += -0x6dd0;
0x00405a78 jalr t9 | t9 ();
0x00405a7c lbu v0, 0x209(s1) | v0 = *((s1 + 521));
0x00405a80 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00405a84 beqz v0, 0x405b24 |
0x00405a88 sll a0, s5, 1 | a0 = s5 << 1;
0x00405a8c lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x00405a90 addiu a0, a0, 1 | a0++;
0x00405a94 sw a0, 0x20(sp) | *(var_20h) = a0;
0x00405a98 jalr t9 | t9 ();
0x00405a9c move s3, v0 | s3 = v0;
0x00405aa0 lw gp, 0x18(sp) | gp = *(var_18h);
0x00405aa4 move s2, v0 | s2 = v0;
| if (v0 == 0) {
0x00405aa8 bnez v0, 0x405ad0 |
0x00405aac lui a1, 0x41 | a1 = 0x410000;
0x00405ab0 lui a2, 0x41 | a2 = 0x410000;
0x00405ab4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405ab8 move a0, zero | a0 = 0;
| /* str._s__malloc_error:__m._n */
0x00405abc addiu a1, a1, 0x5608 | a1 += 0x5608;
| /* str.ot_agent_send_cmd_sock */
0x00405ac0 addiu a2, a2, 0x7c78 | a2 += 0x7c78;
0x00405ac4 jalr t9 | t9 ();
0x00405ac8 j 0x405c5c | goto label_1;
0x00405acc nop |
| }
0x00405ad0 lw t9, -0x7fa0(gp) | t9 = sym.data_encrypt;
0x00405ad4 addiu v0, sp, 0x20 | v0 = sp + 0x20;
0x00405ad8 lui a0, 0x41 | a0 = 0x410000;
0x00405adc sw v0, 0x10(sp) | *(var_10h) = v0;
| /* str.5_d_VdmW6_0u_k */
0x00405ae0 addiu a0, a0, 0x7e6c | a0 += 0x7e6c;
0x00405ae4 move a1, s0 | a1 = s0;
0x00405ae8 move a2, s5 | a2 = s5;
0x00405aec move a3, s3 | a3 = s3;
0x00405af0 jalr t9 | t9 ();
0x00405af4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x00405af8 bgez v0, 0x405b2c | goto label_2;
| }
0x00405afc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405b00 lui a1, 0x41 | a1 = 0x410000;
0x00405b04 lui a2, 0x41 | a2 = 0x410000;
0x00405b08 move a0, zero | a0 = 0;
| /* str._s__data_encrypt_error._n */
0x00405b0c addiu a1, a1, 0x5620 | a1 += 0x5620;
| /* str.ot_agent_send_cmd_sock */
0x00405b10 addiu a2, a2, 0x7c78 | a2 += 0x7c78;
0x00405b14 jalr t9 | t9 ();
0x00405b18 lw gp, 0x18(sp) | gp = *(var_18h);
0x00405b1c j 0x405b9c | goto label_3;
0x00405b20 move a0, s3 | a0 = s3;
| }
0x00405b24 sw s5, 0x20(sp) | *(var_20h) = s5;
0x00405b28 move s2, s0 | s2 = s0;
| label_2:
0x00405b2c move s0, zero | s0 = 0;
0x00405b30 move s3, s1 | s3 = s1;
| do {
0x00405b34 lw v0, 0x1e8(s1) | v0 = *((s1 + 122));
0x00405b38 slt v0, s0, v0 | v0 = (s0 < v0) ? 1 : 0;
0x00405b3c sll v0, s0, 2 | v0 = s0 << 2;
| if (v0 == 0) {
0x00405b40 beqz v0, 0x405b70 | goto label_4;
| }
0x00405b44 addu v0, s3, v0 | v0 = s3 + v0;
0x00405b48 lw a0, 0x198(v0) | a0 = *((v0 + 102));
0x00405b4c lw v0, 0x2d4(s3) | v0 = *((s3 + 181));
0x00405b50 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
| if (a0 != v0) {
0x00405b54 beq a0, v0, 0x405b68 |
0x00405b58 lw a2, 0x20(sp) | a2 = *(var_20h);
0x00405b5c move a1, s2 | a1 = s2;
0x00405b60 jalr t9 | t9 ();
0x00405b64 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00405b68 j 0x405b34 |
| } while (1);
0x00405b6c addiu s0, s0, 1 | s0++;
| label_4:
0x00405b70 lw a0, 0x2dc(s3) | a0 = *((s3 + 183));
0x00405b74 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
| if (a0 > 0) {
0x00405b78 blez a0, 0x405b8c |
0x00405b7c lw a2, 0x20(sp) | a2 = *(var_20h);
0x00405b80 move a1, s2 | a1 = s2;
0x00405b84 jalr t9 | t9 ();
0x00405b88 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00405b8c lbu v0, 0x209(s1) | v0 = *((s1 + 521));
0x00405b90 lw ra, 0x44(sp) | ra = *(var_44h);
| if (v0 != 0) {
0x00405b94 beqz v0, 0x405c60 |
0x00405b98 move a0, s2 | a0 = s2;
| label_3:
0x00405b9c lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00405ba0 jalr t9 | t9 ();
0x00405ba4 nop |
0x00405ba8 j 0x405c5c | goto label_1;
0x00405bac nop |
| label_0:
0x00405bb0 jalr t9 | t9 ();
0x00405bb4 nop |
0x00405bb8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00405bbc lui a1, 0x41 | a1 = 0x410000;
0x00405bc0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405bc4 addiu a0, zero, 3 | a0 = 3;
| /* str.cloud_ack:__s__strlen:__d__len:__d_n */
0x00405bc8 addiu a1, a1, 0x563c | a1 += 0x563c;
0x00405bcc move a2, s0 | a2 = s0;
0x00405bd0 move a3, v0 | a3 = v0;
0x00405bd4 sw s5, 0x10(sp) | *(var_10h) = s5;
0x00405bd8 jalr t9 | t9 ();
0x00405bdc lw gp, 0x18(sp) | gp = *(var_18h);
0x00405be0 lui a1, 0x41 | a1 = 0x410000;
0x00405be4 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x00405be8 move a0, s0 | a0 = s0;
| /* esilref: 'id' */
0x00405bec addiu a1, a1, 0x527c | a1 += 0x527c;
0x00405bf0 addiu a2, sp, 0x20 | a2 = sp + 0x20;
0x00405bf4 jalr t9 | t9 ();
0x00405bf8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00405bfc bgez v0, 0x405c20 |
0x00405c00 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405c04 lui a1, 0x41 | a1 = 0x410000;
0x00405c08 addiu a0, zero, 1 | a0 = 1;
| /* str.no_id_in_report_ack_msg:__s_n */
0x00405c0c addiu a1, a1, 0x5660 | a1 += 0x5660;
0x00405c10 move a2, s0 | a2 = s0;
0x00405c14 jalr t9 | t9 ();
0x00405c18 j 0x405c5c | goto label_1;
0x00405c1c move s4, zero | s4 = 0;
| }
0x00405c20 lw t9, -0x7f9c(gp) | t9 = sym.callback_queue_issue;
0x00405c24 lw a1, 0x20(sp) | a1 = *(var_20h);
0x00405c28 lui a0, 0x43 | a0 = miio_callback_queue;
| /* obj.miio_callback_queue */
0x00405c2c addiu a0, a0, -0x6680 |
0x00405c30 move a2, s0 | a2 = s0;
0x00405c34 jalr t9 | t9 ();
0x00405c38 lw gp, 0x18(sp) | gp = *(var_18h);
0x00405c3c lui a1, 0x41 | a1 = 0x410000;
0x00405c40 lw a2, 0x20(sp) | a2 = *(var_20h);
0x00405c44 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00405c48 addiu a0, zero, 3 | a0 = 3;
| /* str.callback_queue_issue___id:__d__ret:__d_n */
0x00405c4c addiu a1, a1, 0x5680 | a1 += 0x5680;
0x00405c50 move a3, v0 | a3 = v0;
0x00405c54 move s4, v0 | s4 = v0;
0x00405c58 jalr t9 | t9 ();
| label_1:
0x00405c5c lw ra, 0x44(sp) | ra = *(var_44h);
| }
0x00405c60 move v0, s4 | v0 = s4;
0x00405c64 lw s5, 0x40(sp) | s5 = *(var_40h);
0x00405c68 lw s4, 0x3c(sp) | s4 = *(var_3ch);
0x00405c6c lw s3, 0x38(sp) | s3 = *(var_38h);
0x00405c70 lw s2, 0x34(sp) | s2 = *(var_34h);
0x00405c74 lw s1, 0x30(sp) | s1 = *(var_30h);
0x00405c78 lw s0, 0x2c(sp) | s0 = *(var_2ch);
0x00405c7c addiu sp, sp, 0x48 |
0x00405c80 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 @ 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 @ 0x405fd4 */
| #include <stdint.h>
|
; (fcn) fcn.00405fd4 () | void fcn_00405fd4 () {
0x00405fd4 lui gp, 0x43 |
0x00405fd8 addiu sp, sp, -0x30 |
0x00405fdc addiu gp, gp, 0x1620 | gp += 0x1620;
0x00405fe0 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x00405fe4 sw s3, 0x28(sp) | *(var_28h) = s3;
0x00405fe8 move s3, a1 | s3 = a1;
0x00405fec lui a1, 0x41 | a1 = 0x410000;
0x00405ff0 sw s2, 0x24(sp) | *(var_24h) = s2;
0x00405ff4 sw s1, 0x20(sp) | *(var_20h) = s1;
0x00405ff8 sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x00405ffc sw gp, 0x10(sp) | *(var_10h) = gp;
0x00406000 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00406004 move s1, a0 | s1 = a0;
0x00406008 move s0, a2 | s0 = a2;
0x0040600c move a0, a3 | a0 = a3;
| /* str.local.prep_suspend */
0x00406010 addiu a1, a1, 0x582c | a1 += 0x582c;
0x00406014 addiu a2, zero, 0x12 | a2 = 0x12;
0x00406018 move s2, a3 | s2 = a3;
0x0040601c jalr t9 | t9 ();
0x00406020 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00406024 bnez v0, 0x406040 |
0x00406028 move a0, s1 | a0 = s1;
0x0040602c move a1, s3 | a1 = s3;
0x00406030 move a2, s0 | a2 = s0;
0x00406034 jal 0x404b64 | fcn_00404b64 ();
0x00406038 j 0x40612c | goto label_0;
0x0040603c lw ra, 0x2c(sp) | ra = *(var_2ch);
| }
0x00406040 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x00406044 lui a1, 0x41 | a1 = 0x410000;
0x00406048 move a0, s2 | a0 = s2;
| /* str.local.query_status */
0x0040604c addiu a1, a1, 0x5840 | a1 += 0x5840;
0x00406050 addiu a2, zero, 0x12 | a2 = 0x12;
0x00406054 jalr t9 | t9 ();
0x00406058 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040605c bnez v0, 0x406074 |
0x00406060 move a0, s1 | a0 = s1;
0x00406064 move a1, s0 | a1 = s0;
0x00406068 jal 0x4053e8 | fcn_004053e8 ();
0x0040606c j 0x40612c | goto label_0;
0x00406070 lw ra, 0x2c(sp) | ra = *(var_2ch);
| }
0x00406074 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x00406078 lui a1, 0x41 | a1 = 0x410000;
0x0040607c move a0, s2 | a0 = s2;
| /* str.local.query_time */
0x00406080 addiu a1, a1, 0x5854 | a1 += 0x5854;
0x00406084 addiu a2, zero, 0x10 | a2 = 0x10;
0x00406088 jalr t9 | t9 ();
0x0040608c lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00406090 bnez v0, 0x4060a8 |
0x00406094 move a0, s1 | a0 = s1;
0x00406098 move a1, s0 | a1 = s0;
0x0040609c jal 0x4054e4 | fcn_004054e4 ();
0x004060a0 j 0x40612c | goto label_0;
0x004060a4 lw ra, 0x2c(sp) | ra = *(var_2ch);
| }
0x004060a8 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x004060ac lui a1, 0x41 | a1 = 0x410000;
0x004060b0 move a0, s2 | a0 = s2;
| /* str.local.ble.config_router */
0x004060b4 addiu a1, a1, 0x5868 | a1 += 0x5868;
0x004060b8 addiu a2, zero, 0x17 | a2 = 0x17;
0x004060bc jalr t9 | t9 ();
0x004060c0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x004060c4 bnez v0, 0x4060dc |
0x004060c8 move a0, s1 | a0 = s1;
0x004060cc move a1, s0 | a1 = s0;
0x004060d0 jal 0x4058a0 | fcn_004058a0 ();
0x004060d4 j 0x40612c | goto label_0;
0x004060d8 lw ra, 0x2c(sp) | ra = *(var_2ch);
| }
0x004060dc lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x004060e0 lui a1, 0x41 | a1 = 0x410000;
0x004060e4 move a0, s2 | a0 = s2;
| /* str.local.query_country */
0x004060e8 addiu a1, a1, 0x5880 | a1 += 0x5880;
0x004060ec addiu a2, zero, 0x13 | a2 = 0x13;
0x004060f0 jalr t9 | t9 ();
0x004060f4 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x004060f8 bnez v0, 0x406110 |
0x004060fc move a0, s1 | a0 = s1;
0x00406100 move a1, s0 | a1 = s0;
0x00406104 jal 0x4055f0 | fcn_004055f0 ();
0x00406108 j 0x40612c | goto label_0;
0x0040610c lw ra, 0x2c(sp) | ra = *(var_2ch);
| }
0x00406110 lui a1, 0x41 | a1 = 0x410000;
0x00406114 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406118 addiu a0, zero, 1 | a0 = 1;
| /* str.Unknown_local_method:__s_n */
0x0040611c addiu a1, a1, 0x5894 | a1 += 0x5894;
0x00406120 move a2, s0 | a2 = s0;
0x00406124 jalr t9 | t9 ();
0x00406128 lw ra, 0x2c(sp) | ra = *(var_2ch);
| label_0:
0x0040612c lw s3, 0x28(sp) | s3 = *(var_28h);
0x00406130 lw s2, 0x24(sp) | s2 = *(var_24h);
0x00406134 lw s1, 0x20(sp) | s1 = *(var_20h);
0x00406138 lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x0040613c move v0, zero | v0 = 0;
0x00406140 addiu sp, sp, 0x30 |
0x00406144 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 @ 0x406208 */
| #include <stdint.h>
|
; (fcn) fcn.00406208 () | void fcn_00406208 () {
0x00406208 lui gp, 0x43 |
0x0040620c addiu gp, gp, 0x1620 |
0x00406210 addiu sp, sp, -0x940 |
0x00406214 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406218 addiu v0, zero, 0x80 | v0 = 0x80;
0x0040621c lui a1, 0x41 | a1 = "OT protocol diagrams come...\n";
| /* str.OT_protocol_diagrams_come..._n */
0x00406220 addiu a1, a1, 0x58b8 |
0x00406224 sw ra, 0x93c(sp) | *(var_93ch) = ra;
0x00406228 sw s6, 0x930(sp) | *(var_930h) = s6;
0x0040622c sw s3, 0x924(sp) | *(var_924h) = s3;
0x00406230 sw s2, 0x920(sp) | *(var_920h) = s2;
0x00406234 sw s0, 0x918(sp) | *(var_918h) = s0;
0x00406238 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0040623c move s3, a0 | s3 = a0;
0x00406240 sw v0, 0x90c(sp) | *(var_90ch) = v0;
0x00406244 addiu a0, zero, 2 | a0 = 2;
0x00406248 sw fp, 0x938(sp) | *(var_938h) = fp;
0x0040624c sw s7, 0x934(sp) | *(var_934h) = s7;
0x00406250 sw s5, 0x92c(sp) | *(var_92ch) = s5;
0x00406254 sw s4, 0x928(sp) | *(var_928h) = s4;
0x00406258 sw s1, 0x91c(sp) | *(var_91ch) = s1;
0x0040625c jalr t9 | t9 ();
0x00406260 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406264 addiu s6, sp, 0x420 | s6 = sp + 0x420;
0x00406268 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040626c move a0, s6 | a0 = s6;
0x00406270 move a1, zero | a1 = 0;
0x00406274 addiu a2, zero, 0x400 | a2 = 0x400;
0x00406278 jalr t9 | t9 ();
0x0040627c lw gp, 0x18(sp) | gp = *(var_18h);
0x00406280 addiu v0, sp, 0x90c | v0 = sp + 0x90c;
0x00406284 lw t9, -0x7d24(gp) | t9 = sym.imp.recvfrom;
0x00406288 addiu s2, sp, 0x820 | s2 = sp + 0x820;
0x0040628c move a3, zero | a3 = 0;
0x00406290 sw s2, 0x10(sp) | *(var_10h) = s2;
0x00406294 sw v0, 0x14(sp) | *(var_14h) = v0;
0x00406298 move a0, s3 | a0 = s3;
0x0040629c move a1, s6 | a1 = s6;
0x004062a0 addiu a2, zero, 0x400 | a2 = 0x400;
0x004062a4 jalr t9 | t9 ();
0x004062a8 addiu a3, zero, -1 | a3 = -1;
0x004062ac addiu s0, zero, 0x400 | s0 = 0x400;
0x004062b0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == a3) {
0x004062b4 beq v0, a3, 0x406db8 | goto label_0;
| }
0x004062b8 lhu v1, 0x422(sp) | v1 = *(var_422h);
| if (v0 == s0) {
0x004062bc bne v0, s0, 0x4062e8 |
0x004062c0 lw v0, -0x7e08(gp) | v0 = *((gp - 8066));
0x004062c4 lui a1, 0x41 | a1 = 0x410000;
0x004062c8 lw a0, (v0) | a0 = *(v0);
0x004062cc lw t9, -0x7d68(gp) | t9 = sym.imp.fprintf
0x004062d0 sb zero, 0x81f(sp) | *(var_81fh) = 0;
| /* str.WARN:_datagram_too_large_for_buffer__truncated:__s_n */
0x004062d4 addiu a1, a1, 0x58d8 | a1 += 0x58d8;
0x004062d8 move a2, s6 | a2 = s6;
0x004062dc jalr t9 | t9 ();
0x004062e0 j 0x406db0 | goto label_1;
0x004062e4 nop |
| }
0x004062e8 sll s7, v1, 8 | s7 = v1 << 8;
0x004062ec andi v1, v1, 0xffff | v1 &= 0xffff;
0x004062f0 srl v1, v1, 8 | v1 >>= 8;
0x004062f4 or v1, s7, v1 | v1 = s7 | v1;
0x004062f8 andi s7, v1, 0xffff | s7 = v1 & 0xffff;
0x004062fc sltiu v1, v0, 0x20 | v1 = (v0 < 0x20) ? 1 : 0;
0x00406300 lw s5, 0x90c(sp) | s5 = *(var_90ch);
| if (v1 == 0) {
0x00406304 bnez v1, 0x406318 |
0x00406308 sltiu v1, v0, 0x401 | v1 = (v0 < 0x401) ? 1 : 0;
| if (v0 != s7) {
0x0040630c bne v0, s7, 0x406318 | goto label_2;
| }
0x00406310 addiu v1, zero, 0x20 | v1 = 0x20;
| if (v1 != 0) {
0x00406314 bnez v1, 0x406350 | goto label_3;
| }
| }
| label_2:
0x00406318 lw v1, -0x7e08(gp) | v1 = *((gp - 8066));
0x0040631c lui a1, 0x41 | a1 = 0x410000;
0x00406320 lw a0, (v1) | a0 = *(v1);
0x00406324 lui a2, 0x41 | a2 = 0x410000;
0x00406328 lui a3, 0x41 | a3 = 0x410000;
0x0040632c lw t9, -0x7d68(gp) | t9 = sym.imp.fprintf
0x00406330 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00406334 sw s7, 0x14(sp) | *(var_14h) = s7;
| /* str._s:_s__received_diagram_error._count:__d__length:__d_n */
0x00406338 addiu a1, a1, 0x590c | a1 += 0x590c;
| /* str.miio_client.c */
0x0040633c addiu a2, a2, 0x5028 | a2 += 0x5028;
| /* str.smart_conn_recv_handler_datagram */
0x00406340 addiu a3, a3, 0x7cf0 | a3 += 0x7cf0;
0x00406344 jalr t9 | t9 ();
0x00406348 j 0x406694 | goto label_4;
0x0040634c nop |
| label_3:
0x00406350 lbu v1, 0x420(sp) | v1 = *(var_420h);
| if (v0 == v1) {
0x00406354 bne v0, v1, 0x40655c |
0x00406358 lw a2, 0x428(sp) | a2 = *(var_428h);
0x0040635c lui s0, 0xff | s0 = 0xff0000;
0x00406360 sll v1, a2, 0x18 | v1 = a2 << 0x18;
0x00406364 srl a0, a2, 0x18 | a0 = a2 >> 0x18;
0x00406368 and v0, a2, s0 | v0 = a2 & s0;
0x0040636c or a0, v1, a0 | a0 = v1 | a0;
0x00406370 srl v0, v0, 8 | v0 >>= 8;
0x00406374 lw a1, 0x424(sp) | a1 = *(var_424h);
0x00406378 or v1, a0, v0 | v1 = a0 | v0;
0x0040637c andi v0, a2, 0xff00 | v0 = a2 & 0xff00;
0x00406380 sll v0, v0, 8 | v0 <<= 8;
0x00406384 srl a0, a1, 0x18 | a0 = a1 >> 0x18;
0x00406388 or v0, v1, v0 | v0 = v1 | v0;
0x0040638c sll v1, a1, 0x18 | v1 = a1 << 0x18;
0x00406390 or a0, v1, a0 | a0 = v1 | a0;
0x00406394 and v1, a1, s0 | v1 = a1 & s0;
0x00406398 srl v1, v1, 8 | v1 >>= 8;
0x0040639c andi a1, a1, 0xff00 | a1 &= 0xff00;
0x004063a0 or v1, a0, v1 | v1 = a0 | v1;
0x004063a4 sll a1, a1, 8 | a1 <<= 8;
0x004063a8 lui s1, 0x43 | s1 = 0x430000;
0x004063ac or a1, v1, a1 | a1 = v1 | a1;
| /* obj.miio */
0x004063b0 addiu s1, s1, -0x6dd0 | s1 += -0x6dd0;
| if (v0 == a3) {
0x004063b4 bne v0, a3, 0x406430 |
0x004063b8 lbu v0, 0x20b(s1) | v0 = *((s1 + 523));
| if (a1 == v0) {
0x004063bc bnel a1, v0, 0x406434 | goto label_5;
| }
0x004063c0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004063c4 lui a1, 0x41 | a1 = 0x410000;
0x004063c8 addiu a0, zero, 2 | a0 = 2;
| /* str.Fill_my_DID_n */
0x004063cc addiu a1, a1, 0x5944 | a1 += 0x5944;
0x004063d0 jalr t9 | t9 ();
0x004063d4 lw v1, 0x2e4(s1) | v1 = *((s1 + 185));
0x004063d8 lw v0, 0x2e0(s1) | v0 = *((s1 + 184));
0x004063dc sll a0, v1, 0x18 | a0 = v1 << 0x18;
0x004063e0 srl a1, v1, 0x18 | a1 = v1 >> 0x18;
0x004063e4 or a1, a0, a1 | a1 = a0 | a1;
0x004063e8 and a0, v1, s0 | a0 = v1 & s0;
0x004063ec srl a0, a0, 8 | a0 >>= 8;
0x004063f0 andi v1, v1, 0xff00 | v1 &= 0xff00;
0x004063f4 or a0, a1, a0 | a0 = a1 | a0;
0x004063f8 sll v1, v1, 8 | v1 <<= 8;
0x004063fc or v1, a0, v1 | v1 = a0 | v1;
0x00406400 srl a1, v0, 0x18 | a1 = v0 >> 0x18;
0x00406404 sll a0, v0, 0x18 | a0 = v0 << 0x18;
0x00406408 and s0, v0, s0 | s0 = v0 & s0;
0x0040640c or a0, a0, a1 | a0 |= a1;
0x00406410 srl s0, s0, 8 | s0 >>= 8;
0x00406414 andi v0, v0, 0xff00 | v0 &= 0xff00;
0x00406418 or s0, a0, s0 | s0 = a0 | s0;
0x0040641c sll v0, v0, 8 | v0 <<= 8;
0x00406420 or v0, s0, v0 | v0 = s0 | v0;
0x00406424 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406428 sw v1, 0x424(sp) | *(var_424h) = v1;
0x0040642c sw v0, 0x428(sp) | *(var_428h) = v0;
| }
0x00406430 lbu v0, 0x20b(s1) | v0 = *((s1 + 523));
| label_5:
0x00406434 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
| if (v0 != 0) {
0x00406438 beqz v0, 0x4064c8 |
0x0040643c addiu s7, sp, 0x430 | s7 = sp + 0x430;
0x00406440 lui a1, 0x41 | a1 = 0x410000;
0x00406444 move a0, s7 | a0 = s7;
0x00406448 addiu a1, a1, 0x5954 | a1 += 0x5954;
0x0040644c addiu a2, zero, 0x10 | a2 = 0x10;
0x00406450 jalr t9 | t9 ();
0x00406454 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00406458 bnez v0, 0x4064c4 |
0x0040645c lui s4, 0x43 | s4 = 0x430000;
0x00406460 lw v1, -0x6eb0(s4) | v1 = *((s4 - 7084));
0x00406464 lui s0, 0x43 | s0 = 0x430000;
0x00406468 addiu v0, zero, 1 | v0 = 1;
0x0040646c addiu s0, s0, -0x667c | s0 += -0x667c;
| if (v1 == v0) {
0x00406470 bne v1, v0, 0x406490 |
0x00406474 lw t9, -0x7fbc(gp) | t9 = sym.rand_str;
0x00406478 move a0, s0 | a0 = s0;
0x0040647c addiu a1, zero, 0x10 | a1 = 0x10;
0x00406480 jalr t9 | t9 ();
0x00406484 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406488 sw zero, -0x6eb0(s4) | *((s4 - 7084)) = 0;
0x0040648c sb zero, 0x10(s0) | *((s0 + 16)) = 0;
| }
0x00406490 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406494 lw a2, -0x6eb0(s4) | a2 = *((s4 - 7084));
0x00406498 lui a1, 0x41 | a1 = 0x410000;
0x0040649c addiu a0, zero, 2 | a0 = 2;
| /* str.Fill_my_TOKEN_flag_is__d_n */
0x004064a0 addiu a1, a1, 0x5968 | a1 += 0x5968;
0x004064a4 jalr t9 | t9 ();
0x004064a8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004064ac move a0, s7 | a0 = s7;
0x004064b0 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x004064b4 move a1, s0 | a1 = s0;
0x004064b8 addiu a2, zero, 0x10 | a2 = 0x10;
0x004064bc jalr t9 | t9 ();
0x004064c0 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x004064c4 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
| }
0x004064c8 lui a1, 0x41 | a1 = 0x410000;
0x004064cc addiu a0, sp, 0x42c | a0 = sp + 0x42c;
0x004064d0 addiu a1, a1, 0x5960 | a1 += 0x5960;
0x004064d4 addiu a2, zero, 4 | a2 = 4;
0x004064d8 jalr t9 | t9 ();
0x004064dc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004064e0 bnez v0, 0x406538 |
0x004064e4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004064e8 lui a1, 0x41 | a1 = 0x410000;
0x004064ec addiu a0, zero, 2 | a0 = 2;
| /* str.Fill_my_TIMESTAMP_n */
0x004064f0 addiu a1, a1, 0x5984 | a1 += 0x5984;
0x004064f4 jalr t9 | t9 ();
0x004064f8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004064fc lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
0x00406500 jalr t9 | t9 ();
0x00406504 nop |
0x00406508 lw v1, 0x214(s1) | v1 = *((s1 + 133));
0x0040650c addu v0, v0, v1 | v0 += v1;
0x00406510 sll v1, v0, 0x18 | v1 = v0 << 0x18;
0x00406514 srl a0, v0, 0x18 | a0 = v0 >> 0x18;
0x00406518 or a0, v1, a0 | a0 = v1 | a0;
0x0040651c srl v1, v0, 8 | v1 = v0 >> 8;
0x00406520 andi v1, v1, 0xff00 | v1 &= 0xff00;
0x00406524 andi v0, v0, 0xff00 | v0 &= 0xff00;
0x00406528 or v1, a0, v1 | v1 = a0 | v1;
0x0040652c sll v0, v0, 8 | v0 <<= 8;
0x00406530 or v0, v1, v0 | v0 = v1 | v0;
0x00406534 sw v0, 0x42c(sp) | *(var_42ch) = v0;
| }
0x00406538 addiu v0, zero, 0x20 | v0 = 0x20;
0x0040653c sw v0, 0x10(sp) | *(var_10h) = v0;
0x00406540 move a0, s3 | a0 = s3;
0x00406544 move a1, s2 | a1 = s2;
0x00406548 move a2, s5 | a2 = s5;
0x0040654c move a3, s6 | a3 = s6;
0x00406550 jal 0x4056f0 | fcn_004056f0 ();
0x00406554 j 0x406db0 | goto label_1;
0x00406558 nop |
| }
0x0040655c addiu v0, zero, 0x21 | v0 = 0x21;
0x00406560 lbu v1, 0x421(sp) | v1 = *(var_421h);
| if (v1 == v0) {
0x00406564 bne v1, v0, 0x406574 |
0x00406568 addiu v0, zero, 0x31 | v0 = 0x31;
0x0040656c lw v1, 0x428(sp) | v1 = *(var_428h);
| if (v1 == v0) {
0x00406570 beq v1, v0, 0x406584 | goto label_6;
| }
| }
0x00406574 lui a1, 0x41 | a1 = 0x410000;
0x00406578 addiu a0, zero, 1 | a0 = 1;
0x0040657c j 0x406688 | goto label_7;
| /* str.OT_protocol_version_not_match._n */
0x00406580 addiu a1, a1, 0x5998 | a1 += 0x5998;
| label_6:
0x00406584 lui s0, 0xff | s0 = 0xff0000;
0x00406588 sll a0, v1, 0x18 | a0 = v1 << 0x18;
0x0040658c srl a1, v1, 0x18 | a1 = v1 >> 0x18;
0x00406590 or a1, a0, a1 | a1 = a0 | a1;
0x00406594 and a0, v1, s0 | a0 = v1 & s0;
0x00406598 lw v0, 0x424(sp) | v0 = *(var_424h);
0x0040659c srl a0, a0, 8 | a0 >>= 8;
0x004065a0 andi v1, v1, 0xff00 | v1 &= 0xff00;
0x004065a4 or a0, a1, a0 | a0 = a1 | a0;
0x004065a8 sll v1, v1, 8 | v1 <<= 8;
0x004065ac srl a1, v0, 0x18 | a1 = v0 >> 0x18;
0x004065b0 or v1, a0, v1 | v1 = a0 | v1;
0x004065b4 sll a0, v0, 0x18 | a0 = v0 << 0x18;
0x004065b8 or a1, a0, a1 | a1 = a0 | a1;
0x004065bc and a0, v0, s0 | a0 = v0 & s0;
0x004065c0 srl a0, a0, 8 | a0 >>= 8;
0x004065c4 andi v0, v0, 0xff00 | v0 &= 0xff00;
0x004065c8 or a0, a1, a0 | a0 = a1 | a0;
0x004065cc sll v0, v0, 8 | v0 <<= 8;
0x004065d0 or v0, a0, v0 | v0 = a0 | v0;
0x004065d4 lui a0, 0x43 | a0 = miio;
| /* obj.miio */
0x004065d8 addiu a0, a0, -0x6dd0 |
0x004065dc lw a1, 0x2e0(a0) | a1 = *((a0 + 184));
0x004065e0 lui a1, 0x41 | a1 = 0x410000;
| if (a1 != v1) {
0x004065e4 bnel a1, v1, 0x4065f8 |
0x004065e8 lw v1, 0x2e4(a0) | v1 = *((a0 + 185));
0x004065ec lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| if (v1 == v0) {
0x004065f0 beq v1, v0, 0x406604 | goto label_8;
| }
0x004065f4 lui a1, 0x41 | a1 = 0x410000;
| }
0x004065f8 addiu a0, zero, 1 | a0 = 1;
0x004065fc j 0x406688 | goto label_7;
| /* str.OT_device_id_not_match._n */
0x00406600 addiu a1, a1, 0x59b8 | a1 += 0x59b8;
| label_8:
0x00406604 addiu s1, sp, 0x430 | s1 = sp + 0x430;
0x00406608 addiu s4, sp, 0x8f0 | s4 = sp + 0x8f0;
0x0040660c move a1, s1 | a1 = s1;
0x00406610 move a0, s4 | a0 = s4;
0x00406614 addiu a2, zero, 0x10 | a2 = 0x10;
0x00406618 jalr t9 | t9 ();
0x0040661c lw gp, 0x18(sp) | gp = *(var_18h);
0x00406620 lui v1, 0x43 | v1 = 0x430000;
0x00406624 addiu fp, v1, -0x667c | fp = v1 + -0x667c;
0x00406628 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040662c move a0, s1 | a0 = s1;
0x00406630 sw v1, 0x914(sp) | *(var_914h) = v1;
0x00406634 move a1, fp | a1 = fp;
0x00406638 addiu a2, zero, 0x10 | a2 = 0x10;
0x0040663c jalr t9 | t9 ();
0x00406640 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406644 addiu s1, sp, 0x8e0 | s1 = sp + 0x8e0;
0x00406648 lw t9, -0x7fd4(gp) | t9 = sym.myMD5;
0x0040664c move a0, s6 | a0 = s6;
0x00406650 move a1, s7 | a1 = s7;
0x00406654 move a2, s1 | a2 = s1;
0x00406658 jalr t9 | t9 ();
0x0040665c lw gp, 0x18(sp) | gp = *(var_18h);
0x00406660 move a0, s4 | a0 = s4;
0x00406664 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x00406668 move a1, s1 | a1 = s1;
0x0040666c addiu a2, zero, 0x10 | a2 = 0x10;
0x00406670 jalr t9 | t9 ();
0x00406674 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00406678 beqz v0, 0x4066a4 |
0x0040667c lui a1, 0x41 | a1 = 0x410000;
0x00406680 addiu a0, zero, 1 | a0 = 1;
| /* str.OT_MD5_not_match._n */
0x00406684 addiu a1, a1, 0x59d4 | a1 += 0x59d4;
| label_7:
0x00406688 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040668c jalr t9 | t9 ();
0x00406690 nop |
| label_4:
0x00406694 move a0, s6 | a0 = s6;
0x00406698 jal 0x406148 | fcn_00406148 ();
0x0040669c j 0x406db0 | goto label_1;
0x004066a0 nop |
| }
0x004066a4 lw v0, 0x42c(sp) | v0 = *(var_42ch);
0x004066a8 lw t9, -0x7fd4(gp) | t9 = sym.myMD5;
0x004066ac sll v1, v0, 0x18 | v1 = v0 << 0x18;
0x004066b0 srl s4, v0, 0x18 | s4 = v0 >> 0x18;
0x004066b4 and s0, v0, s0 | s0 = v0 & s0;
0x004066b8 or s4, v1, s4 | s4 = v1 | s4;
0x004066bc srl s0, s0, 8 | s0 >>= 8;
0x004066c0 andi v0, v0, 0xff00 | v0 &= 0xff00;
0x004066c4 or s0, s4, s0 | s0 = s4 | s0;
0x004066c8 sll v0, v0, 8 | v0 <<= 8;
0x004066cc or v0, s0, v0 | v0 = s0 | v0;
0x004066d0 addiu s4, sp, 0x8d0 | s4 = sp + 0x8d0;
0x004066d4 move a0, fp | a0 = fp;
0x004066d8 sw v0, 0x910(sp) | *(var_910h) = v0;
0x004066dc addiu a1, zero, 0x10 | a1 = 0x10;
0x004066e0 move a2, s4 | a2 = s4;
0x004066e4 jalr t9 | t9 ();
0x004066e8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004066ec addiu s0, sp, 0x8a0 | s0 = sp + 0x8a0;
0x004066f0 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x004066f4 move a0, s0 | a0 = s0;
0x004066f8 move a1, s4 | a1 = s4;
0x004066fc addiu a2, zero, 0x10 | a2 = 0x10;
0x00406700 jalr t9 | t9 ();
0x00406704 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406708 move a1, fp | a1 = fp;
0x0040670c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00406710 addiu a0, sp, 0x8b0 | a0 = sp + 0x8b0;
0x00406714 addiu a2, zero, 0x10 | a2 = 0x10;
0x00406718 jalr t9 | t9 ();
0x0040671c lw gp, 0x18(sp) | gp = *(var_18h);
0x00406720 addiu v1, sp, 0x8c0 | v1 = sp + 0x8c0;
0x00406724 lw t9, -0x7fd4(gp) | t9 = sym.myMD5;
0x00406728 move a2, v1 | a2 = v1;
0x0040672c sw v1, 0x914(sp) | *(var_914h) = v1;
0x00406730 move a0, s0 | a0 = s0;
0x00406734 addiu a1, zero, 0x20 | a1 = 0x20;
0x00406738 jalr t9 | t9 ();
0x0040673c lw gp, 0x18(sp) | gp = *(var_18h);
0x00406740 addiu s1, s7, -0x20 | s1 = s7 + -0x20;
0x00406744 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x00406748 move a0, s1 | a0 = s1;
0x0040674c jalr t9 | t9 ();
0x00406750 move fp, v0 | fp = v0;
0x00406754 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406758 lw v1, 0x914(sp) | v1 = *(var_914h);
| if (v0 == 0) {
0x0040675c bnez v0, 0x406784 |
0x00406760 lui a0, 0x41 | a0 = 0x410000;
0x00406764 lui a1, 0x41 | a1 = 0x410000;
0x00406768 lui a3, 0x41 | a3 = 0x410000;
0x0040676c lw t9, -0x7e4c(gp) | t9 = sym.imp.__assert;
| /* str.decbuf_____void__0_ */
0x00406770 addiu a0, a0, 0x59e8 | a0 += 0x59e8;
| /* str.miio_client.c */
0x00406774 addiu a1, a1, 0x5028 | a1 += 0x5028;
0x00406778 addiu a2, zero, 0x907 | a2 = 0x907;
| /* esilref: 'smart_conn_recv_handler_datagram' */
0x0040677c addiu a3, a3, 0x7ccc | a3 += 0x7ccc;
0x00406780 jalr t9 | t9 ();
| }
0x00406784 lw t9, -0x7f94(gp) | t9 = sym.AES128_CBC_decrypt_buffer;
0x00406788 addiu s0, sp, 0x440 | s0 = sp + 0x440;
0x0040678c sw v1, 0x10(sp) | *(var_10h) = v1;
0x00406790 move a0, v0 | a0 = v0;
0x00406794 move a3, s4 | a3 = s4;
0x00406798 move a1, s0 | a1 = s0;
0x0040679c move a2, s1 | a2 = s1;
0x004067a0 jalr t9 | t9 ();
0x004067a4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004067a8 move a1, fp | a1 = fp;
0x004067ac lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x004067b0 move a0, s0 | a0 = s0;
0x004067b4 move a2, s1 | a2 = s1;
0x004067b8 jalr t9 | t9 ();
0x004067bc lw gp, 0x18(sp) | gp = *(var_18h);
0x004067c0 addiu s7, s7, -1 | s7 += -1;
0x004067c4 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x004067c8 move a0, fp | a0 = fp;
0x004067cc addu s6, s6, s7 | s6 += s7;
0x004067d0 jalr t9 | t9 ();
0x004067d4 lbu fp, (s6) | fp = *(s6);
0x004067d8 sltiu v0, fp, 0x11 | v0 = (fp < 0x11) ? 1 : 0;
0x004067dc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x004067e0 beqz v0, 0x4067ec |
0x004067e4 j 0x40680c | goto label_9;
0x004067e8 move v0, fp | v0 = fp;
| }
0x004067ec lui a1, 0x41 | a1 = 0x410000;
0x004067f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004067f4 addiu a0, zero, 1 | a0 = 1;
| /* str.OT_padding_panic__pad_len:__d_n */
0x004067f8 addiu a1, a1, 0x5a00 | a1 += 0x5a00;
0x004067fc move a2, fp | a2 = fp;
0x00406800 jalr t9 | t9 ();
0x00406804 j 0x406db0 | goto label_1;
0x00406808 nop |
| do {
| label_9:
0x0040680c addiu v0, v0, -1 | v0 += -1;
| if (v0 == 0) {
0x00406810 beqz v0, 0x406824 | goto label_10;
| }
0x00406814 sb zero, (s6) | *(s6) = 0;
0x00406818 andi v0, v0, 0xff | v0 &= 0xff;
0x0040681c j 0x40680c |
| } while (1);
0x00406820 addiu s6, s6, -1 | s6 += -1;
| label_10:
0x00406824 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x00406828 lui s6, 0x41 | s6 = 0x410000;
0x0040682c move a0, s0 | a0 = s0;
| /* esilref: 'id' */
0x00406830 addiu a1, s6, 0x527c | a1 = s6 + 0x527c;
0x00406834 addiu a2, sp, 0x908 | a2 = sp + 0x908;
0x00406838 jalr t9 | t9 ();
0x0040683c move s7, s6 | s7 = s6;
0x00406840 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00406844 bgez v0, 0x406858 |
0x00406848 lui a1, 0x41 | a1 = 0x410000;
0x0040684c move a0, zero | a0 = 0;
0x00406850 j 0x406bfc | goto label_11;
| /* str.id:json_verify_get_int_fail_n */
0x00406854 addiu a1, a1, 0x5a20 | a1 += 0x5a20;
| }
0x00406858 lw t9, -0x7f90(gp) | t9 = sym.is_mobile_msg_valid;
0x0040685c lw a0, 0x908(sp) | a0 = *(var_908h);
0x00406860 lw a1, 0x910(sp) | a1 = *(var_910h);
0x00406864 jalr t9 | t9 ();
0x00406868 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040686c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 < 0) {
0x00406870 bgez v0, 0x406894 |
0x00406874 lui a1, 0x41 | a1 = 0x410000;
0x00406878 lw a3, 0x908(sp) | a3 = *(var_908h);
0x0040687c addiu a0, zero, 3 | a0 = 3;
| /* str.look_like_a_repeated_msg:_d__d_n */
0x00406880 addiu a1, a1, 0x5a40 | a1 += 0x5a40;
0x00406884 move a2, v0 | a2 = v0;
0x00406888 jalr t9 | t9 ();
0x0040688c j 0x406db0 | goto label_1;
0x00406890 nop |
| }
0x00406894 lui a1, 0x41 | a1 = 0x410000;
0x00406898 lui s4, 0x41 | s4 = 0x410000;
| /* esilref: '&s
' */
0x0040689c addiu a1, a1, 0x6510 | a1 += 0x6510;
| /* str.handle_mobile_msg */
0x004068a0 addiu a2, s4, 0x7ca4 | a2 = s4 + 0x7ca4;
0x004068a4 addiu a0, zero, 2 | a0 = 2;
0x004068a8 sw zero, 0x904(sp) | *(var_904h) = 0;
0x004068ac sw zero, 0x900(sp) | *(var_900h) = 0;
0x004068b0 jalr t9 | t9 ();
0x004068b4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004068b8 move a0, s0 | a0 = s0;
0x004068bc lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004068c0 andi s1, s1, 0xffff | s1 &= 0xffff;
0x004068c4 jalr t9 | t9 ();
0x004068c8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004068cc subu s1, s1, fp | __asm ("subu s1, s1, fp");
0x004068d0 andi s1, s1, 0xffff | s1 &= 0xffff;
0x004068d4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004068d8 lui a1, 0x41 | a1 = 0x410000;
0x004068dc addiu a0, zero, 3 | a0 = 3;
| /* str._msg:__s__strlen:__d__len:__d_n */
0x004068e0 addiu a1, a1, 0x5a60 | a1 += 0x5a60;
0x004068e4 move a2, s0 | a2 = s0;
0x004068e8 move a3, v0 | a3 = v0;
0x004068ec sw s1, 0x10(sp) | *(var_10h) = s1;
0x004068f0 jalr t9 | t9 ();
0x004068f4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004068f8 lw t9, -0x7f8c(gp) | t9 = sym.json_verify;
0x004068fc move a0, s0 | a0 = s0;
0x00406900 jalr t9 | t9 ();
0x00406904 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x00406908 bltz v0, 0x406db0 |
0x0040690c lw t9, -0x7fa4(gp) | t9 = *((gp - 8169));
0x00406910 lui s1, 0x41 | s1 = 0x410000;
0x00406914 move a0, s0 | a0 = s0;
| /* str.method */
0x00406918 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
0x0040691c jalr t9 | t9 ();
0x00406920 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00406924 beqz v0, 0x406938 |
0x00406928 lui a1, 0x41 | a1 = 0x410000;
0x0040692c addiu a0, zero, 1 | a0 = 1;
0x00406930 j 0x406bfc | goto label_11;
| /* str.mobile_msg_not_commands__ignore..._n */
0x00406934 addiu a1, a1, 0x5a80 | a1 += 0x5a80;
| }
0x00406938 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040693c move a0, s0 | a0 = s0;
| /* esilref: 'id' */
0x00406940 addiu a1, s6, 0x527c | a1 = s6 + 0x527c;
0x00406944 addiu a2, sp, 0x904 | a2 = sp + 0x904;
0x00406948 jalr t9 | t9 ();
0x0040694c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00406950 bgez v0, 0x406964 |
0x00406954 lui a1, 0x41 | a1 = 0x410000;
0x00406958 move a0, zero | a0 = 0;
0x0040695c j 0x406bfc | goto label_11;
| /* str.json_verify_get_int_fail_n */
0x00406960 addiu a1, a1, 0x5aa4 | a1 += 0x5aa4;
| }
0x00406964 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00406968 addiu s6, sp, 0x20 | s6 = sp + 0x20;
0x0040696c move a0, s6 | a0 = s6;
0x00406970 move a1, zero | a1 = 0;
0x00406974 addiu a2, zero, 0x400 | a2 = 0x400;
0x00406978 jalr t9 | t9 ();
0x0040697c lw gp, 0x18(sp) | gp = *(var_18h);
0x00406980 lui a2, 0x41 | a2 = 0x410000;
0x00406984 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00406988 move a0, s0 | a0 = s0;
| /* str.method */
0x0040698c addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str.miIO.config_router */
0x00406990 addiu a2, a2, 0x5ac0 | a2 += 0x5ac0;
0x00406994 addiu a3, zero, 6 | a3 = 6;
0x00406998 jalr t9 | t9 ();
0x0040699c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004069a0 bnez v0, 0x4069e8 |
0x004069a4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004069a8 lui a1, 0x41 | a1 = 0x410000;
0x004069ac addiu a0, zero, 2 | a0 = 2;
| /* str.Got_miIO.config_router._n */
0x004069b0 addiu a1, a1, 0x5ad4 | a1 += 0x5ad4;
0x004069b4 jalr t9 | t9 ();
0x004069b8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004069bc move a0, s0 | a0 = s0;
0x004069c0 lw t9, -0x7fa8(gp) | t9 = sym.method_miio_config_router;
0x004069c4 move a1, s6 | a1 = s6;
0x004069c8 addiu a2, zero, 0x400 | a2 = 0x400;
0x004069cc jalr t9 | t9 ();
0x004069d0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x004069d4 bgez v0, 0x406d6c | goto label_12;
| }
0x004069d8 lui a1, 0x41 | a1 = 0x410000;
0x004069dc addiu a0, zero, 1 | a0 = 1;
0x004069e0 j 0x406bc4 | goto label_13;
| /* str.miIO.config_router_fail_n */
0x004069e4 addiu a1, a1, 0x5af0 | a1 += 0x5af0;
| }
0x004069e8 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x004069ec lui a2, 0x41 | a2 = 0x410000;
0x004069f0 move a0, s0 | a0 = s0;
| /* str.method */
0x004069f4 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str.miIO.wifi_assoc_state */
0x004069f8 addiu a2, a2, 0x5b0c | a2 += 0x5b0c;
0x004069fc addiu a3, zero, 6 | a3 = 6;
0x00406a00 jalr t9 | t9 ();
0x00406a04 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00406a08 bnez v0, 0x406a50 |
0x00406a0c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406a10 lui a1, 0x41 | a1 = 0x410000;
0x00406a14 addiu a0, zero, 2 | a0 = 2;
| /* str.Got_miIO.wifi_assoc_state._n */
0x00406a18 addiu a1, a1, 0x5b24 | a1 += 0x5b24;
0x00406a1c jalr t9 | t9 ();
0x00406a20 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406a24 move a0, s0 | a0 = s0;
0x00406a28 lw t9, -0x7f84(gp) | t9 = sym.method_miio_wifi_assoc_state;
0x00406a2c move a1, s6 | a1 = s6;
0x00406a30 addiu a2, zero, 0x400 | a2 = 0x400;
0x00406a34 jalr t9 | t9 ();
0x00406a38 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x00406a3c bgez v0, 0x406d6c | goto label_12;
| }
0x00406a40 lui a1, 0x41 | a1 = 0x410000;
0x00406a44 addiu a0, zero, 1 | a0 = 1;
0x00406a48 j 0x406bc4 | goto label_13;
| /* str.miIO.wifi_assoc_state_fail_n */
0x00406a4c addiu a1, a1, 0x5b40 | a1 += 0x5b40;
| }
0x00406a50 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00406a54 lui a2, 0x41 | a2 = 0x410000;
0x00406a58 move a0, s0 | a0 = s0;
| /* str.method */
0x00406a5c addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str.miIO.stop_diag_mode */
0x00406a60 addiu a2, a2, 0x5b5c | a2 += 0x5b5c;
0x00406a64 addiu a3, zero, 6 | a3 = 6;
0x00406a68 jalr t9 | t9 ();
0x00406a6c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00406a70 bnez v0, 0x406a84 |
0x00406a74 lui a1, 0x41 | a1 = 0x410000;
0x00406a78 addiu a0, zero, 2 | a0 = 2;
0x00406a7c j 0x406bc4 | goto label_13;
| /* str.Got_miIO.stop_diag_mode._n */
0x00406a80 addiu a1, a1, 0x5b70 | a1 += 0x5b70;
| }
0x00406a84 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00406a88 lui a2, 0x41 | a2 = 0x410000;
0x00406a8c move a0, s0 | a0 = s0;
| /* str.method */
0x00406a90 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str.miIO.config */
0x00406a94 addiu a2, a2, 0x5b8c | a2 += 0x5b8c;
0x00406a98 addiu a3, zero, 6 | a3 = 6;
0x00406a9c jalr t9 | t9 ();
0x00406aa0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00406aa4 bnez v0, 0x406aec |
0x00406aa8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406aac lui a1, 0x41 | a1 = 0x410000;
0x00406ab0 addiu a0, zero, 2 | a0 = 2;
| /* str.Got_miIO.config._n */
0x00406ab4 addiu a1, a1, 0x5b98 | a1 += 0x5b98;
0x00406ab8 jalr t9 | t9 ();
0x00406abc lw gp, 0x18(sp) | gp = *(var_18h);
0x00406ac0 move a0, s0 | a0 = s0;
0x00406ac4 lw t9, -0x7f80(gp) | t9 = sym.method_miio_config;
0x00406ac8 move a1, s6 | a1 = s6;
0x00406acc addiu a2, zero, 0x400 | a2 = 0x400;
0x00406ad0 jalr t9 | t9 ();
0x00406ad4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x00406ad8 bgez v0, 0x406d6c | goto label_12;
| }
0x00406adc lui a1, 0x41 | a1 = 0x410000;
0x00406ae0 addiu a0, zero, 1 | a0 = 1;
0x00406ae4 j 0x406bc4 | goto label_13;
| /* str.miIO.config_fail_n */
0x00406ae8 addiu a1, a1, 0x5bac | a1 += 0x5bac;
| }
0x00406aec lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00406af0 lui a2, 0x41 | a2 = 0x410000;
0x00406af4 move a0, s0 | a0 = s0;
| /* str.method */
0x00406af8 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str.miIO.info */
0x00406afc addiu a2, a2, 0x5bc0 | a2 += 0x5bc0;
0x00406b00 addiu a3, zero, 6 | a3 = 6;
0x00406b04 jalr t9 | t9 ();
0x00406b08 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00406b0c bnez v0, 0x406b5c |
0x00406b10 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406b14 lui a1, 0x41 | a1 = 0x410000;
0x00406b18 addiu a0, zero, 2 | a0 = 2;
| /* str.Got_miIO.info._n */
0x00406b1c addiu a1, a1, 0x5bcc | a1 += 0x5bcc;
0x00406b20 jalr t9 | t9 ();
0x00406b24 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406b28 lui a1, 0x43 | a1 = 0x430000;
0x00406b2c lw t9, -0x7f7c(gp) | t9 = sym.method_miio_info;
0x00406b30 move a0, s0 | a0 = s0;
0x00406b34 addiu a1, a1, -0x6af0 | a1 += -0x6af0;
0x00406b38 move a2, s6 | a2 = s6;
0x00406b3c addiu a3, zero, 0x400 | a3 = 0x400;
0x00406b40 jalr t9 | t9 ();
0x00406b44 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x00406b48 bgez v0, 0x406d6c | goto label_12;
| }
0x00406b4c lui a1, 0x41 | a1 = 0x410000;
0x00406b50 addiu a0, zero, 1 | a0 = 1;
0x00406b54 j 0x406bc4 | goto label_13;
| /* str.miIO.info_fail_n */
0x00406b58 addiu a1, a1, 0x5bdc | a1 += 0x5bdc;
| }
0x00406b5c lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00406b60 lui a1, 0x41 | a1 = 0x410000;
0x00406b64 lui a2, 0x41 | a2 = 0x410000;
0x00406b68 move a0, s0 | a0 = s0;
| /* str.method */
0x00406b6c addiu a1, a1, 0x55d4 | a1 += 0x55d4;
| /* str.miIO.config_tz */
0x00406b70 addiu a2, a2, 0x5bec | a2 += 0x5bec;
0x00406b74 addiu a3, zero, 6 | a3 = 6;
0x00406b78 jalr t9 | t9 ();
0x00406b7c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00406b80 bnez v0, 0x406bd8 |
0x00406b84 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406b88 lui a1, 0x41 | a1 = 0x410000;
0x00406b8c addiu a0, zero, 2 | a0 = 2;
| /* str.set_miIO.config_tz._n */
0x00406b90 addiu a1, a1, 0x5bfc | a1 += 0x5bfc;
0x00406b94 jalr t9 | t9 ();
0x00406b98 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406b9c move a0, s0 | a0 = s0;
0x00406ba0 lw t9, -0x7f78(gp) | t9 = sym.method_miio_config_tz;
0x00406ba4 move a1, s6 | a1 = s6;
0x00406ba8 addiu a2, zero, 0x400 | a2 = 0x400;
0x00406bac jalr t9 | t9 ();
0x00406bb0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x00406bb4 bgez v0, 0x406d6c | goto label_12;
| }
0x00406bb8 lui a1, 0x41 | a1 = 0x410000;
0x00406bbc addiu a0, zero, 1 | a0 = 1;
| /* str.miIO.config_tz_fail_n */
0x00406bc0 addiu a1, a1, 0x5c14 | a1 += 0x5c14;
| label_13:
0x00406bc4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406bc8 jalr t9 | t9 ();
0x00406bcc nop |
0x00406bd0 j 0x406d70 | goto label_14;
0x00406bd4 lui v0, 0x43 | v0 = 0x430000;
| }
0x00406bd8 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x00406bdc addiu a0, zero, 0x10 | a0 = 0x10;
0x00406be0 jalr t9 | t9 ();
0x00406be4 move s6, v0 | s6 = v0;
0x00406be8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00406bec bnez v0, 0x406c10 |
0x00406bf0 lui a1, 0x41 | a1 = 0x410000;
0x00406bf4 move a0, zero | a0 = 0;
| /* esilref: 'malloc fail
' */
0x00406bf8 addiu a1, a1, 0x544c | a1 += 0x544c;
| label_11:
0x00406bfc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406c00 jalr t9 | t9 ();
0x00406c04 nop |
0x00406c08 j 0x406db0 | goto label_1;
0x00406c0c nop |
| }
0x00406c10 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x00406c14 addiu a0, zero, 0x10 | a0 = 0x10;
0x00406c18 jalr t9 | t9 ();
0x00406c1c lw gp, 0x18(sp) | gp = *(var_18h);
0x00406c20 move s1, v0 | s1 = v0;
0x00406c24 sw zero, 4(v0) | *((v0 + 1)) = 0;
0x00406c28 sw zero, 8(v0) | *((v0 + 2)) = 0;
0x00406c2c lw v0, 0x904(sp) | v0 = *(var_904h);
0x00406c30 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x00406c34 sw s3, 0xc(s1) | *((s1 + 3)) = s3;
0x00406c38 sw v0, (s1) | *(s1) = v0;
0x00406c3c addiu a0, zero, 0x10 | a0 = 0x10;
0x00406c40 jalr t9 | t9 ();
0x00406c44 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406c48 addiu a2, zero, 0x10 | a2 = 0x10;
0x00406c4c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00406c50 move a1, s2 | a1 = s2;
0x00406c54 move a0, v0 | a0 = v0;
0x00406c58 sw v0, 4(s1) | *((s1 + 1)) = v0;
0x00406c5c jalr t9 | t9 ();
0x00406c60 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406c64 lw t9, -0x7f74(gp) | t9 = sym.generate_random_id;
0x00406c68 sw s5, 8(s1) | *((s1 + 2)) = s5;
0x00406c6c jalr t9 | t9 ();
0x00406c70 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406c74 sw v0, (s6) | *(s6) = v0;
0x00406c78 lui v0, 0x40 | v0 = 0x405760;
0x00406c7c addiu v0, v0, 0x5760 |
0x00406c80 lw t9, -0x7f70(gp) | t9 = sym.callback_queue_add;
0x00406c84 lui a0, 0x43 | a0 = 0x430000;
0x00406c88 move a1, s6 | a1 = s6;
0x00406c8c sw s1, 8(s6) | *((s6 + 2)) = s1;
0x00406c90 sw v0, 4(s6) | *((s6 + 1)) = v0;
| /* obj.miio_callback_queue */
0x00406c94 addiu a0, a0, -0x6680 | a0 += -0x6680;
0x00406c98 jalr t9 | t9 ();
0x00406c9c lw gp, 0x18(sp) | gp = *(var_18h);
0x00406ca0 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x00406ca4 move a0, s0 | a0 = s0;
0x00406ca8 jalr t9 | t9 ();
0x00406cac lw gp, 0x18(sp) | gp = *(var_18h);
| /* esilref: 'id' */
0x00406cb0 addiu a1, s7, 0x527c | a1 = s7 + 0x527c;
0x00406cb4 lw t9, -0x7db4(gp) | t9 = sym.imp.json_object_object_del;
0x00406cb8 move a0, v0 | a0 = v0;
0x00406cbc move s0, v0 | s0 = v0;
0x00406cc0 jalr t9 | t9 ();
0x00406cc4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406cc8 lw t9, -0x7d88(gp) | t9 = sym.imp.json_object_new_int;
0x00406ccc lw a0, (s6) | a0 = *(s6);
0x00406cd0 jalr t9 | t9 ();
0x00406cd4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406cd8 move a2, v0 | a2 = v0;
0x00406cdc lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x00406ce0 move a0, s0 | a0 = s0;
| /* esilref: 'id' */
0x00406ce4 addiu a1, s7, 0x527c | a1 = s7 + 0x527c;
0x00406ce8 jalr t9 | t9 ();
0x00406cec lw gp, 0x18(sp) | gp = *(var_18h);
0x00406cf0 move a0, s0 | a0 = s0;
0x00406cf4 lw t9, -0x7d08(gp) | t9 = sym.imp.json_object_to_json_string_ext;
0x00406cf8 move a1, zero | a1 = 0;
0x00406cfc jalr t9 | t9 ();
0x00406d00 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406d04 move a0, v0 | a0 = v0;
0x00406d08 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00406d0c move s1, v0 | s1 = v0;
0x00406d10 jalr t9 | t9 ();
0x00406d14 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406d18 lui a1, 0x41 | a1 = 0x410000;
0x00406d1c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| /* str.handle_mobile_msg */
0x00406d20 addiu a2, s4, 0x7ca4 | a2 = s4 + 0x7ca4;
0x00406d24 move a3, s1 | a3 = s1;
0x00406d28 sw v0, 0x10(sp) | *(var_10h) = v0;
| /* str._s__newmsg:__s__strlen:__d_n */
0x00406d2c addiu a1, a1, 0x5c2c | a1 += 0x5c2c;
0x00406d30 addiu a0, zero, 3 | a0 = 3;
0x00406d34 jalr t9 | t9 ();
0x00406d38 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406d3c lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00406d40 move a0, s1 | a0 = s1;
0x00406d44 jalr t9 | t9 ();
0x00406d48 move a1, v0 | a1 = v0;
0x00406d4c move a0, s1 | a0 = s1;
0x00406d50 jal 0x4059f8 | fcn_004059f8 ();
0x00406d54 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406d58 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x00406d5c move a0, s0 | a0 = s0;
0x00406d60 jalr t9 | t9 ();
0x00406d64 j 0x406db0 | goto label_1;
0x00406d68 nop |
| label_12:
0x00406d6c lui v0, 0x43 | v0 = 0x430000;
| label_14:
0x00406d70 move a0, s6 | a0 = s6;
0x00406d74 addiu a1, sp, 0x900 | a1 = sp + 0x900;
0x00406d78 addiu a2, v0, -0x667c | a2 = v0 + -0x667c;
0x00406d7c jal 0x404180 | fcn_00404180 ();
0x00406d80 move s0, v0 | s0 = v0;
0x00406d84 lw v0, 0x900(sp) | v0 = *(var_900h);
0x00406d88 move a0, s3 | a0 = s3;
0x00406d8c sw v0, 0x10(sp) | *(var_10h) = v0;
0x00406d90 move a1, s2 | a1 = s2;
0x00406d94 move a2, s5 | a2 = s5;
0x00406d98 move a3, s0 | a3 = s0;
0x00406d9c jal 0x4056f0 | fcn_004056f0 ();
0x00406da0 lw gp, 0x18(sp) | gp = *(var_18h);
0x00406da4 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00406da8 move a0, s0 | a0 = s0;
0x00406dac jalr t9 | t9 ();
| }
| label_1:
0x00406db0 j 0x406dbc | goto label_15;
0x00406db4 move v0, zero | v0 = 0;
| label_0:
0x00406db8 addiu v0, zero, -1 | v0 = -1;
| label_15:
0x00406dbc lw ra, 0x93c(sp) | ra = *(var_93ch);
0x00406dc0 lw fp, 0x938(sp) | fp = *(var_938h);
0x00406dc4 lw s7, 0x934(sp) | s7 = *(var_934h);
0x00406dc8 lw s6, 0x930(sp) | s6 = *(var_930h);
0x00406dcc lw s5, 0x92c(sp) | s5 = *(var_92ch);
0x00406dd0 lw s4, 0x928(sp) | s4 = *(var_928h);
0x00406dd4 lw s3, 0x924(sp) | s3 = *(var_924h);
0x00406dd8 lw s2, 0x920(sp) | s2 = *(var_920h);
0x00406ddc lw s1, 0x91c(sp) | s1 = *(var_91ch);
0x00406de0 lw s0, 0x918(sp) | s0 = *(var_918h);
0x00406de4 addiu sp, sp, 0x940 |
0x00406de8 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 @ 0x406dec */
| #include <stdint.h>
|
; (fcn) fcn.00406dec () | void fcn_00406dec () {
0x00406dec lui gp, 0x43 |
0x00406df0 addiu sp, sp, -0x30 |
0x00406df4 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00406df8 sll a1, a1, 0x10 | a1 <<= 0x10;
0x00406dfc move a2, a0 | a2 = a0;
0x00406e00 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00406e04 sw s3, 0x28(sp) | *(var_28h) = s3;
0x00406e08 sw s2, 0x24(sp) | *(var_24h) = s2;
0x00406e0c sw s1, 0x20(sp) | *(var_20h) = s1;
0x00406e10 sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x00406e14 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00406e18 sra a1, a1, 0x10 | a1 >>= 0x10;
| if (a0 < 0) {
0x00406e1c bgez a0, 0x406e4c |
0x00406e20 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00406e24 lw s3, 0x28(sp) | s3 = *(var_28h);
0x00406e28 lw s2, 0x24(sp) | s2 = *(var_24h);
0x00406e2c lw s1, 0x20(sp) | s1 = *(var_20h);
0x00406e30 lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x00406e34 lui a1, 0x41 | a1 = 0x410000;
0x00406e38 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406e3c addiu a0, zero, 1 | a0 = 1;
| /* str.fd__d____0__cannot_poll_n */
0x00406e40 addiu a1, a1, 0x5c48 | a1 += 0x5c48;
0x00406e44 addiu sp, sp, 0x30 |
0x00406e48 jr t9 | t9 ();
| }
0x00406e4c lui s0, 0x43 | s0 = miio;
| /* obj.miio */
0x00406e50 addiu s0, s0, -0x6dd0 |
0x00406e54 lw v1, 0x194(s0) | v1 = *((s0 + 101));
0x00406e58 move a3, zero | a3 = 0;
| if (v1 == 0) {
0x00406e5c beqz v1, 0x406ef0 | goto label_0;
| }
| do {
0x00406e60 slt v0, a3, v1 | v0 = (a3 < v1) ? 1 : 0;
0x00406e64 sll v0, a3, 3 | v0 = a3 << 3;
| if (v0 == 0) {
0x00406e68 beqz v0, 0x406e88 | goto label_1;
| }
0x00406e6c addu v0, s0, v0 | v0 = s0 + v0;
0x00406e70 lw a0, 4(v0) | a0 = *((v0 + 1));
0x00406e74 addiu a3, a3, 1 | a3++;
0x00406e78 bnel a0, a2, 0x406e60 |
| } while (a0 == a2);
0x00406e7c lhu a0, 8(v0) | a0 = *((v0 + 4));
0x00406e80 or a1, a1, a0 | a1 |= a0;
0x00406e84 sh a1, 8(v0) | *((v0 + 4)) = a1;
| label_1:
0x00406e88 lw ra, 0x2c(sp) | ra = *(var_2ch);
| if (a3 != v1) {
0x00406e8c bne a3, v1, 0x406ef4 | goto label_2;
| }
0x00406e90 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406e94 lui a1, 0x41 | a1 = 0x410000;
0x00406e98 addiu a0, zero, 1 | a0 = 1;
| /* str.can_not_find_poll_fd__d__to_add_event._count_pollfds:__d_n */
0x00406e9c addiu a1, a1, 0x5c64 | a1 += 0x5c64;
0x00406ea0 jalr t9 | t9 ();
0x00406ea4 lui s2, 0x41 | s2 = 0x410000;
0x00406ea8 lw gp, 0x10(sp) | gp = *(var_10h);
0x00406eac move s1, zero | s1 = 0;
0x00406eb0 move s3, s0 | s3 = s0;
| /* str.pollfds__d_:__d_n */
0x00406eb4 addiu s2, s2, 0x5ca0 | s2 += 0x5ca0;
| do {
0x00406eb8 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00406ebc slt v0, s1, v0 | v0 = (s1 < v0) ? 1 : 0;
0x00406ec0 sll v0, s1, 3 | v0 = s1 << 3;
| if (v0 == 0) {
0x00406ec4 beqz v0, 0x406ef0 | goto label_0;
| }
0x00406ec8 addu v0, s3, v0 | v0 = s3 + v0;
0x00406ecc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406ed0 lw a3, 4(v0) | a3 = *((v0 + 1));
0x00406ed4 move a2, s1 | a2 = s1;
0x00406ed8 addiu a0, zero, 1 | a0 = 1;
0x00406edc move a1, s2 | a1 = s2;
0x00406ee0 jalr t9 | t9 ();
0x00406ee4 addiu s1, s1, 1 | s1++;
0x00406ee8 j 0x406eb8 |
| } while (1);
0x00406eec lw gp, 0x10(sp) | gp = *(var_10h);
| label_0:
0x00406ef0 lw ra, 0x2c(sp) | ra = *(var_2ch);
| label_2:
0x00406ef4 lw s3, 0x28(sp) | s3 = *(var_28h);
0x00406ef8 lw s2, 0x24(sp) | s2 = *(var_24h);
0x00406efc lw s1, 0x20(sp) | s1 = *(var_20h);
0x00406f00 lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x00406f04 addiu sp, sp, 0x30 |
0x00406f08 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 @ 0x406f0c */
| #include <stdint.h>
|
; (fcn) fcn.00406f0c () | void fcn_00406f0c () {
0x00406f0c addiu sp, sp, -0x40 |
0x00406f10 sw s1, 0x28(sp) | *(var_28h) = s1;
0x00406f14 lui s1, 0x43 | s1 = miio;
| /* obj.miio */
0x00406f18 addiu s1, s1, -0x6dd0 |
0x00406f1c lui gp, 0x43 |
0x00406f20 lw v0, 0x2c0(s1) | v0 = *((s1 + 176));
0x00406f24 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00406f28 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x00406f2c sw s5, 0x38(sp) | *(var_38h) = s5;
0x00406f30 sw s4, 0x34(sp) | *(var_34h) = s4;
0x00406f34 sw s3, 0x30(sp) | *(var_30h) = s3;
0x00406f38 sw s2, 0x2c(sp) | *(var_2ch) = s2;
0x00406f3c sw s0, 0x24(sp) | *(var_24h) = s0;
0x00406f40 sw gp, 0x18(sp) | *(var_18h) = gp;
| if (v0 == 0) {
0x00406f44 bnez v0, 0x406f64 |
0x00406f48 lui a1, 0x41 | a1 = 0x410000;
0x00406f4c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406f50 addiu a0, zero, 1 | a0 = 1;
| /* str.Were_offline_now__cant_report_msg__id:__d_n */
0x00406f54 addiu a1, a1, 0x5cb4 | a1 += 0x5cb4;
0x00406f58 jalr t9 | t9 ();
0x00406f5c j 0x406fa0 | goto label_0;
0x00406f60 nop |
| }
0x00406f64 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x00406f68 move s5, a0 | s5 = a0;
0x00406f6c addiu a0, zero, 0x20 | a0 = 0x20;
0x00406f70 move s2, a1 | s2 = a1;
0x00406f74 move s3, a2 | s3 = a2;
0x00406f78 move s4, a3 | s4 = a3;
0x00406f7c jalr t9 | t9 ();
0x00406f80 move s0, v0 | s0 = v0;
0x00406f84 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00406f88 bnez v0, 0x406fa8 |
0x00406f8c lui a1, 0x41 | a1 = 0x410000;
0x00406f90 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00406f94 move a0, zero | a0 = 0;
| /* str.malloc_fail:__m */
0x00406f98 addiu a1, a1, 0x5ce4 | a1 += 0x5ce4;
0x00406f9c jalr t9 | t9 ();
| label_0:
0x00406fa0 j 0x407078 | goto label_1;
0x00406fa4 addiu v0, zero, -1 | v0 = -1;
| }
0x00406fa8 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00406fac move a0, v0 | a0 = v0;
0x00406fb0 move a1, zero | a1 = 0;
0x00406fb4 addiu a2, zero, 0x20 | a2 = 0x20;
0x00406fb8 jalr t9 | t9 ();
0x00406fbc lw gp, 0x18(sp) | gp = *(var_18h);
0x00406fc0 sw s5, 4(s0) | *((s0 + 1)) = s5;
0x00406fc4 sw s2, 8(s0) | *((s0 + 2)) = s2;
0x00406fc8 sw s3, (s0) | *(s0) = s3;
| if (s4 != 0) {
0x00406fcc beqz s4, 0x407014 |
0x00406fd0 lw t9, -0x7f6c(gp) | t9 = sym.get_micro_second;
0x00406fd4 sw zero, 0xc(s0) | *((s0 + 3)) = 0;
0x00406fd8 jalr t9 | t9 ();
0x00406fdc lw gp, 0x18(sp) | gp = *(var_18h);
0x00406fe0 move a0, v0 | a0 = v0;
0x00406fe4 lw t9, -0x7f68(gp) | t9 = sym.__udivdi3;
0x00406fe8 move a1, v1 | a1 = v1;
0x00406fec addiu a2, zero, 0x3e8 | a2 = 0x3e8;
0x00406ff0 move a3, zero | a3 = 0;
0x00406ff4 jalr t9 | t9 ();
0x00406ff8 addiu a0, v0, 0xbb8 | a0 = v0 + 0xbb8;
0x00406ffc sltu v0, a0, v0 | v0 = (a0 < v0) ? 1 : 0;
0x00407000 addu v1, v0, v1 | v1 = v0 + v1;
0x00407004 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407008 sw a0, 0x10(s0) | *((s0 + 4)) = a0;
0x0040700c j 0x407024 | goto label_2;
0x00407010 sw v1, 0x14(s0) | *((s0 + 5)) = v1;
| }
0x00407014 addiu v0, zero, -1 | v0 = -1;
0x00407018 sw v0, 0xc(s0) | *((s0 + 3)) = v0;
0x0040701c sw zero, 0x10(s0) | *((s0 + 4)) = 0;
0x00407020 sw zero, 0x14(s0) | *((s0 + 5)) = 0;
| label_2:
0x00407024 lw v0, 0x3ac(s1) | v0 = *((s1 + 235));
0x00407028 sw zero, 0x18(s0) | *((s0 + 6)) = 0;
| if (v0 == 0) {
| do {
0x0040702c beql v0, zero, 0x407048 | goto label_3;
| }
0x00407030 sw s0, 0x3ac(s1) | *((s1 + 235)) = s0;
0x00407034 lw v1, 0x18(v0) | v1 = *((v0 + 6));
| if (v1 == 0) {
0x00407038 beql v1, zero, 0x407048 | goto label_3;
| }
0x0040703c sw s0, 0x18(v0) | *((v0 + 6)) = s0;
0x00407040 j 0x40702c |
| } while (1);
0x00407044 move v0, v1 | v0 = v1;
| label_3:
0x00407048 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040704c lui a1, 0x41 | a1 = 0x410000;
0x00407050 addiu a0, zero, 4 | a0 = 4;
| /* str.data_desc_added___id:__d__len:__d__retry:__d_n */
0x00407054 addiu a1, a1, 0x5cf4 | a1 += 0x5cf4;
0x00407058 move a2, s3 | a2 = s3;
0x0040705c move a3, s2 | a3 = s2;
0x00407060 sw s4, 0x10(sp) | *(var_10h) = s4;
0x00407064 jalr t9 | t9 ();
0x00407068 lw a0, 0x2c0(s1) | a0 = *((s1 + 176));
0x0040706c addiu a1, zero, 4 | a1 = 4;
0x00407070 jal 0x406dec | fcn_00406dec ();
0x00407074 move v0, zero | v0 = 0;
| label_1:
0x00407078 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x0040707c lw s5, 0x38(sp) | s5 = *(var_38h);
0x00407080 lw s4, 0x34(sp) | s4 = *(var_34h);
0x00407084 lw s3, 0x30(sp) | s3 = *(var_30h);
0x00407088 lw s2, 0x2c(sp) | s2 = *(var_2ch);
0x0040708c lw s1, 0x28(sp) | s1 = *(var_28h);
0x00407090 lw s0, 0x24(sp) | s0 = *(var_24h);
0x00407094 addiu sp, sp, 0x40 |
0x00407098 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 @ 0x40709c */
| #include <stdint.h>
|
; (fcn) fcn.0040709c () | void fcn_0040709c () {
0x0040709c lui gp, 0x43 |
0x004070a0 addiu gp, gp, 0x1620 |
0x004070a4 addiu sp, sp, -0x20 |
0x004070a8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004070ac lui a1, 0x41 | a1 = 0x410000;
0x004070b0 addiu a0, zero, 2 | a0 = 2;
0x004070b4 sw ra, 0x1c(sp) | *(var_1ch) = ra;
0x004070b8 sw s0, 0x18(sp) | *(var_18h) = s0;
0x004070bc sw gp, 0x10(sp) | *(var_10h) = gp;
| /* str.report_synctime_n */
0x004070c0 addiu a1, a1, 0x5d24 | a1 += 0x5d24;
0x004070c4 jalr t9 | t9 ();
0x004070c8 lw gp, 0x10(sp) | gp = *(var_10h);
0x004070cc lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x004070d0 addiu a0, zero, 0x20 | a0 = 0x20;
0x004070d4 jalr t9 | t9 ();
0x004070d8 move s0, v0 | s0 = v0;
0x004070dc lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x004070e0 bnez v0, 0x407100 |
0x004070e4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004070e8 lui a1, 0x41 | a1 = 0x410000;
0x004070ec move a0, zero | a0 = 0;
| /* str.malloc_error:__m_n */
0x004070f0 addiu a1, a1, 0x5d38 | a1 += 0x5d38;
0x004070f4 jalr t9 | t9 ();
0x004070f8 j 0x407150 | goto label_0;
0x004070fc addiu v0, zero, -1 | v0 = -1;
| }
0x00407100 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00407104 move a0, v0 | a0 = v0;
0x00407108 move a1, zero | a1 = 0;
0x0040710c addiu a2, zero, 0x20 | a2 = 0x20;
0x00407110 jalr t9 | t9 ();
0x00407114 addiu v0, zero, 0x21 | v0 = 0x21;
0x00407118 sb v0, (s0) | *(s0) = v0;
0x0040711c addiu v0, zero, 0x31 | v0 = 0x31;
0x00407120 sb v0, 1(s0) | *((s0 + 1)) = v0;
0x00407124 addiu v0, zero, 0x2000 | v0 = 0x2000;
0x00407128 sh v0, 2(s0) | *((s0 + 1)) = v0;
0x0040712c move a0, s0 | a0 = s0;
0x00407130 addiu v0, zero, -1 | v0 = -1;
0x00407134 addiu a1, zero, 0x20 | a1 = 0x20;
0x00407138 move a2, zero | a2 = 0;
0x0040713c move a3, zero | a3 = 0;
0x00407140 sw v0, 4(s0) | *((s0 + 1)) = v0;
0x00407144 sw v0, 8(s0) | *((s0 + 2)) = v0;
0x00407148 jal 0x406f0c | fcn_00406f0c ();
0x0040714c move v0, zero | v0 = 0;
| label_0:
0x00407150 lw ra, 0x1c(sp) | ra = *(var_1ch);
0x00407154 lw s0, 0x18(sp) | s0 = *(var_18h);
0x00407158 addiu sp, sp, 0x20 |
0x0040715c 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 @ 0x407250 */
| #include <stdint.h>
|
; (fcn) fcn.00407250 () | void fcn_00407250 () {
0x00407250 lui gp, 0x43 |
0x00407254 lui a0, 0x43 | a0 = 0x430000;
0x00407258 addiu sp, sp, -0x68 |
0x0040725c addiu gp, gp, 0x1620 | gp += 0x1620;
0x00407260 addiu a0, a0, -0x6b60 | a0 += -0x6b60;
0x00407264 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00407268 sw ra, 0x64(sp) | *(var_64h) = ra;
0x0040726c sw s1, 0x50(sp) | *(var_50h) = s1;
0x00407270 sw s0, 0x4c(sp) | *(var_4ch) = s0;
0x00407274 sw s5, 0x60(sp) | *(var_60h) = s5;
0x00407278 sw s4, 0x5c(sp) | *(var_5ch) = s4;
0x0040727c sw s3, 0x58(sp) | *(var_58h) = s3;
0x00407280 sw s2, 0x54(sp) | *(var_54h) = s2;
0x00407284 jal 0x407160 | sym_free_server_list ();
0x00407288 lui a0, 0x43 | a0 = 0x4294a4;
0x0040728c addiu a0, a0, -0x6b5c |
0x00407290 jal 0x407160 | sym_free_server_list ();
0x00407294 addiu a0, zero, 2 | a0 = 2;
0x00407298 jal 0x404f7c | fcn_00404f7c ();
0x0040729c addiu a0, zero, 1 | a0 = 1;
0x004072a0 jal 0x404f7c | fcn_00404f7c ();
0x004072a4 lui v0, 0x43 | v0 = miio;
| /* obj.miio */
0x004072a8 addiu v0, v0, -0x6dd0 |
0x004072ac lw s1, 0x270(v0) | s1 = *((v0 + 156));
0x004072b0 lw gp, 0x10(sp) | gp = *(var_10h);
0x004072b4 move s0, v0 | s0 = v0;
| if (s1 == 0) {
0x004072b8 bnez s1, 0x4072e4 |
0x004072bc lw v0, 0x274(v0) | v0 = *((v0 + 157));
0x004072c0 lw s2, 0x274(s0) | s2 = *((s0 + 157));
| if (v0 == 0) {
0x004072c4 bnel v0, zero, 0x407350 | goto label_1;
| }
0x004072c8 lui a1, 0x41 | a1 = 0x410000;
0x004072cc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004072d0 addiu a0, zero, 1 | a0 = 1;
| /* str.no_server_detected._n */
0x004072d4 addiu a1, a1, 0x5d4c | a1 += 0x5d4c;
0x004072d8 jalr t9 | t9 ();
0x004072dc j 0x40731c | goto label_0;
0x004072e0 nop |
| }
0x004072e4 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x004072e8 addiu a0, zero, 0x1c | a0 = 0x1c;
0x004072ec jalr t9 | t9 ();
0x004072f0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x004072f4 bnez v0, 0x407324 | goto label_2;
| }
0x004072f8 lui a1, 0x41 | a1 = 0x410000;
0x004072fc lui a2, 0x41 | a2 = 0x410000;
0x00407300 move a0, zero | a0 = 0;
| /* str._s___d:_malloc_fail_n */
0x00407304 addiu a1, a1, 0x5444 | a1 += 0x5444;
| /* str.miio_client.c */
0x00407308 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x0040730c addiu a3, zero, 0xcaa | a3 = 0xcaa;
| do {
0x00407310 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407314 jalr t9 | t9 ();
0x00407318 nop |
| label_0:
0x0040731c j 0x407674 | goto label_3;
0x00407320 addiu v0, zero, -1 | v0 = -1;
| label_2:
0x00407324 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00407328 move a0, v0 | a0 = v0;
0x0040732c move a1, s1 | a1 = s1;
0x00407330 addiu a2, zero, 0x1c | a2 = 0x1c;
0x00407334 jalr t9 | t9 ();
0x00407338 move v1, v0 | v1 = v0;
0x0040733c lw v0, 0x278(s0) | v0 = *((s0 + 158));
0x00407340 lw gp, 0x10(sp) | gp = *(var_10h);
0x00407344 sw v0, 0x18(v1) | *((v1 + 6)) = v0;
0x00407348 sw v1, 0x278(s0) | *((s0 + 158)) = v1;
0x0040734c lw s2, 0x274(s0) | s2 = *((s0 + 157));
| label_1:
0x00407350 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
| if (s2 == 0) {
0x00407354 beqz s2, 0x4073ac | goto label_4;
| }
0x00407358 addiu a0, zero, 0x1c | a0 = 0x1c;
0x0040735c jalr t9 | t9 ();
0x00407360 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x00407364 bnez v0, 0x407384 | goto label_5;
| }
0x00407368 lui a1, 0x41 | a1 = 0x410000;
0x0040736c lui a2, 0x41 | a2 = 0x410000;
0x00407370 move a0, zero | a0 = 0;
| /* str._s___d:_malloc_fail_n */
0x00407374 addiu a1, a1, 0x5444 | a1 += 0x5444;
| /* str.miio_client.c */
0x00407378 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x0040737c j 0x407310 |
| } while (1);
0x00407380 addiu a3, zero, 0xcb6 | a3 = 0xcb6;
| label_5:
0x00407384 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00407388 move a0, v0 | a0 = v0;
0x0040738c move a1, s2 | a1 = s2;
0x00407390 addiu a2, zero, 0x1c | a2 = 0x1c;
0x00407394 jalr t9 | t9 ();
0x00407398 move v1, v0 | v1 = v0;
0x0040739c lw v0, 0x28c(s0) | v0 = *((s0 + 163));
0x004073a0 lw gp, 0x10(sp) | gp = *(var_10h);
0x004073a4 sw v0, 0x18(v1) | *((v1 + 6)) = v0;
0x004073a8 sw v1, 0x28c(s0) | *((s0 + 163)) = v1;
| label_4:
0x004073ac move v0, zero | v0 = 0;
| do {
0x004073b0 move a1, v0 | a1 = v0;
| if (s1 == 0) {
0x004073b4 beqz s1, 0x4073c4 | goto label_6;
| }
0x004073b8 lw s1, 0x18(s1) | s1 = *((s1 + 6));
0x004073bc j 0x4073b0 |
| } while (1);
0x004073c0 addiu v0, v0, 1 | v0++;
| label_6:
0x004073c4 addiu s3, zero, 2 | s3 = 2;
| if (v0 != 0) {
0x004073c8 bnez v0, 0x4073e4 | goto label_7;
| }
0x004073cc move a1, s1 | a1 = s1;
| if (s2 == 0) {
| do {
0x004073d0 beql s2, zero, 0x4073e4 | goto label_7;
| }
0x004073d4 addiu s3, zero, 1 | s3 = 1;
0x004073d8 lw s2, 0x18(s2) | s2 = *((s2 + 6));
0x004073dc j 0x4073d0 |
| } while (1);
0x004073e0 addiu a1, a1, 1 | a1++;
| label_7:
0x004073e4 lw t9, -0x7f64(gp) | t9 = sym.rand_range;
0x004073e8 move a0, zero | a0 = 0;
0x004073ec addiu a1, a1, -1 | a1 += -1;
0x004073f0 jalr t9 | t9 ();
0x004073f4 lw s1, 0x270(s0) | s1 = *((s0 + 156));
0x004073f8 lw v1, 0x274(s0) | v1 = *((s0 + 157));
0x004073fc xori a0, s3, 1 | a0 = s3 ^ 1;
0x00407400 lw gp, 0x10(sp) | gp = *(var_10h);
0x00407404 movz s1, v1, a0 | s1 = v1;
| while (1) {
0x00407408 lw t9, -0x7fac(gp) | t9 = sym.get_port;
| if (s1 == 0) {
0x0040740c beqz s1, 0x407420 | goto label_8;
| }
0x00407410 addiu v0, v0, -1 | v0 += -1;
| if (v0 <= 0) {
0x00407414 blez v0, 0x407420 | goto label_8;
| }
0x00407418 j 0x407408 |
| }
0x0040741c lw s1, 0x18(s1) | s1 = *((s1 + 6));
| label_8:
0x00407420 addiu s2, s1, 4 | s2 = s1 + 4;
0x00407424 move a0, s2 | a0 = s2;
0x00407428 sw s1, 0x2a0(s0) | *((s0 + 168)) = s1;
0x0040742c sb zero, 0x18(sp) | *(var_18h) = 0;
0x00407430 jalr t9 | t9 ();
0x00407434 lw gp, 0x10(sp) | gp = *(var_10h);
0x00407438 addiu s4, sp, 0x18 | s4 = sp + 0x18;
0x0040743c lw t9, -0x7fb0(gp) | t9 = sym.get_ip_str;
0x00407440 move a0, s2 | a0 = s2;
0x00407444 move a1, s4 | a1 = s4;
0x00407448 addiu a2, zero, 0x2e | a2 = 0x2e;
0x0040744c move s5, v0 | s5 = v0;
0x00407450 jalr t9 | t9 ();
0x00407454 lw gp, 0x10(sp) | gp = *(var_10h);
0x00407458 lui a1, 0x41 | a1 = 0x410000;
0x0040745c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407460 addiu a0, zero, 2 | a0 = 2;
| /* str.Connect_to_server_ip:__s__port:__d_n */
0x00407464 addiu a1, a1, 0x5d64 | a1 += 0x5d64;
0x00407468 move a2, s4 | a2 = s4;
0x0040746c move a3, s5 | a3 = s5;
0x00407470 jalr t9 | t9 ();
0x00407474 lw gp, 0x10(sp) | gp = *(var_10h);
0x00407478 addiu v0, zero, 2 | v0 = 2;
0x0040747c addiu a0, zero, 2 | a0 = 2;
0x00407480 lw t9, -0x7d2c(gp) | t9 = sym.imp.socket;
0x00407484 addiu a1, zero, 1 | a1 = 1;
| if (s3 != v0) {
0x00407488 beq s3, v0, 0x407490 |
0x0040748c addiu a1, zero, 0x82 | a1 = 0x82;
| }
0x00407490 move a2, zero | a2 = 0;
0x00407494 jalr t9 | t9 ();
0x00407498 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040749c sw v0, 0x2c0(s0) | *((s0 + 176)) = v0;
0x004074a0 lw a0, 0x2c0(s0) | a0 = *((s0 + 176));
0x004074a4 lw t9, -0x7ce4(gp) | t9 = sym.imp.connect;
0x004074a8 lw a2, 0x14(s1) | a2 = *((s1 + 5));
0x004074ac move a1, s2 | a1 = s2;
0x004074b0 jalr t9 | t9 ();
0x004074b4 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x004074b8 beqz v0, 0x40758c |
0x004074bc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004074c0 lw a2, 0x2c0(s0) | a2 = *((s0 + 176));
0x004074c4 lui a1, 0x41 | a1 = 0x410000;
0x004074c8 addiu a0, zero, 1 | a0 = 1;
| /* str.connect_cloud_sock___d__error:__m_n */
0x004074cc addiu a1, a1, 0x5d88 | a1 += 0x5d88;
0x004074d0 jalr t9 | t9 ();
0x004074d4 lw gp, 0x10(sp) | gp = *(var_10h);
0x004074d8 lw a0, 0x2c0(s0) | a0 = *((s0 + 176));
0x004074dc lw t9, -0x7f60(gp) | t9 = sym.wait_sock_timeout;
0x004074e0 addiu a1, zero, 0xa | a1 = 0xa;
0x004074e4 move a2, zero | a2 = 0;
0x004074e8 addiu a3, zero, 1 | a3 = 1;
0x004074ec jalr t9 | t9 ();
0x004074f0 lw gp, 0x10(sp) | gp = *(var_10h);
0x004074f4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 != 0) {
0x004074f8 beqz v0, 0x407574 |
0x004074fc lui a1, 0x41 | a1 = 0x410000;
0x00407500 addiu a0, zero, 3 | a0 = 3;
| /* str.ERROR:_connect_to_cloud_error:__m_n */
0x00407504 addiu a1, a1, 0x5dac | a1 += 0x5dac;
0x00407508 jalr t9 | t9 ();
0x0040750c lw gp, 0x10(sp) | gp = *(var_10h);
0x00407510 lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x00407514 lw a0, 0x2c0(s0) | a0 = *((s0 + 176));
0x00407518 jalr t9 | t9 ();
0x0040751c lw v1, 0x2c8(s0) | v1 = *((s0 + 178));
0x00407520 addiu v0, zero, -1 | v0 = -1;
0x00407524 lw gp, 0x10(sp) | gp = *(var_10h);
0x00407528 sw zero, 0x2c0(s0) | *((s0 + 176)) = 0;
| if (v1 != v0) {
0x0040752c beq v1, v0, 0x407540 |
0x00407530 lw v0, 0x2c4(s0) | v0 = *((s0 + 177));
0x00407534 slt v0, v0, v1 | v0 = (v0 < v1) ? 1 : 0;
| if (v0 == 0) {
0x00407538 beql v0, zero, 0x4075c0 | goto label_9;
| }
0x0040753c addiu v0, zero, 1 | v0 = 1;
| }
0x00407540 lw v0, 0x2c4(s0) | v0 = *((s0 + 177));
0x00407544 addiu a1, zero, 0xa | a1 = 0xa;
0x00407548 slti v1, v0, 0xb | v1 = (v0 < 0xb) ? 1 : 0;
| if (v1 != 0) {
0x0040754c movz v0, a1, v1 | v0 = a1;
| }
0x00407550 addiu v0, v0, 1 | v0++;
0x00407554 addiu a1, zero, 0x2710 | a1 = 0x2710;
0x00407558 mul a1, v0, a1 | __asm ("mul a1, v0, a1");
0x0040755c lw a0, 0x1f0(s0) | a0 = *((s0 + 124));
0x00407560 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00407564 move a2, zero | a2 = 0;
0x00407568 jalr t9 | t9 ();
0x0040756c j 0x40731c | goto label_0;
0x00407570 nop |
| }
0x00407574 lui a1, 0x41 | a1 = 0x410000;
0x00407578 lw a2, 0x2c0(s0) | a2 = *((s0 + 176));
0x0040757c addiu a0, zero, 2 | a0 = 2;
| /* str.wait_cloud_sock___d__done_n */
0x00407580 addiu a1, a1, 0x5dd0 | a1 += 0x5dd0;
0x00407584 jalr t9 | t9 ();
0x00407588 lw gp, 0x10(sp) | gp = *(var_10h);
| }
0x0040758c lw s1, 0x194(s0) | s1 = *((s0 + 101));
0x00407590 slti v0, s1, 0x32 | v0 = (s1 < 0x32) ? 1 : 0;
0x00407594 lui s2, 0x43 | s2 = 0x430000;
| if (v0 == 0) {
0x00407598 bnez v0, 0x4075c8 |
0x0040759c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004075a0 lui a1, 0x41 | a1 = 0x410000;
0x004075a4 lui a2, 0x41 | a2 = 0x410000;
0x004075a8 move a0, zero | a0 = 0;
| /* str._s___d:_too_many_sockets_to_track_n */
0x004075ac addiu a1, a1, 0x5dec | a1 += 0x5dec;
| /* str.miio_client.c */
0x004075b0 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x004075b4 addiu a3, zero, 0xcf5 | a3 = 0xcf5;
0x004075b8 jalr t9 | t9 ();
0x004075bc addiu v0, zero, 1 | v0 = 1;
| label_9:
0x004075c0 j 0x40731c | goto label_0;
0x004075c4 sb v0, 0x20a(s0) | *((s0 + 522)) = v0;
| }
0x004075c8 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x004075cc lui a0, 0x43 | a0 = 0x429984;
0x004075d0 addiu a0, a0, -0x667c |
0x004075d4 addiu a1, s0, 0x340 | a1 = s0 + 0x340;
0x004075d8 addiu a2, zero, 0x10 | a2 = 0x10;
0x004075dc jalr t9 | t9 ();
0x004075e0 lw gp, 0x10(sp) | gp = *(var_10h);
0x004075e4 lw a2, 0x2c0(s0) | a2 = *((s0 + 176));
0x004075e8 sll s1, s1, 3 | s1 <<= 3;
0x004075ec addiu v0, zero, 1 | v0 = 1;
0x004075f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004075f4 addu s1, s1, s0 | s1 += s0;
0x004075f8 lui a1, 0x41 | a1 = 0x410000;
0x004075fc sw a2, 4(s1) | *((s1 + 1)) = a2;
0x00407600 sh v0, 8(s1) | *((s1 + 4)) = v0;
0x00407604 addiu a0, zero, 2 | a0 = 2;
| /* str.OT_cloud_sockfd:__d_n */
0x00407608 addiu a1, a1, 0x5e10 | a1 += 0x5e10;
0x0040760c jalr t9 | t9 ();
0x00407610 lw gp, 0x10(sp) | gp = *(var_10h);
0x00407614 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00407618 lw a2, -0x6dd0(s2) | a2 = *((s2 - 7028));
0x0040761c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407620 addiu v0, v0, 1 | v0++;
0x00407624 lui a1, 0x41 | a1 = 0x410000;
0x00407628 addiu a0, zero, 2 | a0 = 2;
| /* str.STATE:___d_____STATE_CLOUD_TRYING_n */
0x0040762c addiu a1, a1, 0x5e28 | a1 += 0x5e28;
0x00407630 sw v0, 0x194(s0) | *((s0 + 101)) = v0;
0x00407634 jalr t9 | t9 ();
0x00407638 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040763c addiu v0, zero, 7 | v0 = 7;
0x00407640 lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
0x00407644 sw v0, -0x6dd0(s2) | *((s2 - 7028)) = v0;
0x00407648 jalr t9 | t9 ();
0x0040764c lw gp, 0x10(sp) | gp = *(var_10h);
0x00407650 lw a0, 0x1f4(s0) | a0 = *((s0 + 125));
0x00407654 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00407658 addiu a1, zero, 0x1388 | a1 = 0x1388;
0x0040765c move a2, zero | a2 = 0;
0x00407660 sw v0, 0x210(s0) | *((s0 + 132)) = v0;
0x00407664 jalr t9 | t9 ();
0x00407668 jal 0x40709c | fcn_0040709c ();
0x0040766c nop |
0x00407670 move v0, zero | v0 = 0;
| label_3:
0x00407674 lw ra, 0x64(sp) | ra = *(var_64h);
0x00407678 lw s5, 0x60(sp) | s5 = *(var_60h);
0x0040767c lw s4, 0x5c(sp) | s4 = *(var_5ch);
0x00407680 lw s3, 0x58(sp) | s3 = *(var_58h);
0x00407684 lw s2, 0x54(sp) | s2 = *(var_54h);
0x00407688 lw s1, 0x50(sp) | s1 = *(var_50h);
0x0040768c lw s0, 0x4c(sp) | s0 = *(var_4ch);
0x00407690 addiu sp, sp, 0x68 |
0x00407694 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 @ 0x407698 */
| #include <stdint.h>
|
; (fcn) fcn.00407698 () | void fcn_00407698 () {
0x00407698 lui gp, 0x43 |
0x0040769c addiu gp, gp, 0x1620 |
0x004076a0 addiu sp, sp, -0x1038 |
0x004076a4 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x004076a8 addiu v0, zero, -1 | v0 = -1;
0x004076ac lui a1, 0x41 | a1 = "params";
| /* str.params */
0x004076b0 addiu a1, a1, 0x56c4 |
0x004076b4 sw s1, 0x102c(sp) | *(var_102ch) = s1;
0x004076b8 sw s0, 0x1028(sp) | *(var_1028h) = s0;
0x004076bc sw gp, 0x18(sp) | *(var_18h) = gp;
0x004076c0 sw ra, 0x1034(sp) | *(var_1034h) = ra;
0x004076c4 sw s2, 0x1030(sp) | *(var_1030h) = s2;
0x004076c8 sw v0, 0x1020(sp) | *(var_1020h) = v0;
0x004076cc addiu a2, sp, 0x1020 | a2 = sp + 0x1020;
0x004076d0 move s1, a0 | s1 = a0;
0x004076d4 jalr t9 | t9 ();
0x004076d8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004076dc move s0, v0 | s0 = v0;
0x004076e0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 < 0) {
0x004076e4 bgez v0, 0x407704 |
0x004076e8 lui a1, 0x41 | a1 = 0x410000;
0x004076ec addiu a0, zero, 1 | a0 = 1;
| /* str.no_params_in_res_wifi_conf_status_msg:__s_n */
0x004076f0 addiu a1, a1, 0x5ef8 | a1 += 0x5ef8;
0x004076f4 move a2, s1 | a2 = s1;
0x004076f8 jalr t9 | t9 ();
0x004076fc j 0x407830 | goto label_0;
0x00407700 move v0, s0 | v0 = s0;
| }
0x00407704 lw v0, 0x1020(sp) | v0 = *(var_1020h);
0x00407708 addiu s2, zero, 1 | s2 = 1;
0x0040770c lui s1, 0x43 | s1 = 0x430000;
0x00407710 addiu a0, zero, 2 | a0 = 2;
| if (v0 == s2) {
0x00407714 bne v0, s2, 0x407780 |
0x00407718 lw a2, -0x6dd0(s1) | a2 = *((s1 - 7028));
0x0040771c lui a1, 0x41 | a1 = "STATE: (%d) -> STATE_WIFI_STA_MODE\n";
| /* str.STATE:___d_____STATE_WIFI_STA_MODE_n */
0x00407720 addiu a1, a1, 0x5f24 |
0x00407724 jalr t9 | t9 ();
0x00407728 addiu v0, zero, 6 | v0 = 6;
0x0040772c sw v0, -0x6dd0(s1) | *((s1 - 7028)) = v0;
0x00407730 jal 0x407250 | fcn_00407250 ();
0x00407734 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407738 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 < 0) {
0x0040773c bgez v0, 0x407760 |
0x00407740 lui a1, 0x41 | a1 = "internet connection failed\n";
| /* str.internet_connection_failed_n */
0x00407744 addiu a1, a1, 0x5f48 |
0x00407748 addiu a0, zero, 1 | a0 = 1;
0x0040774c jalr t9 | t9 ();
0x00407750 lui a1, 0x41 | a1 = 0x410000;
0x00407754 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407758 j 0x407820 | goto label_1;
| /* str._method_:__local.status____params_:__internet_failed_ */
0x0040775c addiu a1, a1, 0x5ec0 | a1 += 0x5ec0;
| }
0x00407760 lui a1, 0x41 | a1 = "internet connection succeed\n";
| /* str.internet_connection_succeed_n */
0x00407764 addiu a1, a1, 0x5f64 |
0x00407768 addiu a0, zero, 2 | a0 = 2;
0x0040776c jalr t9 | t9 ();
0x00407770 lui a1, 0x41 | a1 = 0x410000;
0x00407774 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407778 j 0x407820 | goto label_1;
| /* str._method_:__local.status____params_:__internet_connected_ */
0x0040777c addiu a1, a1, 0x5e4c | a1 += 0x5e4c;
| }
0x00407780 lw a2, -0x6dd0(s1) | a2 = *((s1 - 7028));
0x00407784 lui a1, 0x41 | a1 = "STATE: (%d) -> STATE_WIFI_AP_MODE\n";
| /* str.STATE:___d_____STATE_WIFI_AP_MODE_n */
0x00407788 addiu a1, a1, 0x5f84 |
0x0040778c jalr t9 | t9 ();
0x00407790 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407794 addiu v0, zero, 5 | v0 = 5;
0x00407798 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040779c lui a1, 0x41 | a1 = 0x410000;
0x004077a0 sw v0, -0x6dd0(s1) | *((s1 - 7028)) = v0;
0x004077a4 addiu a0, zero, 2 | a0 = 2;
| /* str.wifi_enter_AP_mode_n */
0x004077a8 addiu a1, a1, 0x5fa8 | a1 += 0x5fa8;
0x004077ac jalr t9 | t9 ();
0x004077b0 lw gp, 0x18(sp) | gp = *(var_18h);
| /* obj.miio */
0x004077b4 addiu v0, s1, -0x6dd0 | v0 = s1 + -0x6dd0;
0x004077b8 sb s2, 0x20b(v0) | *((v0 + 523)) = s2;
0x004077bc lw a3, 0x268(v0) | a3 = *((v0 + 154));
0x004077c0 lui v0, 0x41 | v0 = "otd_donot_trust_peer";
| /* str.otd_donot_trust_peer */
0x004077c4 addiu v0, v0, 0x5fc4 |
0x004077c8 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
0x004077cc addiu s2, sp, 0x20 | s2 = sp + 0x20;
0x004077d0 lui a2, 0x41 | a2 = 0x410000;
0x004077d4 sw v0, 0x10(sp) | *(var_10h) = v0;
0x004077d8 move a0, s2 | a0 = s2;
0x004077dc addiu a1, zero, 0x1000 | a1 = 0x1000;
| /* str._s_s */
0x004077e0 addiu a2, a2, 0x5fbc | a2 += 0x5fbc;
0x004077e4 jalr t9 | t9 ();
0x004077e8 move s0, v0 | s0 = v0;
0x004077ec lw gp, 0x18(sp) | gp = *(var_18h);
| if (s0 >= 0) {
0x004077f0 bltz s0, 0x407830 |
0x004077f4 slti v1, s0, 0x1000 | v1 = (s0 < 0x1000) ? 1 : 0;
0x004077f8 addiu v0, zero, -1 | v0 = -1;
| if (v1 == 0) {
0x004077fc beqz v1, 0x407830 | goto label_0;
| }
0x00407800 lw t9, -0x7da8(gp) | t9 = sym.imp.unlink;
0x00407804 addu v0, s2, s0 | v0 = s2 + s0;
0x00407808 sb zero, (v0) | *(v0) = 0;
0x0040780c move a0, s2 | a0 = s2;
0x00407810 jalr t9 | t9 ();
0x00407814 lui a1, 0x41 | a1 = 0x410000;
0x00407818 lw gp, 0x18(sp) | gp = *(var_18h);
| /* str._method_:__local.status____params_:__wifi_ap_mode_ */
0x0040781c addiu a1, a1, 0x5e88 | a1 += 0x5e88;
| label_1:
0x00407820 lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
| /* obj.miio */
0x00407824 addiu a0, s1, -0x6dd0 | a0 = s1 + -0x6dd0;
0x00407828 jalr t9 | t9 ();
0x0040782c move v0, s0 | v0 = s0;
| }
| label_0:
0x00407830 lw ra, 0x1034(sp) | ra = *(var_1034h);
0x00407834 lw s2, 0x1030(sp) | s2 = *(var_1030h);
0x00407838 lw s1, 0x102c(sp) | s1 = *(var_102ch);
0x0040783c lw s0, 0x1028(sp) | s0 = *(var_1028h);
0x00407840 addiu sp, sp, 0x1038 |
0x00407844 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 @ 0x407848 */
| #include <stdint.h>
|
; (fcn) fcn.00407848 () | void fcn_00407848 () {
0x00407848 lui gp, 0x43 |
0x0040784c addiu sp, sp, -0x48 |
0x00407850 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00407854 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407858 sw s1, 0x2c(sp) | *(var_2ch) = s1;
0x0040785c lui a2, 0x41 | a2 = 0x410000;
0x00407860 lui s1, 0x41 | s1 = 0x410000;
0x00407864 sw s2, 0x30(sp) | *(var_30h) = s2;
0x00407868 sw s0, 0x28(sp) | *(var_28h) = s0;
0x0040786c sw gp, 0x18(sp) | *(var_18h) = gp;
0x00407870 sw ra, 0x44(sp) | *(var_44h) = ra;
0x00407874 sw s6, 0x40(sp) | *(var_40h) = s6;
0x00407878 sw s5, 0x3c(sp) | *(var_3ch) = s5;
0x0040787c sw s4, 0x38(sp) | *(var_38h) = s4;
0x00407880 sw s3, 0x34(sp) | *(var_34h) = s3;
0x00407884 move s2, a0 | s2 = a0;
0x00407888 move s0, a1 | s0 = a1;
0x0040788c move a0, a1 | a0 = a1;
| /* str._internal.wifi_connected */
0x00407890 addiu a2, a2, 0x5fdc | a2 += 0x5fdc;
| /* str.method */
0x00407894 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
0x00407898 addiu a3, zero, 6 | a3 = 6;
0x0040789c jalr t9 | t9 ();
0x004078a0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004078a4 bnez v0, 0x407960 |
0x004078a8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004078ac lui a1, 0x41 | a1 = 0x410000;
0x004078b0 addiu a0, zero, 3 | a0 = 3;
| /* str.Got__internal.wifi_connected_n */
0x004078b4 addiu a1, a1, 0x5ff8 | a1 += 0x5ff8;
0x004078b8 jalr t9 | t9 ();
0x004078bc lw gp, 0x18(sp) | gp = *(var_18h);
0x004078c0 lui a1, 0x41 | a1 = 0x410000;
0x004078c4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004078c8 addiu a0, zero, 2 | a0 = 2;
| /* str.WiFi_connected_n */
0x004078cc addiu a1, a1, 0x6018 | a1 += 0x6018;
0x004078d0 jalr t9 | t9 ();
0x004078d4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004078d8 addiu v0, zero, 6 | v0 = 6;
0x004078dc lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
0x004078e0 lui s0, 0x43 | s0 = 0x430000;
0x004078e4 lui a1, 0x41 | a1 = 0x410000;
0x004078e8 sw v0, -0x6dd0(s0) | *((s0 - 7028)) = v0;
| /* obj.miio */
0x004078ec addiu a0, s0, -0x6dd0 | a0 = s0 + -0x6dd0;
| /* str._method_:__local.status____params_:__wifi_connected_ */
0x004078f0 addiu a1, a1, 0x6028 | a1 += 0x6028;
0x004078f4 jalr t9 | t9 ();
0x004078f8 jal 0x407250 | fcn_00407250 ();
0x004078fc nop |
0x00407900 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407904 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 < 0) {
0x00407908 bgez v0, 0x40792c |
0x0040790c lui a1, 0x41 | a1 = "internet connection failed\n";
| /* str.internet_connection_failed_n */
0x00407910 addiu a1, a1, 0x5f48 |
0x00407914 addiu a0, zero, 1 | a0 = 1;
0x00407918 jalr t9 | t9 ();
0x0040791c lui a1, 0x41 | a1 = 0x410000;
0x00407920 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407924 j 0x407948 | goto label_0;
| /* str._method_:__local.status____params_:__internet_failed_ */
0x00407928 addiu a1, a1, 0x5ec0 | a1 += 0x5ec0;
| }
0x0040792c lui a1, 0x41 | a1 = "internet connection succeed\n";
| /* str.internet_connection_succeed_n */
0x00407930 addiu a1, a1, 0x5f64 |
0x00407934 addiu a0, zero, 2 | a0 = 2;
0x00407938 jalr t9 | t9 ();
0x0040793c lui a1, 0x41 | a1 = 0x410000;
0x00407940 lw gp, 0x18(sp) | gp = *(var_18h);
| /* str._method_:__local.status____params_:__internet_connected_ */
0x00407944 addiu a1, a1, 0x5e4c | a1 += 0x5e4c;
| label_0:
0x00407948 lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
| /* obj.miio */
0x0040794c addiu a0, s0, -0x6dd0 | a0 = s0 + -0x6dd0;
| /* obj.miio */
0x00407950 addiu s0, s0, -0x6dd0 | s0 += -0x6dd0;
0x00407954 jalr t9 | t9 ();
0x00407958 j 0x408af4 | goto label_1;
0x0040795c sb zero, 0x20b(s0) | *((s0 + 523)) = 0;
| }
0x00407960 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407964 lui a2, 0x41 | a2 = 0x410000;
0x00407968 move a0, s0 | a0 = s0;
| /* str.method */
0x0040796c addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.wifi_ap_mode */
0x00407970 addiu a2, a2, 0x6060 | a2 += 0x6060;
0x00407974 addiu a3, zero, 6 | a3 = 6;
0x00407978 jalr t9 | t9 ();
0x0040797c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407980 bnez v0, 0x4079e8 |
0x00407984 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407988 lui a1, 0x41 | a1 = 0x410000;
0x0040798c addiu a0, zero, 3 | a0 = 3;
| /* str.Got__internal.wifi_ap_mode_n */
0x00407990 addiu a1, a1, 0x6078 | a1 += 0x6078;
0x00407994 jalr t9 | t9 ();
0x00407998 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040799c lui a1, 0x41 | a1 = 0x410000;
0x004079a0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004079a4 addiu a0, zero, 2 | a0 = 2;
| /* str.Failed_connecting_to_AP__back_to_wifi_AP_mode_n */
0x004079a8 addiu a1, a1, 0x6094 | a1 += 0x6094;
0x004079ac jalr t9 | t9 ();
0x004079b0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004079b4 lui s0, 0x43 | s0 = 0x430000;
0x004079b8 lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
0x004079bc lui a1, 0x41 | a1 = 0x410000;
| /* obj.miio */
0x004079c0 addiu a0, s0, -0x6dd0 | a0 = s0 + -0x6dd0;
| /* str._method_:__local.status____params_:__wifi_failed_ */
0x004079c4 addiu a1, a1, 0x60c4 | a1 += 0x60c4;
0x004079c8 jalr t9 | t9 ();
0x004079cc addiu v0, zero, 5 | v0 = 5;
0x004079d0 lui a1, 0x41 | a1 = 0x410000;
0x004079d4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004079d8 sw v0, -0x6dd0(s0) | *((s0 - 7028)) = v0;
| /* obj.miio */
0x004079dc addiu a0, s0, -0x6dd0 | a0 = s0 + -0x6dd0;
0x004079e0 j 0x407a4c | goto label_2;
| /* str._method_:__local.status____params_:__wifi_ap_mode_ */
0x004079e4 addiu a1, a1, 0x5e88 | a1 += 0x5e88;
| }
0x004079e8 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x004079ec lui a2, 0x41 | a2 = 0x410000;
0x004079f0 move a0, s0 | a0 = s0;
| /* str.method */
0x004079f4 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.reboot */
0x004079f8 addiu a2, a2, 0x60f8 | a2 += 0x60f8;
0x004079fc addiu a3, zero, 6 | a3 = 6;
0x00407a00 jalr t9 | t9 ();
0x00407a04 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407a08 bnez v0, 0x407a54 |
0x00407a0c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407a10 lui a1, 0x41 | a1 = 0x410000;
0x00407a14 addiu a0, zero, 3 | a0 = 3;
| /* str.Got__internal.reboot_n */
0x00407a18 addiu a1, a1, 0x610c | a1 += 0x610c;
0x00407a1c jalr t9 | t9 ();
0x00407a20 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407a24 lui a1, 0x41 | a1 = 0x410000;
0x00407a28 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407a2c addiu a0, zero, 2 | a0 = 2;
| /* str.Got_reboot_msg._n */
0x00407a30 addiu a1, a1, 0x6124 | a1 += 0x6124;
0x00407a34 jalr t9 | t9 ();
0x00407a38 lui a0, 0x43 | a0 = 0x430000;
0x00407a3c lui a1, 0x41 | a1 = 0x410000;
0x00407a40 lw gp, 0x18(sp) | gp = *(var_18h);
| /* obj.miio */
0x00407a44 addiu a0, a0, -0x6dd0 | a0 += -0x6dd0;
| /* str._method_:__local.status____params_:__reboot_ */
0x00407a48 addiu a1, a1, 0x6138 | a1 += 0x6138;
| label_2:
0x00407a4c j 0x407ce4 | goto label_3;
0x00407a50 lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
| }
0x00407a54 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407a58 lui a2, 0x41 | a2 = 0x410000;
0x00407a5c move a0, s0 | a0 = s0;
| /* str.method */
0x00407a60 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.debug */
0x00407a64 addiu a2, a2, 0x6168 | a2 += 0x6168;
0x00407a68 addiu a3, zero, 6 | a3 = 6;
0x00407a6c jalr t9 | t9 ();
0x00407a70 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407a74 bnez v0, 0x407a9c |
0x00407a78 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407a7c lui a1, 0x41 | a1 = 0x410000;
0x00407a80 addiu a0, zero, 3 | a0 = 3;
| /* str.Got__internal.debug_n */
0x00407a84 addiu a1, a1, 0x6178 | a1 += 0x6178;
0x00407a88 jalr t9 | t9 ();
0x00407a8c move a0, s0 | a0 = s0;
0x00407a90 jal 0x405c84 | fcn_00405c84 ();
0x00407a94 j 0x408af4 | goto label_1;
0x00407a98 nop |
| }
0x00407a9c lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407aa0 lui a2, 0x41 | a2 = 0x410000;
0x00407aa4 move a0, s0 | a0 = s0;
| /* str.method */
0x00407aa8 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.info */
0x00407aac addiu a2, a2, 0x6190 | a2 += 0x6190;
0x00407ab0 addiu a3, zero, 6 | a3 = 6;
0x00407ab4 jalr t9 | t9 ();
0x00407ab8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407abc bnez v0, 0x407af4 |
0x00407ac0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407ac4 lui a1, 0x41 | a1 = 0x410000;
0x00407ac8 addiu a0, zero, 3 | a0 = 3;
| /* str.Got__internal.info._n */
0x00407acc addiu a1, a1, 0x61a0 | a1 += 0x61a0;
0x00407ad0 jalr t9 | t9 ();
0x00407ad4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407ad8 lui a1, 0x43 | a1 = 0x430000;
0x00407adc lw t9, -0x7f54(gp) | t9 = sym.cmd_internal_get_info_callback;
0x00407ae0 move a0, s0 | a0 = s0;
0x00407ae4 addiu a1, a1, -0x6af0 | a1 += -0x6af0;
0x00407ae8 jalr t9 | t9 ();
0x00407aec j 0x408af4 | goto label_1;
0x00407af0 nop |
| }
0x00407af4 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407af8 lui a2, 0x41 | a2 = 0x410000;
0x00407afc move a0, s0 | a0 = s0;
| /* str.method */
0x00407b00 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.hello */
0x00407b04 addiu a2, a2, 0x61b8 | a2 += 0x61b8;
0x00407b08 addiu a3, zero, 6 | a3 = 6;
0x00407b0c jalr t9 | t9 ();
0x00407b10 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407b14 bnez v0, 0x407cb0 |
0x00407b18 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407b1c lui a1, 0x41 | a1 = 0x410000;
0x00407b20 addiu a0, zero, 3 | a0 = 3;
| /* str.Got__internal.hello._n */
0x00407b24 addiu a1, a1, 0x61c8 | a1 += 0x61c8;
0x00407b28 jalr t9 | t9 ();
0x00407b2c lw gp, 0x18(sp) | gp = *(var_18h);
0x00407b30 lui s1, 0x43 | s1 = 0x430000;
0x00407b34 lui a1, 0x41 | a1 = 0x410000;
0x00407b38 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407b3c lw a2, -0x6dd0(s1) | a2 = *((s1 - 7028));
0x00407b40 addiu a0, zero, 2 | a0 = 2;
| /* str.STATE:___d__n */
0x00407b44 addiu a1, a1, 0x61e0 | a1 += 0x61e0;
| /* obj.miio */
0x00407b48 addiu s0, s1, -0x6dd0 | s0 = s1 + -0x6dd0;
0x00407b4c jalr t9 | t9 ();
0x00407b50 lw v0, 0x2d4(s0) | v0 = *((s0 + 181));
0x00407b54 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 <= 0) {
0x00407b58 bgtz v0, 0x407b64 |
0x00407b5c sw s2, 0x2d4(s0) | *((s0 + 181)) = s2;
| if (s2 == 0) {
0x00407b60 bnel s2, zero, 0x407b64 | goto label_4;
| }
| }
| label_4:
0x00407b64 lw v0, -0x6dd0(s1) | v0 = *((s1 - 7028));
0x00407b68 sltiu v1, v0, 5 | v1 = (v0 < 5) ? 1 : 0;
0x00407b6c sll v1, v0, 2 | v1 = v0 << 2;
| if (v1 == 0) {
0x00407b70 beqz v1, 0x408af4 | goto label_1;
| }
0x00407b74 lui v0, 0x41 | v0 = 0x417a70;
0x00407b78 addiu v0, v0, 0x7a70 |
0x00407b7c addu v0, v0, v1 | v0 += v1;
0x00407b80 lw v0, (v0) | v0 = *(v0);
0x00407b84 jr v0 | v0 ();
0x00407b88 nop |
| }
0x00407cb0 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407cb4 lui a2, 0x41 | a2 = 0x410000;
0x00407cb8 move a0, s0 | a0 = s0;
| /* str.method */
0x00407cbc addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.helper_ready */
0x00407cc0 addiu a2, a2, 0x6260 | a2 += 0x6260;
0x00407cc4 addiu a3, zero, 6 | a3 = 6;
0x00407cc8 jalr t9 | t9 ();
0x00407ccc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407cd0 bnez v0, 0x407cf4 |
0x00407cd4 lui a1, 0x41 | a1 = 0x410000;
0x00407cd8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407cdc addiu a0, zero, 3 | a0 = 3;
| /* str.Got__internal.helper_ready._n */
0x00407ce0 addiu a1, a1, 0x6278 | a1 += 0x6278;
| label_3:
0x00407ce4 jalr t9 | t9 ();
0x00407ce8 nop |
0x00407cec j 0x408af4 | goto label_1;
0x00407cf0 nop |
| }
0x00407cf4 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407cf8 lui a2, 0x41 | a2 = 0x410000;
0x00407cfc move a0, s0 | a0 = s0;
| /* str.method */
0x00407d00 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.res_wifi_conf_status */
0x00407d04 addiu a2, a2, 0x6298 | a2 += 0x6298;
0x00407d08 addiu a3, zero, 6 | a3 = 6;
0x00407d0c jalr t9 | t9 ();
0x00407d10 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407d14 bnez v0, 0x407d3c |
0x00407d18 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407d1c lui a1, 0x41 | a1 = 0x410000;
0x00407d20 addiu a0, zero, 3 | a0 = 3;
| /* str.Got__internal.res_wifi_conf_status._n */
0x00407d24 addiu a1, a1, 0x62b8 | a1 += 0x62b8;
0x00407d28 jalr t9 | t9 ();
0x00407d2c move a0, s0 | a0 = s0;
0x00407d30 jal 0x407698 | fcn_00407698 ();
0x00407d34 j 0x408af4 | goto label_1;
0x00407d38 nop |
| }
0x00407d3c lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407d40 lui a2, 0x41 | a2 = 0x410000;
0x00407d44 move a0, s0 | a0 = s0;
| /* str.method */
0x00407d48 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.res_didkeymac */
0x00407d4c addiu a2, a2, 0x62e0 | a2 += 0x62e0;
0x00407d50 addiu a3, zero, 6 | a3 = 6;
0x00407d54 jalr t9 | t9 ();
0x00407d58 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407d5c bnez v0, 0x407ff8 |
0x00407d60 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407d64 lui a1, 0x41 | a1 = "Got _internal.res_didkeymac.\n";
| /* str.Got__internal.res_didkeymac._n */
0x00407d68 addiu a1, a1, 0x62f8 |
0x00407d6c addiu a0, zero, 3 | a0 = 3;
0x00407d70 jalr t9 | t9 ();
0x00407d74 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407d78 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x00407d7c move a0, s0 | a0 = s0;
0x00407d80 jalr t9 | t9 ();
0x00407d84 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407d88 lui a1, 0x41 | a1 = 0x410000;
0x00407d8c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00407d90 move a0, v0 | a0 = v0;
| /* str.params */
0x00407d94 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x00407d98 addiu a2, sp, 0x24 | a2 = sp + 0x24;
0x00407d9c move s1, v0 | s1 = v0;
0x00407da0 jalr t9 | t9 ();
0x00407da4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407da8 bnez v0, 0x407dc8 |
0x00407dac lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407db0 lui a1, 0x41 | a1 = 0x410000;
0x00407db4 move a0, zero | a0 = 0;
| /* str._internal.res_didkeymac_does_not_have__params_._n */
0x00407db8 addiu a1, a1, 0x6318 | a1 += 0x6318;
0x00407dbc jalr t9 | t9 ();
0x00407dc0 j 0x40885c | goto label_5;
0x00407dc4 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00407dc8 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00407dcc lui a1, 0x41 | a1 = 0x410000;
0x00407dd0 addiu s0, sp, 0x20 | s0 = sp + 0x20;
0x00407dd4 move a0, s1 | a0 = s1;
| /* esilref: 'mac' */
0x00407dd8 addiu a1, a1, 0x62f4 | a1 += 0x62f4;
0x00407ddc move a2, s0 | a2 = s0;
0x00407de0 jalr t9 | t9 ();
0x00407de4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407de8 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00407dec lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00407df0 addiu a1, zero, 6 | a1 = 6;
0x00407df4 jalr t9 | t9 ();
0x00407df8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407dfc bnez v0, 0x407e1c |
0x00407e00 lui a1, 0x41 | a1 = 0x410000;
0x00407e04 lui a2, 0x41 | a2 = 0x410000;
0x00407e08 move a0, zero | a0 = 0;
| /* str._s:_d__mac_not_string_n */
0x00407e0c addiu a1, a1, 0x634c | a1 += 0x634c;
| /* str.cmd_internal_response_didkeymac */
0x00407e10 addiu a2, a2, 0x7c00 | a2 += 0x7c00;
0x00407e14 j 0x40884c | goto label_6;
0x00407e18 addiu a3, zero, 0x2fb | a3 = 0x2fb;
| }
0x00407e1c lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x00407e20 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00407e24 jalr t9 | t9 ();
0x00407e28 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407e2c lw a0, 0x24(sp) | a0 = *(var_24h);
0x00407e30 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00407e34 lui a1, 0x41 | a1 = "code";
| /* str.code */
0x00407e38 addiu a1, a1, 0x6364 |
0x00407e3c move a2, s0 | a2 = s0;
0x00407e40 jalr t9 | t9 ();
0x00407e44 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407e48 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00407e4c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00407e50 addiu a1, zero, 3 | a1 = 3;
0x00407e54 jalr t9 | t9 ();
0x00407e58 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407e5c bnez v0, 0x407e7c |
0x00407e60 lui a1, 0x41 | a1 = 0x410000;
0x00407e64 lui a2, 0x41 | a2 = 0x410000;
0x00407e68 move a0, zero | a0 = 0;
| /* str._s:_d__code_not_int_n */
0x00407e6c addiu a1, a1, 0x636c | a1 += 0x636c;
| /* str.cmd_internal_response_didkeymac */
0x00407e70 addiu a2, a2, 0x7c00 | a2 += 0x7c00;
0x00407e74 j 0x40884c | goto label_6;
0x00407e78 addiu a3, zero, 0x303 | a3 = 0x303;
| }
0x00407e7c lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x00407e80 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00407e84 jalr t9 | t9 ();
0x00407e88 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00407e8c beqz v0, 0x407ec8 |
0x00407e90 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00407e94 lui a1, 0x41 | a1 = 0x410000;
0x00407e98 lui a2, 0x41 | a2 = 0x410000;
0x00407e9c sw v0, 0x10(sp) | *(var_10h) = v0;
0x00407ea0 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_d__code:__d_n */
0x00407ea4 addiu a1, a1, 0x6384 | a1 += 0x6384;
| /* str.cmd_internal_response_didkeymac */
0x00407ea8 addiu a2, a2, 0x7c00 | a2 += 0x7c00;
0x00407eac addiu a3, zero, 0x30a | a3 = 0x30a;
0x00407eb0 jalr t9 | t9 ();
0x00407eb4 addiu v1, zero, 0x1e | v1 = 0x1e;
0x00407eb8 lui v0, 0x43 | v0 = 0x430000;
0x00407ebc lw gp, 0x18(sp) | gp = *(var_18h);
0x00407ec0 j 0x4088f4 | goto label_7;
0x00407ec4 sw v1, -0x6bcc(v0) | *((v0 - 6899)) = v1;
| }
0x00407ec8 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00407ecc lw a0, 0x24(sp) | a0 = *(var_24h);
0x00407ed0 lui a1, 0x41 | a1 = "result";
| /* str.result */
0x00407ed4 addiu a1, a1, 0x6398 |
0x00407ed8 move a2, s0 | a2 = s0;
0x00407edc jalr t9 | t9 ();
0x00407ee0 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407ee4 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00407ee8 lui a1, 0x41 | a1 = 0x410000;
0x00407eec lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00407ef0 sw a0, 0x24(sp) | *(var_24h) = a0;
| /* esilref: 'status' */
0x00407ef4 addiu a1, a1, 0x62b0 | a1 += 0x62b0;
0x00407ef8 move a2, s0 | a2 = s0;
0x00407efc jalr t9 | t9 ();
0x00407f00 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407f04 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00407f08 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00407f0c addiu a1, zero, 3 | a1 = 3;
0x00407f10 jalr t9 | t9 ();
0x00407f14 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00407f18 bnez v0, 0x407f38 |
0x00407f1c lui a1, 0x41 | a1 = 0x410000;
0x00407f20 lui a2, 0x41 | a2 = 0x410000;
0x00407f24 move a0, zero | a0 = 0;
| /* str._s:_d__status_not_int_n */
0x00407f28 addiu a1, a1, 0x63a0 | a1 += 0x63a0;
| /* str.cmd_internal_response_didkeymac */
0x00407f2c addiu a2, a2, 0x7c00 | a2 += 0x7c00;
0x00407f30 j 0x40884c | goto label_6;
0x00407f34 addiu a3, zero, 0x314 | a3 = 0x314;
| }
0x00407f38 lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x00407f3c lw a0, 0x20(sp) | a0 = *(var_20h);
0x00407f40 jalr t9 | t9 ();
0x00407f44 addiu v1, zero, -5 | v1 = -5;
0x00407f48 and v1, v0, v1 | v1 = v0 & v1;
0x00407f4c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v1 == 0) {
0x00407f50 bnez v1, 0x407f80 |
0x00407f54 lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
0x00407f58 jalr t9 | t9 ();
0x00407f5c nop |
0x00407f60 lui v1, 0x43 | v1 = miio;
| /* obj.miio */
0x00407f64 addiu v1, v1, -0x6dd0 |
0x00407f68 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407f6c sw v0, 0x200(v1) | *((v1 + 128)) = v0;
0x00407f70 addiu v0, zero, 0xe10 | v0 = 0xe10;
0x00407f74 sw v0, 0x204(v1) | *((v1 + 129)) = v0;
0x00407f78 j 0x407fb8 | goto label_8;
0x00407f7c lw a0, 0x1f0(v1) | a0 = *((v1 + 124));
| }
0x00407f80 addiu v1, zero, 2 | v1 = 2;
0x00407f84 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 == v1) {
0x00407f88 bne v0, v1, 0x407fd0 |
0x00407f8c lui s0, 0x43 | s0 = 0x430000;
0x00407f90 lw a2, -0x6dd0(s0) | a2 = *((s0 - 7028));
0x00407f94 lui a1, 0x41 | a1 = 0x410000;
0x00407f98 addiu a0, zero, 2 | a0 = 2;
| /* str.STATE:___d_____STATE_DEVICE_INIT_n */
0x00407f9c addiu a1, a1, 0x63b8 | a1 += 0x63b8;
0x00407fa0 jalr t9 | t9 ();
0x00407fa4 sw zero, -0x6dd0(s0) | *((s0 - 7028)) = 0;
| /* obj.miio */
0x00407fa8 addiu s0, s0, -0x6dd0 | s0 += -0x6dd0;
0x00407fac lw a0, 0x1f0(s0) | a0 = *((s0 + 124));
0x00407fb0 lw gp, 0x18(sp) | gp = *(var_18h);
0x00407fb4 sw zero, 0x200(s0) | *((s0 + 128)) = 0;
| label_8:
0x00407fb8 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00407fbc addiu a1, zero, 0x1388 | a1 = 0x1388;
0x00407fc0 addiu a2, zero, 0x1388 | a2 = 0x1388;
0x00407fc4 jalr t9 | t9 ();
0x00407fc8 j 0x40885c | goto label_5;
0x00407fcc lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00407fd0 lui a1, 0x41 | a1 = 0x410000;
0x00407fd4 lui a2, 0x41 | a2 = 0x410000;
0x00407fd8 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00407fdc addiu a0, zero, 1 | a0 = 1;
| /* str._s:_d__status:__d_n */
0x00407fe0 addiu a1, a1, 0x63dc | a1 += 0x63dc;
| /* str.cmd_internal_response_didkeymac */
0x00407fe4 addiu a2, a2, 0x7c00 | a2 += 0x7c00;
0x00407fe8 addiu a3, zero, 0x326 | a3 = 0x326;
0x00407fec jalr t9 | t9 ();
0x00407ff0 j 0x40885c | goto label_5;
0x00407ff4 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00407ff8 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00407ffc lui a2, 0x41 | a2 = 0x410000;
0x00408000 move a0, s0 | a0 = s0;
| /* str.method */
0x00408004 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.res_didkeymac2 */
0x00408008 addiu a2, a2, 0x63f0 | a2 += 0x63f0;
0x0040800c addiu a3, zero, 6 | a3 = 6;
0x00408010 jalr t9 | t9 ();
0x00408014 move s3, s1 | s3 = s1;
0x00408018 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040801c bnez v0, 0x4081dc |
0x00408020 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408024 lui a1, 0x41 | a1 = "Got _internal.res_didkeymac2.\n";
| /* str.Got__internal.res_didkeymac2._n */
0x00408028 addiu a1, a1, 0x640c |
0x0040802c addiu a0, zero, 3 | a0 = 3;
0x00408030 jalr t9 | t9 ();
0x00408034 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408038 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040803c move a0, s0 | a0 = s0;
0x00408040 jalr t9 | t9 ();
0x00408044 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408048 lui a1, 0x41 | a1 = 0x410000;
0x0040804c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00408050 move a0, v0 | a0 = v0;
| /* str.params */
0x00408054 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x00408058 addiu a2, sp, 0x24 | a2 = sp + 0x24;
0x0040805c move s2, v0 | s2 = v0;
0x00408060 jalr t9 | t9 ();
0x00408064 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00408068 bnez v0, 0x408088 |
0x0040806c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408070 lui a1, 0x41 | a1 = 0x410000;
0x00408074 move a0, zero | a0 = 0;
| /* str._internal.res_didkeymac2_does_not_have__params_._n */
0x00408078 addiu a1, a1, 0x642c | a1 += 0x642c;
0x0040807c jalr t9 | t9 ();
0x00408080 j 0x408ac8 | goto label_9;
0x00408084 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00408088 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040808c lui a1, 0x41 | a1 = 0x410000;
0x00408090 addiu s0, sp, 0x20 | s0 = sp + 0x20;
0x00408094 move a0, s2 | a0 = s2;
| /* esilref: 'mac' */
0x00408098 addiu a1, a1, 0x62f4 | a1 += 0x62f4;
0x0040809c move a2, s0 | a2 = s0;
0x004080a0 jalr t9 | t9 ();
0x004080a4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004080a8 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004080ac lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x004080b0 addiu a1, zero, 6 | a1 = 6;
0x004080b4 jalr t9 | t9 ();
0x004080b8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004080bc bnez v0, 0x4080dc |
0x004080c0 lui a1, 0x41 | a1 = 0x410000;
0x004080c4 lui a2, 0x41 | a2 = 0x410000;
0x004080c8 move a0, zero | a0 = 0;
| /* str._s:_d__mac_not_string_n */
0x004080cc addiu a1, a1, 0x634c | a1 += 0x634c;
| /* str.cmd_internal_response_didkeymac2 */
0x004080d0 addiu a2, a2, 0x7bdc | a2 += 0x7bdc;
0x004080d4 j 0x4086a8 | goto label_10;
0x004080d8 addiu a3, zero, 0x343 | a3 = 0x343;
| }
0x004080dc lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x004080e0 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004080e4 jalr t9 | t9 ();
0x004080e8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004080ec lw a0, 0x24(sp) | a0 = *(var_24h);
0x004080f0 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x004080f4 lui a1, 0x41 | a1 = "code";
| /* str.code */
0x004080f8 addiu a1, a1, 0x6364 |
0x004080fc move a2, s0 | a2 = s0;
0x00408100 jalr t9 | t9 ();
0x00408104 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408108 lw a0, 0x20(sp) | a0 = *(var_20h);
0x0040810c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00408110 addiu a1, zero, 3 | a1 = 3;
0x00408114 jalr t9 | t9 ();
0x00408118 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040811c bnez v0, 0x40813c |
0x00408120 lui a1, 0x41 | a1 = 0x410000;
0x00408124 lui a2, 0x41 | a2 = 0x410000;
0x00408128 move a0, zero | a0 = 0;
| /* str._s:_d__code_not_int_n */
0x0040812c addiu a1, a1, 0x636c | a1 += 0x636c;
| /* str.cmd_internal_response_didkeymac2 */
0x00408130 addiu a2, a2, 0x7bdc | a2 += 0x7bdc;
0x00408134 j 0x4086a8 | goto label_10;
0x00408138 addiu a3, zero, 0x34b | a3 = 0x34b;
| }
0x0040813c lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x00408140 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00408144 lui s1, 0x43 | s1 = 0x430000;
0x00408148 jalr t9 | t9 ();
0x0040814c lw gp, 0x18(sp) | gp = *(var_18h);
| /* obj.miio */
0x00408150 addiu s0, s1, -0x6dd0 | s0 = s1 + -0x6dd0;
0x00408154 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 != 0) {
0x00408158 beqz v0, 0x4081a0 |
0x0040815c lui a1, 0x41 | a1 = 0x410000;
0x00408160 lui a2, 0x41 | a2 = 0x410000;
0x00408164 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00408168 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_d__code:__d_n */
0x0040816c addiu a1, a1, 0x6384 | a1 += 0x6384;
| /* str.cmd_internal_response_didkeymac2 */
0x00408170 addiu a2, a2, 0x7bdc | a2 += 0x7bdc;
0x00408174 addiu a3, zero, 0x352 | a3 = 0x352;
0x00408178 jalr t9 | t9 ();
0x0040817c lw gp, 0x18(sp) | gp = *(var_18h);
0x00408180 lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
0x00408184 jalr t9 | t9 ();
0x00408188 nop |
0x0040818c lw gp, 0x18(sp) | gp = *(var_18h);
0x00408190 sw v0, 0x200(s0) | *((s0 + 128)) = v0;
0x00408194 addiu v0, zero, 0x1e | v0 = 0x1e;
0x00408198 j 0x4081c0 | goto label_11;
0x0040819c sw v0, 0x204(s0) | *((s0 + 129)) = v0;
| }
0x004081a0 lui a1, 0x41 | a1 = 0x410000;
0x004081a4 lw a2, -0x6dd0(s1) | a2 = *((s1 - 7028));
0x004081a8 addiu a0, zero, 2 | a0 = 2;
| /* str.STATE:___d_____STATE_DEVICE_INIT_n */
0x004081ac addiu a1, a1, 0x63b8 | a1 += 0x63b8;
0x004081b0 jalr t9 | t9 ();
0x004081b4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004081b8 sw zero, -0x6dd0(s1) | *((s1 - 7028)) = 0;
0x004081bc sw zero, 0x200(s0) | *((s0 + 128)) = 0;
| label_11:
0x004081c0 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x004081c4 lw a0, 0x1f0(s0) | a0 = *((s0 + 124));
0x004081c8 addiu a1, zero, 0x1388 | a1 = 0x1388;
0x004081cc addiu a2, zero, 0x1388 | a2 = 0x1388;
0x004081d0 jalr t9 | t9 ();
0x004081d4 j 0x408ac8 | goto label_9;
0x004081d8 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x004081dc lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x004081e0 lui a2, 0x41 | a2 = 0x410000;
0x004081e4 move a0, s0 | a0 = s0;
| /* str.method */
0x004081e8 addiu a1, s3, 0x55d4 | a1 = s3 + 0x55d4;
| /* str._internal.response_dinfo */
0x004081ec addiu a2, a2, 0x6460 | a2 += 0x6460;
0x004081f0 addiu a3, zero, 6 | a3 = 6;
0x004081f4 jalr t9 | t9 ();
0x004081f8 lui s1, 0x41 | s1 = 0x410000;
0x004081fc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00408200 bnez v0, 0x40878c | goto label_12;
| }
0x00408204 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408208 lui a1, 0x41 | a1 = "Got _internal.response_dinfo.\n";
| /* str.Got__internal.response_dinfo._n */
0x0040820c addiu a1, a1, 0x647c |
0x00408210 addiu a0, zero, 3 | a0 = 3;
0x00408214 jalr t9 | t9 ();
0x00408218 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040821c lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x00408220 move a0, s0 | a0 = s0;
0x00408224 jalr t9 | t9 ();
0x00408228 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040822c lui a1, 0x41 | a1 = 0x410000;
0x00408230 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00408234 move a0, v0 | a0 = v0;
| /* str.params */
0x00408238 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040823c addiu a2, sp, 0x24 | a2 = sp + 0x24;
0x00408240 move s2, v0 | s2 = v0;
0x00408244 jalr t9 | t9 ();
0x00408248 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040824c bnez v0, 0x408260 |
0x00408250 lui a1, 0x41 | a1 = 0x410000;
0x00408254 addiu a0, zero, 1 | a0 = 1;
0x00408258 j 0x408978 | goto label_13;
| /* str.no_params_in_response_dinfo:__s_n */
0x0040825c addiu a1, a1, 0x649c | a1 += 0x649c;
| }
0x00408260 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00408264 lw a0, 0x24(sp) | a0 = *(var_24h);
0x00408268 lui a1, 0x41 | a1 = 0x410000;
0x0040826c addiu s3, sp, 0x20 | s3 = sp + 0x20;
| /* esilref: 'did' */
0x00408270 addiu a1, a1, 0x64c0 | a1 += 0x64c0;
0x00408274 move a2, s3 | a2 = s3;
0x00408278 jalr t9 | t9 ();
0x0040827c lw gp, 0x18(sp) | gp = *(var_18h);
0x00408280 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00408284 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00408288 addiu a1, zero, 3 | a1 = 3;
0x0040828c jalr t9 | t9 ();
0x00408290 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00408294 bnez v0, 0x4082b4 |
0x00408298 lui a1, 0x41 | a1 = 0x410000;
0x0040829c lui a2, 0x41 | a2 = 0x410000;
0x004082a0 move a0, zero | a0 = 0;
| /* str._s:_d__did_not_int_n */
0x004082a4 addiu a1, a1, 0x64c4 | a1 += 0x64c4;
| /* str.cmd_internal_response_dinfo */
0x004082a8 addiu a2, a2, 0x7bc0 | a2 += 0x7bc0;
0x004082ac j 0x4086a8 | goto label_10;
0x004082b0 addiu a3, zero, 0x478 | a3 = 0x478;
| }
0x004082b4 lw t9, -0x7d34(gp) | t9 = sym.imp.json_object_get_int64;
0x004082b8 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004082bc lui s5, 0x43 | s5 = 0x430000;
0x004082c0 jalr t9 | t9 ();
0x004082c4 lw gp, 0x18(sp) | gp = *(var_18h);
| /* obj.miio */
0x004082c8 addiu s5, s5, -0x6dd0 | s5 += -0x6dd0;
0x004082cc lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x004082d0 lw a0, 0x24(sp) | a0 = *(var_24h);
0x004082d4 lui a1, 0x41 | a1 = 0x410000;
0x004082d8 sw v1, 0x2e4(s5) | *((s5 + 185)) = v1;
| /* esilref: 'key' */
0x004082dc addiu a1, a1, 0x64d8 | a1 += 0x64d8;
0x004082e0 move a2, s3 | a2 = s3;
0x004082e4 sw v0, 0x2e0(s5) | *((s5 + 184)) = v0;
0x004082e8 jalr t9 | t9 ();
0x004082ec lw gp, 0x18(sp) | gp = *(var_18h);
0x004082f0 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004082f4 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x004082f8 addiu a1, zero, 6 | a1 = 6;
0x004082fc jalr t9 | t9 ();
0x00408300 move s0, s5 | s0 = s5;
0x00408304 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00408308 bnez v0, 0x408378 |
0x0040830c lw v0, 0x2e4(s5) | v0 = *((s5 + 185));
0x00408310 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408314 lui a2, 0x41 | a2 = 0x410000;
0x00408318 lui a1, 0x41 | a1 = 0x410000;
| if (v0 == 0) {
0x0040831c bnez v0, 0x408364 |
0x00408320 lw v0, 0x2e0(s5) | v0 = *((s5 + 184));
0x00408324 sltiu v0, v0, 2 | v0 = (v0 < 2) ? 1 : 0;
0x00408328 move a0, zero | a0 = 0;
| if (v0 == 0) {
0x0040832c beqz v0, 0x408368 | goto label_14;
| }
0x00408330 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_d__key_not_string_n */
0x00408334 addiu a1, a1, 0x64dc | a1 += 0x64dc;
| /* str.cmd_internal_response_dinfo */
0x00408338 addiu a2, a2, 0x7bc0 | a2 += 0x7bc0;
0x0040833c addiu a3, zero, 0x482 | a3 = 0x482;
0x00408340 jalr t9 | t9 ();
0x00408344 lui v0, 0x43 | v0 = 0x430000;
0x00408348 sw zero, -0x6aa0(v0) | *((v0 - 6824)) = 0;
0x0040834c addiu v0, v0, -0x6aa0 | v0 += -0x6aa0;
0x00408350 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408354 sw zero, 4(v0) | *((v0 + 1)) = 0;
0x00408358 sw zero, 8(v0) | *((v0 + 2)) = 0;
0x0040835c j 0x4084cc | goto label_15;
0x00408360 sw zero, 0xc(v0) | *((v0 + 3)) = 0;
| }
0x00408364 move a0, zero | a0 = 0;
| /* str._s:_d__key_not_string_n */
| label_14:
0x00408368 addiu a1, a1, 0x64dc | a1 += 0x64dc;
| /* str.cmd_internal_response_dinfo */
0x0040836c addiu a2, a2, 0x7bc0 | a2 += 0x7bc0;
0x00408370 j 0x4086ac | goto label_16;
0x00408374 addiu a3, zero, 0x485 | a3 = 0x485;
| }
0x00408378 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040837c lw a0, 0x20(sp) | a0 = *(var_20h);
0x00408380 lui s1, 0x43 | s1 = 0x430000;
0x00408384 jalr t9 | t9 ();
0x00408388 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040838c move a0, v0 | a0 = v0;
0x00408390 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00408394 move s4, v0 | s4 = v0;
0x00408398 jalr t9 | t9 ();
0x0040839c move s6, v0 | s6 = v0;
0x004083a0 lbu v0, 0x208(s5) | v0 = *((s5 + 520));
0x004083a4 addiu a0, s1, -0x6aa0 | a0 = s1 + -0x6aa0;
0x004083a8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004083ac sw zero, -0x6aa0(s1) | *((s1 - 6824)) = 0;
0x004083b0 sw zero, 4(a0) | *((a0 + 1)) = 0;
0x004083b4 sw zero, 8(a0) | *((a0 + 2)) = 0;
0x004083b8 sw zero, 0xc(a0) | *((a0 + 3)) = 0;
| if (v0 == 0) {
0x004083bc beqz v0, 0x408454 | goto label_17;
| }
0x004083c0 slti v0, s6, 0x21 | v0 = (s6 < 0x21) ? 1 : 0;
0x004083c4 lw t9, -0x7f50(gp) | t9 = sym.hex2str;
| if (v0 == 0) {
0x004083c8 bnez v0, 0x4083ec |
0x004083cc lui a1, 0x41 | a1 = 0x410000;
0x004083d0 lui a2, 0x41 | a2 = 0x410000;
0x004083d4 sw s4, 0x10(sp) | *(var_10h) = s4;
0x004083d8 move a0, zero | a0 = 0;
| /* str._s:_d__key_too_long____32_:__s_n */
0x004083dc addiu a1, a1, 0x64f4 | a1 += 0x64f4;
| /* str.cmd_internal_response_dinfo */
0x004083e0 addiu a2, a2, 0x7bc0 | a2 += 0x7bc0;
0x004083e4 j 0x40847c | goto label_18;
0x004083e8 addiu a3, zero, 0x495 | a3 = 0x495;
| }
0x004083ec move a2, s4 | a2 = s4;
0x004083f0 move a3, s6 | a3 = s6;
0x004083f4 addiu a1, zero, 0x10 | a1 = 0x10;
0x004083f8 jalr t9 | t9 ();
0x004083fc srl v1, s6, 0x1f | v1 = s6 >> 0x1f;
0x00408400 addu a2, v1, s6 | a2 = v1 + s6;
0x00408404 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408408 sra s6, a2, 1 | s6 = a2 >> 1;
0x0040840c move v0, s5 | v0 = s5;
0x00408410 move v1, s5 | v1 = s5;
| do {
0x00408414 subu a0, v1, v0 | __asm ("subu a0, v1, v0");
0x00408418 slt a0, a0, s6 | a0 = (a0 < s6) ? 1 : 0;
0x0040841c lw t9, -0x7f4c(gp) | t9 = sym.xor_encrypt;
| if (a0 == 0) {
0x00408420 beqz a0, 0x408438 | goto label_19;
| }
0x00408424 lbu a0, 0x330(v1) | a0 = *((v1 + 816));
0x00408428 addiu v1, v1, 1 | v1++;
0x0040842c addiu a0, a0, 0xf | a0 += 0xf;
0x00408430 j 0x408414 |
| } while (1);
0x00408434 sb a0, 0x32f(v1) | *((v1 + 815)) = a0;
| label_19:
0x00408438 lui a0, 0x41 | a0 = "73bcea2K";
| /* str.73bcea2K */
0x0040843c addiu a0, a0, 0x7e80 |
0x00408440 addiu a1, s1, -0x6aa0 | a1 = s1 + -0x6aa0;
0x00408444 move a2, s6 | a2 = s6;
0x00408448 jalr t9 | t9 ();
0x0040844c j 0x4084a0 | goto label_20;
0x00408450 lw gp, 0x18(sp) | gp = *(var_18h);
| label_17:
0x00408454 slti v0, s6, 0x11 | v0 = (s6 < 0x11) ? 1 : 0;
0x00408458 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| if (v0 == 0) {
0x0040845c bnez v0, 0x408490 |
0x00408460 lui a1, 0x41 | a1 = 0x410000;
0x00408464 lui a2, 0x41 | a2 = 0x410000;
0x00408468 sw s4, 0x10(sp) | *(var_10h) = s4;
0x0040846c move a0, zero | a0 = 0;
| /* str._s:_d__key_too_long____16_:__s_n */
0x00408470 addiu a1, a1, 0x6514 | a1 += 0x6514;
| /* str.cmd_internal_response_dinfo */
0x00408474 addiu a2, a2, 0x7bc0 | a2 += 0x7bc0;
0x00408478 addiu a3, zero, 0x4a2 | a3 = 0x4a2;
| label_18:
0x0040847c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408480 jalr t9 | t9 ();
0x00408484 nop |
0x00408488 j 0x408ac8 | goto label_9;
0x0040848c lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00408490 move a1, s4 | a1 = s4;
0x00408494 move a2, s6 | a2 = s6;
0x00408498 jalr t9 | t9 ();
0x0040849c lw gp, 0x18(sp) | gp = *(var_18h);
| label_20:
0x004084a0 addiu v0, zero, 0x10 | v0 = 0x10;
0x004084a4 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
| if (s6 != v0) {
0x004084a8 beq s6, v0, 0x4084d0 |
0x004084ac lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004084b0 lui a1, 0x41 | a1 = 0x410000;
0x004084b4 addiu a0, zero, 1 | a0 = 1;
| /* str.key_size___d____16__maybe_test_key__key_s_n */
0x004084b8 addiu a1, a1, 0x6534 | a1 += 0x6534;
0x004084bc move a2, s6 | a2 = s6;
0x004084c0 addiu a3, s1, -0x6aa0 | a3 = s1 + -0x6aa0;
0x004084c4 jalr t9 | t9 ();
0x004084c8 lw gp, 0x18(sp) | gp = *(var_18h);
| label_15:
0x004084cc lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
| }
0x004084d0 lw a0, 0x24(sp) | a0 = *(var_24h);
0x004084d4 lui a1, 0x41 | a1 = "vendor";
| /* str.vendor */
0x004084d8 addiu a1, a1, 0x6560 |
0x004084dc move a2, s3 | a2 = s3;
0x004084e0 jalr t9 | t9 ();
0x004084e4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004084e8 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004084ec lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x004084f0 addiu a1, zero, 6 | a1 = 6;
0x004084f4 jalr t9 | t9 ();
0x004084f8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004084fc bnez v0, 0x40851c |
0x00408500 lui a1, 0x41 | a1 = 0x410000;
0x00408504 lui a2, 0x41 | a2 = 0x410000;
0x00408508 move a0, zero | a0 = 0;
| /* str._s:_d__vendor_not_string_n */
0x0040850c addiu a1, a1, 0x6568 | a1 += 0x6568;
| /* str.cmd_internal_response_dinfo */
0x00408510 addiu a2, a2, 0x7bc0 | a2 += 0x7bc0;
0x00408514 j 0x4086a8 | goto label_10;
0x00408518 addiu a3, zero, 0x4b0 | a3 = 0x4b0;
| }
0x0040851c lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x00408520 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00408524 jalr t9 | t9 ();
0x00408528 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040852c move a0, v0 | a0 = v0;
0x00408530 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x00408534 move s4, v0 | s4 = v0;
0x00408538 jalr t9 | t9 ();
0x0040853c move s1, v0 | s1 = v0;
0x00408540 sltiu v0, v0, 0x40 | v0 = (v0 < 0x40) ? 1 : 0;
0x00408544 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00408548 bnez v0, 0x408570 |
0x0040854c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408550 lui a1, 0x41 | a1 = 0x410000;
0x00408554 move a2, s1 | a2 = s1;
0x00408558 addiu a0, zero, 1 | a0 = 1;
| /* str.vendor_size___d__too_long_____d_n */
0x0040855c addiu a1, a1, 0x6584 | a1 += 0x6584;
0x00408560 addiu a3, zero, 0x40 | a3 = 0x40;
0x00408564 jalr t9 | t9 ();
0x00408568 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040856c addiu s1, zero, 0x3f | s1 = 0x3f;
| }
0x00408570 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00408574 lui a0, 0x43 | a0 = 0x430000;
0x00408578 move a2, s1 | a2 = s1;
0x0040857c addiu a0, a0, -0x6ae0 | a0 += -0x6ae0;
0x00408580 move a1, s4 | a1 = s4;
0x00408584 jalr t9 | t9 ();
0x00408588 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040858c lw a0, 0x24(sp) | a0 = *(var_24h);
0x00408590 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00408594 addu s1, s0, s1 | s1 = s0 + s1;
0x00408598 lui a1, 0x41 | a1 = 0x4162f4;
| /* esilref: 'mac' */
0x0040859c addiu a1, a1, 0x62f4 |
0x004085a0 move a2, s3 | a2 = s3;
0x004085a4 sb zero, 0x2f0(s1) | *((s1 + 752)) = 0;
0x004085a8 jalr t9 | t9 ();
0x004085ac lw gp, 0x18(sp) | gp = *(var_18h);
0x004085b0 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004085b4 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x004085b8 addiu a1, zero, 6 | a1 = 6;
0x004085bc jalr t9 | t9 ();
0x004085c0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004085c4 bnez v0, 0x4085e4 |
0x004085c8 lui a1, 0x41 | a1 = 0x410000;
0x004085cc lui a2, 0x41 | a2 = 0x410000;
0x004085d0 move a0, zero | a0 = 0;
| /* str._s:_d__mac_not_string_n */
0x004085d4 addiu a1, a1, 0x634c | a1 += 0x634c;
| /* str.cmd_internal_response_dinfo */
0x004085d8 addiu a2, a2, 0x7bc0 | a2 += 0x7bc0;
0x004085dc j 0x4086a8 | goto label_10;
0x004085e0 addiu a3, zero, 0x4c0 | a3 = 0x4c0;
| }
0x004085e4 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x004085e8 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004085ec jalr t9 | t9 ();
0x004085f0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004085f4 move a0, v0 | a0 = v0;
0x004085f8 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004085fc move s4, v0 | s4 = v0;
0x00408600 jalr t9 | t9 ();
0x00408604 move s1, v0 | s1 = v0;
0x00408608 sltiu v0, v0, 0x12 | v0 = (v0 < 0x12) ? 1 : 0;
0x0040860c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00408610 bnez v0, 0x408638 |
0x00408614 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408618 lui a1, 0x41 | a1 = 0x410000;
0x0040861c move a2, s1 | a2 = s1;
0x00408620 addiu a0, zero, 1 | a0 = 1;
| /* str.mac_size___d__too_long_____d_n */
0x00408624 addiu a1, a1, 0x65a8 | a1 += 0x65a8;
0x00408628 addiu a3, zero, 0x12 | a3 = 0x12;
0x0040862c jalr t9 | t9 ();
0x00408630 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408634 addiu s1, zero, 0x11 | s1 = 0x11;
| }
0x00408638 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040863c lui a0, 0x43 | a0 = 0x430000;
0x00408640 move a2, s1 | a2 = s1;
0x00408644 addiu a0, a0, -0x6a58 | a0 += -0x6a58;
0x00408648 move a1, s4 | a1 = s4;
0x0040864c jalr t9 | t9 ();
0x00408650 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408654 lw a0, 0x24(sp) | a0 = *(var_24h);
0x00408658 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040865c addu s1, s0, s1 | s1 = s0 + s1;
0x00408660 lui a1, 0x41 | a1 = "model";
| /* str.model */
0x00408664 addiu a1, a1, 0x65c8 |
0x00408668 move a2, s3 | a2 = s3;
0x0040866c sb zero, 0x378(s1) | *((s1 + 888)) = 0;
0x00408670 jalr t9 | t9 ();
0x00408674 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408678 lw a0, 0x20(sp) | a0 = *(var_20h);
0x0040867c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00408680 addiu a1, zero, 6 | a1 = 6;
0x00408684 jalr t9 | t9 ();
0x00408688 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040868c bnez v0, 0x4086bc | goto label_21;
| }
0x00408690 lui a1, 0x41 | a1 = 0x410000;
0x00408694 lui a2, 0x41 | a2 = 0x410000;
0x00408698 move a0, zero | a0 = 0;
| /* str._s:_d__model_not_string_n */
0x0040869c addiu a1, a1, 0x65d0 | a1 += 0x65d0;
| /* str.cmd_internal_response_dinfo */
0x004086a0 addiu a2, a2, 0x7bc0 | a2 += 0x7bc0;
0x004086a4 addiu a3, zero, 0x4d0 | a3 = 0x4d0;
| do {
| label_10:
0x004086a8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| label_16:
0x004086ac jalr t9 | t9 ();
0x004086b0 nop |
0x004086b4 j 0x408ac8 | goto label_9;
0x004086b8 lw gp, 0x18(sp) | gp = *(var_18h);
| label_21:
0x004086bc lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x004086c0 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004086c4 jalr t9 | t9 ();
0x004086c8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004086cc move a0, v0 | a0 = v0;
0x004086d0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004086d4 move s3, v0 | s3 = v0;
0x004086d8 jalr t9 | t9 ();
0x004086dc move s1, v0 | s1 = v0;
0x004086e0 sltiu v0, v0, 0x18 | v0 = (v0 < 0x18) ? 1 : 0;
0x004086e4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004086e8 bnez v0, 0x408710 |
0x004086ec lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004086f0 lui a1, 0x41 | a1 = 0x410000;
0x004086f4 move a2, s1 | a2 = s1;
0x004086f8 addiu a0, zero, 1 | a0 = 1;
| /* str.model_size___d__too_long_____d_n */
0x004086fc addiu a1, a1, 0x65ec | a1 += 0x65ec;
0x00408700 addiu a3, zero, 0x18 | a3 = 0x18;
0x00408704 jalr t9 | t9 ();
0x00408708 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040870c addiu s1, zero, 0x17 | s1 = 0x17;
| }
0x00408710 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00408714 lui a0, 0x43 | a0 = 0x429590;
0x00408718 addiu a0, a0, -0x6a70 |
0x0040871c move a1, s3 | a1 = s3;
0x00408720 move a2, s1 | a2 = s1;
0x00408724 jalr t9 | t9 ();
0x00408728 lw v0, 0x2e0(s0) | v0 = *((s0 + 184));
0x0040872c lw v1, 0x2e4(s0) | v1 = *((s0 + 185));
0x00408730 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408734 addu s1, s0, s1 | s1 = s0 + s1;
0x00408738 or v0, v0, v1 | v0 |= v1;
0x0040873c lui s3, 0x43 | s3 = 0x430000;
0x00408740 sb zero, 0x360(s1) | *((s1 + 864)) = 0;
0x00408744 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408748 addiu a0, zero, 2 | a0 = 2;
| if (v0 == 0) {
0x0040874c bnez v0, 0x40876c |
0x00408750 lui a1, 0x41 | a1 = 0x410000;
0x00408754 lw a2, -0x6dd0(s3) | a2 = *((s3 - 7028));
| /* str.STATE:___d_____STATE_DIDKEY_REQ1_n */
0x00408758 addiu a1, a1, 0x660c | a1 += 0x660c;
0x0040875c jalr t9 | t9 ();
0x00408760 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408764 j 0x408784 | goto label_22;
0x00408768 addiu v0, zero, 1 | v0 = 1;
| }
0x0040876c lui a1, 0x41 | a1 = 0x410000;
0x00408770 lw a2, -0x6dd0(s3) | a2 = *((s3 - 7028));
| /* str.STATE:___d_____STATE_DIDKEY_DONE_n */
0x00408774 addiu a1, a1, 0x6630 | a1 += 0x6630;
0x00408778 jalr t9 | t9 ();
0x0040877c lw gp, 0x18(sp) | gp = *(var_18h);
0x00408780 addiu v0, zero, 3 | v0 = 3;
| label_22:
0x00408784 j 0x408ac8 | goto label_9;
0x00408788 sw v0, -0x6dd0(s3) | *((s3 - 7028)) = v0;
| label_12:
0x0040878c lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00408790 lui a2, 0x41 | a2 = 0x410000;
0x00408794 move a0, s0 | a0 = s0;
| /* str.method */
0x00408798 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.response_dtoken */
0x0040879c addiu a2, a2, 0x6654 | a2 += 0x6654;
0x004087a0 addiu a3, zero, 6 | a3 = 6;
0x004087a4 jalr t9 | t9 ();
0x004087a8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004087ac bnez v0, 0x4088fc |
0x004087b0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004087b4 lui a1, 0x41 | a1 = "Got _internal.response_dtoken.\n";
| /* str.Got__internal.response_dtoken._n */
0x004087b8 addiu a1, a1, 0x6670 |
0x004087bc addiu a0, zero, 3 | a0 = 3;
0x004087c0 jalr t9 | t9 ();
0x004087c4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004087c8 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x004087cc move a0, s0 | a0 = s0;
0x004087d0 jalr t9 | t9 ();
0x004087d4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004087d8 lui a1, 0x41 | a1 = 0x410000;
0x004087dc lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x004087e0 move a0, v0 | a0 = v0;
| /* str.params */
0x004087e4 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x004087e8 addiu a2, sp, 0x20 | a2 = sp + 0x20;
0x004087ec move s1, v0 | s1 = v0;
0x004087f0 jalr t9 | t9 ();
0x004087f4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004087f8 bnez v0, 0x40881c |
0x004087fc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408800 lui a1, 0x41 | a1 = 0x410000;
0x00408804 addiu a0, zero, 1 | a0 = 1;
| /* str.no_params_in_response_dtoken:__s_n */
0x00408808 addiu a1, a1, 0x6690 | a1 += 0x6690;
0x0040880c move a2, s0 | a2 = s0;
0x00408810 jalr t9 | t9 ();
0x00408814 j 0x40885c | goto label_5;
0x00408818 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040881c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00408820 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00408824 addiu a1, zero, 6 | a1 = 6;
0x00408828 jalr t9 | t9 ();
0x0040882c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00408830 bnez v0, 0x408864 |
0x00408834 lui a1, 0x41 | a1 = 0x410000;
0x00408838 lui a2, 0x41 | a2 = 0x410000;
0x0040883c move a0, zero | a0 = 0;
| /* str._s:_d__token_not_string_n */
0x00408840 addiu a1, a1, 0x66b4 | a1 += 0x66b4;
| /* str.cmd_internal_response_dtoken */
0x00408844 addiu a2, a2, 0x7ba0 | a2 += 0x7ba0;
0x00408848 addiu a3, zero, 0x3fb | a3 = 0x3fb;
| label_6:
0x0040884c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408850 jalr t9 | t9 ();
0x00408854 nop |
0x00408858 lw gp, 0x18(sp) | gp = *(var_18h);
| label_5:
0x0040885c j 0x408acc | goto label_23;
0x00408860 move a0, s1 | a0 = s1;
| }
0x00408864 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x00408868 lw a0, 0x20(sp) | a0 = *(var_20h);
0x0040886c jalr t9 | t9 ();
0x00408870 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408874 move a0, v0 | a0 = v0;
0x00408878 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040887c move s0, v0 | s0 = v0;
0x00408880 jalr t9 | t9 ();
0x00408884 move a2, v0 | a2 = v0;
0x00408888 sltiu v0, v0, 0x11 | v0 = (v0 < 0x11) ? 1 : 0;
0x0040888c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00408890 bnez v0, 0x4088b4 |
0x00408894 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408898 lui a1, 0x41 | a1 = 0x410000;
0x0040889c addiu a0, zero, 1 | a0 = 1;
| /* str.token_size___d__too_long_____d_n */
0x004088a0 addiu a1, a1, 0x66d0 | a1 += 0x66d0;
0x004088a4 addiu a3, zero, 0x10 | a3 = 0x10;
0x004088a8 jalr t9 | t9 ();
0x004088ac lw gp, 0x18(sp) | gp = *(var_18h);
0x004088b0 addiu a2, zero, 0x10 | a2 = 0x10;
| }
0x004088b4 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x004088b8 lui a0, 0x43 | a0 = 0x430000;
0x004088bc move a1, s0 | a1 = s0;
0x004088c0 addiu a0, a0, -0x6a90 | a0 += -0x6a90;
0x004088c4 jalr t9 | t9 ();
0x004088c8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004088cc lui s0, 0x43 | s0 = 0x430000;
0x004088d0 lui a1, 0x41 | a1 = 0x410000;
0x004088d4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004088d8 lw a2, -0x6dd0(s0) | a2 = *((s0 - 7028));
0x004088dc addiu a0, zero, 2 | a0 = 2;
| /* str.STATE:___d_____STATE_TOKEN_DONE_n */
0x004088e0 addiu a1, a1, 0x66f0 | a1 += 0x66f0;
0x004088e4 jalr t9 | t9 ();
0x004088e8 addiu v0, zero, 4 | v0 = 4;
0x004088ec lw gp, 0x18(sp) | gp = *(var_18h);
0x004088f0 sw v0, -0x6dd0(s0) | *((s0 - 7028)) = v0;
| label_7:
0x004088f4 j 0x408acc | goto label_23;
0x004088f8 move a0, s1 | a0 = s1;
| }
0x004088fc lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x00408900 lui a2, 0x41 | a2 = 0x410000;
0x00408904 move a0, s0 | a0 = s0;
| /* str.method */
0x00408908 addiu a1, s1, 0x55d4 | a1 = s1 + 0x55d4;
| /* str._internal.response_dcountry */
0x0040890c addiu a2, a2, 0x6714 | a2 += 0x6714;
0x00408910 addiu a3, zero, 6 | a3 = 6;
0x00408914 jalr t9 | t9 ();
0x00408918 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040891c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 != 0) {
0x00408920 bnez v0, 0x408ae0 | goto label_24;
| }
0x00408924 lui a1, 0x41 | a1 = "Got _internal.response_dcountry.\n";
| /* str.Got__internal.response_dcountry._n */
0x00408928 addiu a1, a1, 0x6730 |
0x0040892c addiu a0, zero, 3 | a0 = 3;
0x00408930 jalr t9 | t9 ();
0x00408934 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408938 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040893c move a0, s0 | a0 = s0;
0x00408940 jalr t9 | t9 ();
0x00408944 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408948 lui a1, 0x41 | a1 = 0x410000;
0x0040894c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00408950 move a0, v0 | a0 = v0;
| /* str.params */
0x00408954 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x00408958 addiu a2, sp, 0x20 | a2 = sp + 0x20;
0x0040895c move s2, v0 | s2 = v0;
0x00408960 jalr t9 | t9 ();
0x00408964 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00408968 bnez v0, 0x40898c |
0x0040896c lui a1, 0x41 | a1 = 0x410000;
0x00408970 addiu a0, zero, 1 | a0 = 1;
| /* str.no_params_in_response_country:__s_n */
0x00408974 addiu a1, a1, 0x6754 | a1 += 0x6754;
| label_13:
0x00408978 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040897c move a2, s0 | a2 = s0;
0x00408980 jalr t9 | t9 ();
0x00408984 j 0x408ac8 | goto label_9;
0x00408988 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040898c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00408990 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00408994 addiu a1, zero, 6 | a1 = 6;
0x00408998 jalr t9 | t9 ();
0x0040899c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x004089a0 bnez v0, 0x4089c0 | goto label_25;
| }
0x004089a4 lui a1, 0x41 | a1 = 0x410000;
0x004089a8 lui a2, 0x41 | a2 = 0x410000;
0x004089ac move a0, zero | a0 = 0;
| /* str._s:_d__token_not_string_n */
0x004089b0 addiu a1, a1, 0x66b4 | a1 += 0x66b4;
| /* str.cmd_internal_response_dcountry */
0x004089b4 addiu a2, a2, 0x7b80 | a2 += 0x7b80;
0x004089b8 j 0x4086a8 |
| } while (1);
0x004089bc addiu a3, zero, 0x41e | a3 = 0x41e;
| label_25:
0x004089c0 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x004089c4 lw a0, 0x20(sp) | a0 = *(var_20h);
0x004089c8 jalr t9 | t9 ();
0x004089cc lw gp, 0x18(sp) | gp = *(var_18h);
0x004089d0 move a0, v0 | a0 = v0;
0x004089d4 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004089d8 move s0, v0 | s0 = v0;
0x004089dc jalr t9 | t9 ();
0x004089e0 move a2, v0 | a2 = v0;
0x004089e4 sltiu v0, v0, 9 | v0 = (v0 < 9) ? 1 : 0;
0x004089e8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004089ec bnez v0, 0x408a14 |
0x004089f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004089f4 lui a1, 0x41 | a1 = 0x410000;
0x004089f8 addiu a0, zero, 1 | a0 = 1;
| /* str.country_size___d__too_long_____d_n */
0x004089fc addiu a1, a1, 0x6778 | a1 += 0x6778;
0x00408a00 addiu a3, zero, 8 | a3 = 8;
0x00408a04 jalr t9 | t9 ();
0x00408a08 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408a0c j 0x408a1c | goto label_26;
0x00408a10 addiu a2, zero, 8 | a2 = 8;
| }
0x00408a14 move a0, s2 | a0 = s2;
| if (a2 != 0) {
0x00408a18 beqz a2, 0x408acc |
| label_26:
0x00408a1c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00408a20 lui a0, 0x43 | a0 = 0x42944c;
0x00408a24 addiu a0, a0, -0x6bb4 |
0x00408a28 move a1, s0 | a1 = s0;
0x00408a2c jalr t9 | t9 ();
0x00408a30 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408a34 lui s1, 0x43 | s1 = 0x429454;
0x00408a38 addiu s1, s1, -0x6bac |
0x00408a3c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00408a40 move a0, s1 | a0 = s1;
0x00408a44 move a1, zero | a1 = 0;
0x00408a48 addiu a2, zero, 0x20 | a2 = 0x20;
0x00408a4c jalr t9 | t9 ();
0x00408a50 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408a54 lui v0, 0x41 | v0 = "ott.io.mi.com";
| /* str.ott.io.mi.com */
0x00408a58 addiu v0, v0, 0x67a4 |
0x00408a5c lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
0x00408a60 lui s3, 0x41 | s3 = 0x410000;
0x00408a64 move a0, s1 | a0 = s1;
0x00408a68 move a3, s0 | a3 = s0;
0x00408a6c addiu a1, zero, 0x20 | a1 = 0x20;
| /* str._s._s */
0x00408a70 addiu a2, s3, 0x679c | a2 = s3 + 0x679c;
0x00408a74 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00408a78 jalr t9 | t9 ();
0x00408a7c lw gp, 0x18(sp) | gp = *(var_18h);
0x00408a80 lui s1, 0x43 | s1 = 0x429474;
0x00408a84 addiu s1, s1, -0x6b8c |
0x00408a88 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00408a8c move a0, s1 | a0 = s1;
0x00408a90 move a1, zero | a1 = 0;
0x00408a94 addiu a2, zero, 0x20 | a2 = 0x20;
0x00408a98 jalr t9 | t9 ();
0x00408a9c lw gp, 0x18(sp) | gp = *(var_18h);
0x00408aa0 lui v0, 0x41 | v0 = "ot.io.mi.com";
| /* str.ot.io.mi.com */
0x00408aa4 addiu v0, v0, 0x67b4 |
0x00408aa8 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
0x00408aac sw v0, 0x10(sp) | *(var_10h) = v0;
0x00408ab0 move a0, s1 | a0 = s1;
0x00408ab4 addiu a1, zero, 0x20 | a1 = 0x20;
| /* str._s._s */
0x00408ab8 addiu a2, s3, 0x679c | a2 = s3 + 0x679c;
0x00408abc move a3, s0 | a3 = s0;
0x00408ac0 jalr t9 | t9 ();
0x00408ac4 lw gp, 0x18(sp) | gp = *(var_18h);
| label_9:
0x00408ac8 move a0, s2 | a0 = s2;
| }
| label_23:
0x00408acc lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x00408ad0 jalr t9 | t9 ();
0x00408ad4 nop |
0x00408ad8 j 0x408af4 | goto label_1;
0x00408adc nop |
| label_24:
0x00408ae0 lui a1, 0x41 | a1 = 0x410000;
0x00408ae4 addiu a0, zero, 1 | a0 = 1;
| /* str.Unknown_msg:__s_n */
0x00408ae8 addiu a1, a1, 0x67c4 | a1 += 0x67c4;
0x00408aec move a2, s0 | a2 = s0;
0x00408af0 jalr t9 | t9 ();
| label_1:
0x00408af4 lw ra, 0x44(sp) | ra = *(var_44h);
0x00408af8 lw s6, 0x40(sp) | s6 = *(var_40h);
0x00408afc lw s5, 0x3c(sp) | s5 = *(var_3ch);
0x00408b00 lw s4, 0x38(sp) | s4 = *(var_38h);
0x00408b04 lw s3, 0x34(sp) | s3 = *(var_34h);
0x00408b08 lw s2, 0x30(sp) | s2 = *(var_30h);
0x00408b0c lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x00408b10 lw s0, 0x28(sp) | s0 = *(var_28h);
0x00408b14 move v0, zero | v0 = 0;
0x00408b18 addiu sp, sp, 0x48 |
0x00408b1c 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 @ 0x408c30 */
| #include <stdint.h>
|
; (fcn) fcn.00408c30 () | void fcn_00408c30 () {
0x00408c30 lui v0, 0x43 | v0 = 0x430000;
0x00408c34 lui gp, 0x43 |
0x00408c38 lw v1, -0x6dd0(v0) | v1 = *((v0 - 7028));
0x00408c3c addiu sp, sp, -0x30 |
0x00408c40 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00408c44 addiu v0, zero, 8 | v0 = 8;
0x00408c48 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00408c4c sw s1, 0x28(sp) | *(var_28h) = s1;
0x00408c50 sw s0, 0x24(sp) | *(var_24h) = s0;
0x00408c54 sw gp, 0x10(sp) | *(var_10h) = gp;
| if (v1 != v0) {
0x00408c58 beq v1, v0, 0x408c6c |
0x00408c5c lui a1, 0x41 | a1 = 0x410000;
0x00408c60 addiu a0, zero, 1 | a0 = 1;
0x00408c64 j 0x408cd8 | goto label_0;
| /* str.cloud_socket_not_ready_yet_...__n */
0x00408c68 addiu a1, a1, 0x6808 | a1 += 0x6808;
| }
0x00408c6c lw t9, -0x7f8c(gp) | t9 = sym.json_verify;
0x00408c70 move s1, a0 | s1 = a0;
0x00408c74 move a0, a1 | a0 = a1;
0x00408c78 move s0, a1 | s0 = a1;
0x00408c7c jalr t9 | t9 ();
0x00408c80 move v1, v0 | v1 = v0;
0x00408c84 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v1 >= 0) {
0x00408c88 bltz v1, 0x408d28 |
0x00408c8c lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x00408c90 lui a1, 0x41 | a1 = 0x410000;
0x00408c94 move a0, s0 | a0 = s0;
| /* esilref: 'id' */
0x00408c98 addiu a1, a1, 0x527c | a1 += 0x527c;
0x00408c9c addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x00408ca0 jalr t9 | t9 ();
0x00408ca4 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x00408ca8 bgez v0, 0x408cb8 |
0x00408cac sw zero, 0x18(sp) | *(var_18h) = 0;
0x00408cb0 j 0x408d1c | goto label_1;
0x00408cb4 move a2, zero | a2 = 0;
| }
0x00408cb8 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x00408cbc addiu a0, zero, 0x10 | a0 = 0x10;
0x00408cc0 jalr t9 | t9 ();
0x00408cc4 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00408cc8 bnez v0, 0x408cec |
0x00408ccc lui a1, 0x41 | a1 = 0x410000;
0x00408cd0 move a0, zero | a0 = 0;
| /* esilref: 'malloc fail
' */
0x00408cd4 addiu a1, a1, 0x544c | a1 += 0x544c;
| label_0:
0x00408cd8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408cdc jalr t9 | t9 ();
0x00408ce0 nop |
0x00408ce4 j 0x408d28 | goto label_2;
0x00408ce8 addiu v0, zero, -1 | v0 = -1;
| }
0x00408cec lw v1, 0x18(sp) | v1 = *(var_18h);
0x00408cf0 lw t9, -0x7f70(gp) | t9 = sym.callback_queue_add;
0x00408cf4 sw v1, (v0) | *(v0) = v1;
0x00408cf8 lui v1, 0x41 | v1 = 0x40a898;
0x00408cfc addiu v1, v1, -0x5768 |
0x00408d00 lui a0, 0x43 | a0 = 0x430000;
0x00408d04 sw v1, 4(v0) | *((v0 + 1)) = v1;
0x00408d08 sw s1, 8(v0) | *((v0 + 2)) = s1;
| /* obj.miio_callback_queue */
0x00408d0c addiu a0, a0, -0x6680 | a0 += -0x6680;
0x00408d10 move a1, v0 | a1 = v0;
0x00408d14 jalr t9 | t9 ();
0x00408d18 addiu a2, zero, 1 | a2 = 1;
| label_1:
0x00408d1c lw a1, 0x18(sp) | a1 = *(var_18h);
0x00408d20 move a0, s0 | a0 = s0;
0x00408d24 jal 0x408b5c | sym_report_to_cloud ();
| }
| label_2:
0x00408d28 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00408d2c lw s1, 0x28(sp) | s1 = *(var_28h);
0x00408d30 lw s0, 0x24(sp) | s0 = *(var_24h);
0x00408d34 addiu sp, sp, 0x30 |
0x00408d38 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 @ 0x408d3c */
| #include <stdint.h>
|
; (fcn) fcn.00408d3c () | void fcn_00408d3c () {
0x00408d3c lui gp, 0x43 |
0x00408d40 addiu gp, gp, 0x1620 |
0x00408d44 addiu sp, sp, -0x30 |
0x00408d48 lw t9, -0x7f8c(gp) | t9 = sym.json_verify;
0x00408d4c sw s0, 0x24(sp) | *(var_24h) = s0;
0x00408d50 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00408d54 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00408d58 sw s1, 0x28(sp) | *(var_28h) = s1;
0x00408d5c move s0, a0 | s0 = a0;
0x00408d60 jalr t9 | t9 ();
0x00408d64 move v1, v0 | v1 = v0;
0x00408d68 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v1 < 0) {
0x00408d6c bltz v1, 0x408e04 | goto label_0;
| }
0x00408d70 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x00408d74 lui a1, 0x41 | a1 = 0x410000;
0x00408d78 move a0, s0 | a0 = s0;
| /* esilref: 'id' */
0x00408d7c addiu a1, a1, 0x527c | a1 += 0x527c;
0x00408d80 addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x00408d84 jalr t9 | t9 ();
0x00408d88 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 >= 0) {
0x00408d8c bgez v0, 0x408da8 | goto label_1;
| }
0x00408d90 move a0, s0 | a0 = s0;
| do {
0x00408d94 move a1, zero | a1 = 0;
0x00408d98 move a2, zero | a2 = 0;
0x00408d9c jal 0x408b5c | sym_report_to_cloud ();
0x00408da0 j 0x408e04 | goto label_0;
0x00408da4 move v0, zero | v0 = 0;
| label_1:
0x00408da8 lw t9, -0x7f9c(gp) | t9 = sym.callback_queue_issue;
0x00408dac lui a0, 0x43 | a0 = 0x430000;
0x00408db0 lw a1, 0x18(sp) | a1 = *(var_18h);
0x00408db4 move a2, s0 | a2 = s0;
| /* obj.miio_callback_queue */
0x00408db8 addiu a0, a0, -0x6680 | a0 += -0x6680;
0x00408dbc jalr t9 | t9 ();
0x00408dc0 move s1, v0 | s1 = v0;
0x00408dc4 lw gp, 0x10(sp) | gp = *(var_10h);
0x00408dc8 lw a2, 0x18(sp) | a2 = *(var_18h);
| if (v0 >= 0) {
0x00408dcc bltz v0, 0x408ddc |
0x00408dd0 lui a3, 0x41 | a3 = 0x410000;
0x00408dd4 j 0x408de4 | goto label_2;
| /* str.mobile */
0x00408dd8 addiu a3, a3, 0x6834 | a3 += 0x6834;
| }
0x00408ddc lui a3, 0x41 | a3 = "cloud";
| /* str.cloud */
0x00408de0 addiu a3, a3, 0x682c |
| label_2:
0x00408de4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408de8 lui a1, 0x41 | a1 = 0x410000;
0x00408dec addiu a0, zero, 2 | a0 = 2;
| /* str.callback_queue_issue___id:__d__to:__s_n */
0x00408df0 addiu a1, a1, 0x683c | a1 += 0x683c;
0x00408df4 jalr t9 | t9 ();
0x00408df8 move a0, s0 | a0 = s0;
0x00408dfc bltz s1, 0x408d94 |
| } while (s1 < 0);
0x00408e00 move v0, zero | v0 = 0;
| label_0:
0x00408e04 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00408e08 lw s1, 0x28(sp) | s1 = *(var_28h);
0x00408e0c lw s0, 0x24(sp) | s0 = *(var_24h);
0x00408e10 addiu sp, sp, 0x30 |
0x00408e14 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 @ 0x408e18 */
| #include <stdint.h>
|
; (fcn) fcn.00408e18 () | void fcn_00408e18 () {
0x00408e18 lui gp, 0x43 |
0x00408e1c addiu sp, sp, -0x1058 |
0x00408e20 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00408e24 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00408e28 sw s3, 0x103c(sp) | *(var_103ch) = s3;
0x00408e2c addiu s3, sp, 0x20 | s3 = sp + 0x20;
0x00408e30 sw s2, 0x1038(sp) | *(var_1038h) = s2;
0x00408e34 sw s1, 0x1034(sp) | *(var_1034h) = s1;
0x00408e38 sw s0, 0x1030(sp) | *(var_1030h) = s0;
0x00408e3c sw gp, 0x18(sp) | *(var_18h) = gp;
0x00408e40 sw a1, 0x105c(sp) | *(arg_105ch) = a1;
0x00408e44 sw ra, 0x1054(sp) | *(var_1054h) = ra;
0x00408e48 sw fp, 0x1050(sp) | *(var_1050h) = fp;
0x00408e4c sw s7, 0x104c(sp) | *(var_104ch) = s7;
0x00408e50 sw s6, 0x1048(sp) | *(var_1048h) = s6;
0x00408e54 sw s5, 0x1044(sp) | *(var_1044h) = s5;
0x00408e58 sw s4, 0x1040(sp) | *(var_1040h) = s4;
0x00408e5c move s2, a0 | s2 = a0;
0x00408e60 move a1, zero | a1 = 0;
0x00408e64 move a0, s3 | a0 = s3;
0x00408e68 addiu a2, zero, 0x1000 | a2 = 0x1000;
0x00408e6c jalr t9 | t9 ();
0x00408e70 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408e74 addiu s0, zero, 1 | s0 = 1;
0x00408e78 move s1, zero | s1 = 0;
| label_5:
0x00408e7c lw t9, -0x7ce0(gp) | t9 = sym.imp.recv;
0x00408e80 addiu a2, zero, 0x1000 | a2 = 0x1000;
0x00408e84 move a0, s2 | a0 = s2;
0x00408e88 addu a1, s3, s1 | a1 = s3 + s1;
0x00408e8c subu a2, a2, s1 | __asm ("subu a2, a2, s1");
0x00408e90 addiu a3, zero, 0x40 | a3 = 0x40;
0x00408e94 jalr t9 | t9 ();
0x00408e98 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00408e9c bltz v0, 0x4097a0 | goto label_6;
| }
0x00408ea0 addu s1, v0, s1 | s1 = v0 + s1;
| if (v0 != 0) {
0x00408ea4 bnel v0, zero, 0x408f68 |
| if (s0 != 0) {
0x00408ea8 beqz s0, 0x408f38 |
0x00408eac nop |
0x00408eb0 lui s0, 0x43 | s0 = miio;
| /* obj.miio */
0x00408eb4 addiu s0, s0, -0x6dd0 |
0x00408eb8 lw v0, 0x2dc(s0) | v0 = *((s0 + 183));
0x00408ebc move a0, s0 | a0 = s0;
0x00408ec0 move a1, s2 | a1 = s2;
| if (s2 == v0) {
0x00408ec4 bne s2, v0, 0x408f00 |
0x00408ec8 lw t9, -0x7f48(gp) | t9 = *((gp - 8146));
0x00408ecc jalr t9 | t9 ();
0x00408ed0 nop |
0x00408ed4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408ed8 lui a1, 0x41 | a1 = 0x410000;
0x00408edc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408ee0 addiu a0, zero, 2 | a0 = 2;
| /* str.BT_conn_fd_closed:__d_n */
0x00408ee4 addiu a1, a1, 0x6864 | a1 += 0x6864;
0x00408ee8 move a2, s2 | a2 = s2;
0x00408eec jalr t9 | t9 ();
0x00408ef0 addiu v0, zero, -1 | v0 = -1;
0x00408ef4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408ef8 j 0x408f38 | goto label_7;
0x00408efc sw v0, 0x2dc(s0) | *((s0 + 183)) = v0;
| }
0x00408f00 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x00408f04 jalr t9 | t9 ();
0x00408f08 nop |
0x00408f0c lw v0, 0x2d4(s0) | v0 = *((s0 + 181));
0x00408f10 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s2 != v0) {
0x00408f14 bne s2, v0, 0x408f38 | goto label_7;
| }
0x00408f18 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408f1c lui a1, 0x41 | a1 = 0x410000;
0x00408f20 addiu a0, zero, 2 | a0 = 2;
| /* str.OT_agent_internalfd_closed:__d_n */
0x00408f24 addiu a1, a1, 0x687c | a1 += 0x687c;
0x00408f28 move a2, s2 | a2 = s2;
0x00408f2c jalr t9 | t9 ();
0x00408f30 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408f34 sw zero, 0x2d4(s0) | *((s0 + 181)) = 0;
| }
| label_7:
0x00408f38 move s0, zero | s0 = 0;
| if (s1 == 0) {
0x00408f3c beqz s1, 0x4097a4 | goto label_8;
| }
0x00408f40 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408f44 addu s1, s3, s1 | s1 = s3 + s1;
0x00408f48 lui a1, 0x41 | a1 = 0x410000;
0x00408f4c sb zero, (s1) | *(s1) = 0;
0x00408f50 addiu a0, zero, 1 | a0 = 1;
| /* str.ot_agent_recv_handler_one___remain_str:__s_n */
0x00408f54 addiu a1, a1, 0x689c | a1 += 0x689c;
0x00408f58 move a2, s3 | a2 = s3;
0x00408f5c jalr t9 | t9 ();
0x00408f60 j 0x4097a8 | goto label_9;
0x00408f64 lw ra, 0x1054(sp) | ra = *(var_1054h);
| }
0x00408f68 lui v0, 0x43 | v0 = 0x430000;
0x00408f6c lbu v0, -0x6bc7(v0) | v0 = *((v0 - 27591));
0x00408f70 sw s1, 0x1024(sp) | *(var_1024h) = s1;
| if (v0 != 0) {
0x00408f74 bnez v0, 0x409234 | goto label_10;
| }
0x00408f78 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408f7c lui a1, 0x41 | a1 = 0x410000;
0x00408f80 lui s0, 0x41 | s0 = 0x410000;
0x00408f84 addiu a0, zero, 2 | a0 = 2;
| /* esilref: '&s
' */
0x00408f88 addiu a1, a1, 0x6510 | a1 += 0x6510;
| /* str.ot_agent_recv_handler_one */
0x00408f8c addiu a2, s0, 0x7c20 | a2 = s0 + 0x7c20;
0x00408f90 jalr t9 | t9 ();
0x00408f94 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408f98 lw a3, 0x1024(sp) | a3 = *(var_1024h);
0x00408f9c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408fa0 lui a1, 0x41 | a1 = 0x410000;
0x00408fa4 addiu a0, zero, 3 | a0 = 3;
| /* str._fd:__d__length:__d_bytes_n */
0x00408fa8 addiu a1, a1, 0x68c8 | a1 += 0x68c8;
0x00408fac move a2, s2 | a2 = s2;
0x00408fb0 jalr t9 | t9 ();
0x00408fb4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408fb8 lw t9, -0x7f8c(gp) | t9 = sym.json_verify;
0x00408fbc move a0, s3 | a0 = s3;
0x00408fc0 jalr t9 | t9 ();
0x00408fc4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00408fc8 bltz v0, 0x409764 | goto label_11;
| }
0x00408fcc lw t9, -0x7d5c(gp) | t9 = sym.imp.json_tokener_new;
0x00408fd0 move s0, zero | s0 = 0;
0x00408fd4 jalr t9 | t9 ();
0x00408fd8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00408fdc move s5, v0 | s5 = v0;
0x00408fe0 move s6, s3 | s6 = s3;
| do {
0x00408fe4 lw a2, 0x1024(sp) | a2 = *(var_1024h);
0x00408fe8 move a0, s5 | a0 = s5;
| if (a2 <= 0) {
0x00408fec blez a2, 0x409220 | goto label_12;
| }
0x00408ff0 lw t9, -0x7d58(gp) | t9 = sym.imp.json_tokener_parse_ex;
0x00408ff4 move a1, s6 | a1 = s6;
0x00408ff8 jalr t9 | t9 ();
0x00408ffc move s7, v0 | s7 = v0;
0x00409000 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00409004 bnez v0, 0x40903c |
0x00409008 lw a3, 0x1024(sp) | a3 = *(var_1024h);
0x0040900c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409010 lui v0, 0x41 | v0 = 0x410000;
0x00409014 lui a1, 0x41 | a1 = 0x410000;
0x00409018 addiu a0, zero, 1 | a0 = 1;
0x0040901c sw s6, 0x10(sp) | *(var_10h) = s6;
0x00409020 sw a3, 0x14(sp) | *(var_14h) = a3;
| /* str._s____token_parse_error_msg:__.s__length:__d_bytes_n */
0x00409024 addiu a1, a1, 0x68e4 | a1 += 0x68e4;
| /* str.ot_agent_recv_handler_one */
0x00409028 addiu a2, v0, 0x7c20 | a2 = v0 + 0x7c20;
0x0040902c jalr t9 | t9 ();
0x00409030 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409034 j 0x409220 | goto label_12;
0x00409038 move a0, s5 | a0 = s5;
| }
0x0040903c lw fp, 0x18(s5) | fp = *((s5 + 6));
0x00409040 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x00409044 addiu a0, fp, 1 | a0 = fp + 1;
0x00409048 jalr t9 | t9 ();
0x0040904c move s4, v0 | s4 = v0;
0x00409050 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00409054 bnez v0, 0x409090 |
0x00409058 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040905c lui v0, 0x41 | v0 = 0x410000;
0x00409060 lui a1, 0x41 | a1 = 0x410000;
0x00409064 addiu a0, zero, 1 | a0 = 1;
| /* str._s____malloc_error_n */
0x00409068 addiu a1, a1, 0x691c | a1 += 0x691c;
| /* str.ot_agent_recv_handler_one */
0x0040906c addiu a2, v0, 0x7c20 | a2 = v0 + 0x7c20;
0x00409070 jalr t9 | t9 ();
0x00409074 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409078 lw t9, -0x7d90(gp) | t9 = sym.imp.json_tokener_free;
0x0040907c move a0, s5 | a0 = s5;
0x00409080 jalr t9 | t9 ();
0x00409084 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409088 j 0x40930c | goto label_13;
0x0040908c move a0, s7 | a0 = s7;
| }
0x00409090 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00409094 move a2, fp | a2 = fp;
0x00409098 move a0, v0 | a0 = v0;
0x0040909c move a1, s6 | a1 = s6;
0x004090a0 jalr t9 | t9 ();
0x004090a4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004090a8 addu fp, s4, fp | fp = s4 + fp;
0x004090ac lw t9, -0x7fa4(gp) | t9 = *((gp - 8169));
0x004090b0 lui a1, 0x41 | a1 = 0x410000;
0x004090b4 move a0, s4 | a0 = s4;
0x004090b8 sb zero, (fp) | *(fp) = 0;
| /* str.method */
0x004090bc addiu a1, a1, 0x55d4 | a1 += 0x55d4;
0x004090c0 jalr t9 | t9 ();
0x004090c4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004090c8 move a0, s4 | a0 = s4;
| if (v0 == 0) {
0x004090cc bnez v0, 0x4091d8 |
0x004090d0 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x004090d4 jalr t9 | t9 ();
0x004090d8 nop |
0x004090dc lw gp, 0x18(sp) | gp = *(var_18h);
0x004090e0 lui a1, 0x41 | a1 = 0x410000;
0x004090e4 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x004090e8 move a0, v0 | a0 = v0;
| /* str.method */
0x004090ec addiu a1, a1, 0x55d4 | a1 += 0x55d4;
0x004090f0 addiu a2, sp, 0x1020 | a2 = sp + 0x1020;
0x004090f4 move fp, v0 | fp = v0;
0x004090f8 jalr t9 | t9 ();
0x004090fc lw gp, 0x18(sp) | gp = *(var_18h);
0x00409100 lw a0, 0x1020(sp) | a0 = *(var_1020h);
0x00409104 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00409108 addiu a1, zero, 6 | a1 = 6;
0x0040910c jalr t9 | t9 ();
0x00409110 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00409114 bnez v0, 0x409130 |
0x00409118 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040911c move a0, fp | a0 = fp;
0x00409120 jalr t9 | t9 ();
0x00409124 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409128 j 0x40937c | goto label_14;
0x0040912c move a0, s7 | a0 = s7;
| }
0x00409130 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x00409134 lw a0, 0x1020(sp) | a0 = *(var_1020h);
0x00409138 jalr t9 | t9 ();
0x0040913c lw gp, 0x18(sp) | gp = *(var_18h);
0x00409140 lui a1, 0x41 | a1 = 0x410000;
0x00409144 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x00409148 move a0, v0 | a0 = v0;
| /* str._internal. */
0x0040914c addiu a1, a1, 0x6930 | a1 += 0x6930;
0x00409150 addiu a2, zero, 0xa | a2 = 0xa;
0x00409154 sw v0, 0x102c(sp) | *(var_102ch) = v0;
0x00409158 jalr t9 | t9 ();
0x0040915c lw gp, 0x18(sp) | gp = *(var_18h);
0x00409160 lw a3, 0x102c(sp) | a3 = *(var_102ch);
| if (v0 == 0) {
0x00409164 bnez v0, 0x40917c |
0x00409168 move a0, s2 | a0 = s2;
0x0040916c move a1, s4 | a1 = s4;
0x00409170 jal 0x407848 | fcn_00407848 ();
0x00409174 j 0x4091c4 | goto label_15;
0x00409178 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040917c lui v0, 0x41 | v0 = 0x410000;
0x00409180 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x00409184 move a0, a3 | a0 = a3;
0x00409188 sw a3, 0x102c(sp) | *(var_102ch) = a3;
| /* str.local. */
0x0040918c addiu a1, v0, 0x693c | a1 = v0 + 0x693c;
0x00409190 addiu a2, zero, 6 | a2 = 6;
0x00409194 jalr t9 | t9 ();
0x00409198 lw a3, 0x102c(sp) | a3 = *(var_102ch);
0x0040919c move a0, s2 | a0 = s2;
| if (v0 == 0) {
0x004091a0 bnez v0, 0x4091b8 |
0x004091a4 lw a1, 0x105c(sp) | a1 = *(arg_105ch);
0x004091a8 move a2, s4 | a2 = s4;
0x004091ac jal 0x405fd4 | fcn_00405fd4 ();
0x004091b0 j 0x4091c4 | goto label_15;
0x004091b4 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x004091b8 move a1, s4 | a1 = s4;
0x004091bc jal 0x408c30 | fcn_00408c30 ();
0x004091c0 lw gp, 0x18(sp) | gp = *(var_18h);
| label_15:
0x004091c4 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x004091c8 move a0, fp | a0 = fp;
0x004091cc jalr t9 | t9 ();
0x004091d0 j 0x4091e4 | goto label_16;
0x004091d4 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x004091d8 jal 0x408d3c | fcn_00408d3c ();
0x004091dc nop |
0x004091e0 lw gp, 0x18(sp) | gp = *(var_18h);
| label_16:
0x004091e4 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x004091e8 move a0, s4 | a0 = s4;
0x004091ec jalr t9 | t9 ();
0x004091f0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004091f4 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x004091f8 move a0, s7 | a0 = s7;
0x004091fc jalr t9 | t9 ();
0x00409200 lw v1, 0x18(s5) | v1 = *((s5 + 6));
0x00409204 lw v0, 0x1024(sp) | v0 = *(var_1024h);
0x00409208 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040920c subu v0, v0, v1 | __asm ("subu v0, v0, v1");
0x00409210 addu s0, s0, v1 | s0 += v1;
0x00409214 addu s6, s6, v1 | s6 += v1;
0x00409218 j 0x408fe4 |
| } while (1);
0x0040921c sw v0, 0x1024(sp) | *(var_1024h) = v0;
| label_12:
0x00409220 lw t9, -0x7d90(gp) | t9 = sym.imp.json_tokener_free;
0x00409224 jalr t9 | t9 ();
0x00409228 nop |
0x0040922c j 0x4094b8 | goto label_17;
0x00409230 lw gp, 0x18(sp) | gp = *(var_18h);
| label_10:
0x00409234 lw t9, -0x7fa4(gp) | t9 = *((gp - 8169));
0x00409238 lui v0, 0x41 | v0 = 0x410000;
0x0040923c move a0, s3 | a0 = s3;
| /* str.method */
0x00409240 addiu a1, v0, 0x55d4 | a1 = v0 + 0x55d4;
0x00409244 jalr t9 | t9 ();
0x00409248 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040924c bnez v0, 0x4094c0 | goto label_18;
| }
0x00409250 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409254 lui a1, 0x41 | a1 = 0x410000;
0x00409258 lui fp, 0x41 | fp = 0x410000;
0x0040925c addiu a0, zero, 2 | a0 = 2;
| /* esilref: '&s
' */
0x00409260 addiu a1, a1, 0x6510 | a1 += 0x6510;
| /* str.ot_agent_recv_handler_one */
0x00409264 addiu a2, fp, 0x7c20 | a2 = fp + 0x7c20;
0x00409268 jalr t9 | t9 ();
0x0040926c lw gp, 0x18(sp) | gp = *(var_18h);
0x00409270 lw a3, 0x1024(sp) | a3 = *(var_1024h);
0x00409274 lui a1, 0x41 | a1 = 0x410000;
0x00409278 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040927c sw a3, 0x14(sp) | *(var_14h) = a3;
0x00409280 addiu a0, zero, 3 | a0 = 3;
| /* str.fd:__d__local_msg:__.s__length:__d_bytes_n */
0x00409284 addiu a1, a1, 0x6944 | a1 += 0x6944;
0x00409288 move a2, s2 | a2 = s2;
0x0040928c sw s3, 0x10(sp) | *(var_10h) = s3;
0x00409290 jalr t9 | t9 ();
0x00409294 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409298 move s0, zero | s0 = 0;
0x0040929c lw t9, -0x7d5c(gp) | t9 = sym.imp.json_tokener_new;
0x004092a0 move s7, s3 | s7 = s3;
0x004092a4 jalr t9 | t9 ();
0x004092a8 move s5, v0 | s5 = v0;
0x004092ac addiu v0, sp, 0x1020 | v0 = sp + 0x1020;
0x004092b0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004092b4 j 0x409414 | goto label_19;
0x004092b8 sw v0, 0x1028(sp) | *(var_1028h) = v0;
| do {
0x004092bc lw fp, 0x18(s5) | fp = *((s5 + 6));
0x004092c0 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x004092c4 addiu a0, fp, 1 | a0 = fp + 1;
0x004092c8 jalr t9 | t9 ();
0x004092cc move s4, v0 | s4 = v0;
0x004092d0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004092d4 bnez v0, 0x409324 |
0x004092d8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004092dc lui v0, 0x41 | v0 = 0x410000;
0x004092e0 lui a1, 0x41 | a1 = 0x410000;
0x004092e4 addiu a0, zero, 1 | a0 = 1;
| /* str._s____malloc_error_n */
0x004092e8 addiu a1, a1, 0x691c | a1 += 0x691c;
| /* str.ot_agent_recv_handler_one */
0x004092ec addiu a2, v0, 0x7c20 | a2 = v0 + 0x7c20;
0x004092f0 jalr t9 | t9 ();
0x004092f4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004092f8 lw t9, -0x7d90(gp) | t9 = sym.imp.json_tokener_free;
0x004092fc move a0, s5 | a0 = s5;
0x00409300 jalr t9 | t9 ();
0x00409304 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409308 move a0, s6 | a0 = s6;
| label_13:
0x0040930c lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x00409310 jalr t9 | t9 ();
0x00409314 nop |
0x00409318 lw gp, 0x18(sp) | gp = *(var_18h);
| label_0:
0x0040931c j 0x409768 | goto label_20;
0x00409320 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| }
0x00409324 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00409328 move a0, v0 | a0 = v0;
0x0040932c move a1, s7 | a1 = s7;
0x00409330 move a2, fp | a2 = fp;
0x00409334 jalr t9 | t9 ();
0x00409338 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040933c addu v1, s4, fp | v1 = s4 + fp;
0x00409340 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x00409344 lui a1, 0x41 | a1 = 0x410000;
0x00409348 sb zero, (v1) | *(v1) = 0;
0x0040934c move a0, s6 | a0 = s6;
| /* str.method */
0x00409350 addiu a1, a1, 0x55d4 | a1 += 0x55d4;
0x00409354 addiu a2, sp, 0x1020 | a2 = sp + 0x1020;
0x00409358 jalr t9 | t9 ();
0x0040935c lw gp, 0x18(sp) | gp = *(var_18h);
0x00409360 lw a0, 0x1020(sp) | a0 = *(var_1020h);
0x00409364 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x00409368 addiu a1, zero, 6 | a1 = 6;
0x0040936c jalr t9 | t9 ();
0x00409370 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00409374 bnez v0, 0x409394 |
| label_1:
0x00409378 move a0, s6 | a0 = s6;
| label_14:
0x0040937c lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x00409380 jalr t9 | t9 ();
0x00409384 nop |
0x00409388 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040938c j 0x4096ac | goto label_21;
0x00409390 move a0, s5 | a0 = s5;
| }
0x00409394 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x00409398 lw a0, 0x1020(sp) | a0 = *(var_1020h);
0x0040939c jalr t9 | t9 ();
0x004093a0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004093a4 lui a1, 0x41 | a1 = 0x410000;
0x004093a8 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x004093ac move a0, v0 | a0 = v0;
| /* str._internal. */
0x004093b0 addiu a1, a1, 0x6930 | a1 += 0x6930;
0x004093b4 addiu a2, zero, 0xa | a2 = 0xa;
0x004093b8 sw v0, 0x102c(sp) | *(var_102ch) = v0;
0x004093bc jalr t9 | t9 ();
0x004093c0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004093c4 lw a3, 0x102c(sp) | a3 = *(var_102ch);
| if (v0 != 0) {
0x004093c8 bnez v0, 0x409478 | goto label_22;
| }
0x004093cc move a0, s2 | a0 = s2;
0x004093d0 move a1, s4 | a1 = s4;
0x004093d4 jal 0x407848 | fcn_00407848 ();
0x004093d8 lw gp, 0x18(sp) | gp = *(var_18h);
| label_2:
0x004093dc lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x004093e0 move a0, s4 | a0 = s4;
0x004093e4 jalr t9 | t9 ();
0x004093e8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004093ec lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x004093f0 move a0, s6 | a0 = s6;
0x004093f4 jalr t9 | t9 ();
0x004093f8 lw v1, 0x18(s5) | v1 = *((s5 + 6));
0x004093fc lw v0, 0x1024(sp) | v0 = *(var_1024h);
0x00409400 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409404 subu v0, v0, v1 | __asm ("subu v0, v0, v1");
0x00409408 addu s0, s0, v1 | s0 += v1;
0x0040940c addu s7, s7, v1 | s7 += v1;
0x00409410 sw v0, 0x1024(sp) | *(var_1024h) = v0;
| label_19:
0x00409414 lw a2, 0x1024(sp) | a2 = *(var_1024h);
0x00409418 lw t9, -0x7d58(gp) | t9 = sym.imp.json_tokener_parse_ex;
| if (a2 <= 0) {
0x0040941c blez a2, 0x4094b8 | goto label_17;
| }
0x00409420 move a0, s5 | a0 = s5;
0x00409424 move a1, s7 | a1 = s7;
0x00409428 jalr t9 | t9 ();
0x0040942c move s6, v0 | s6 = v0;
0x00409430 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409434 bnez v0, 0x4092bc |
| } while (v0 != 0);
0x00409438 lw a3, 0x1024(sp) | a3 = *(var_1024h);
0x0040943c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409440 lui v0, 0x41 | v0 = 0x410000;
0x00409444 lui a1, 0x41 | a1 = 0x410000;
0x00409448 sw a3, 0x14(sp) | *(var_14h) = a3;
0x0040944c addiu a0, zero, 1 | a0 = 1;
| /* str._s____token_parse_error_msg:__.s__length:__d_bytes_n */
0x00409450 addiu a1, a1, 0x68e4 | a1 += 0x68e4;
| /* str.ot_agent_recv_handler_one */
0x00409454 addiu a2, v0, 0x7c20 | a2 = v0 + 0x7c20;
0x00409458 sw s7, 0x10(sp) | *(var_10h) = s7;
0x0040945c jalr t9 | t9 ();
0x00409460 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409464 lw t9, -0x7d90(gp) | t9 = sym.imp.json_tokener_free;
0x00409468 move a0, s5 | a0 = s5;
0x0040946c jalr t9 | t9 ();
0x00409470 j 0x40931c | goto label_0;
0x00409474 lw gp, 0x18(sp) | gp = *(var_18h);
| label_22:
0x00409478 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x0040947c lui a1, 0x41 | a1 = 0x410000;
0x00409480 move a0, a3 | a0 = a3;
0x00409484 sw a3, 0x102c(sp) | *(var_102ch) = a3;
| /* str.local. */
0x00409488 addiu a1, a1, 0x693c | a1 += 0x693c;
0x0040948c addiu a2, zero, 6 | a2 = 6;
0x00409490 jalr t9 | t9 ();
0x00409494 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409498 lw a3, 0x102c(sp) | a3 = *(var_102ch);
| if (v0 != 0) {
0x0040949c bnez v0, 0x409378 | goto label_1;
| }
0x004094a0 lw a1, 0x105c(sp) | a1 = *(arg_105ch);
0x004094a4 move a0, s2 | a0 = s2;
0x004094a8 move a2, s4 | a2 = s4;
0x004094ac jal 0x405fd4 | fcn_00405fd4 ();
0x004094b0 j 0x4093dc | goto label_2;
0x004094b4 lw gp, 0x18(sp) | gp = *(var_18h);
| label_17:
0x004094b8 j 0x40975c | goto label_23;
0x004094bc move a1, s0 | a1 = s0;
| label_18:
0x004094c0 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x004094c4 move a0, s1 | a0 = s1;
0x004094c8 jalr t9 | t9 ();
0x004094cc move s4, v0 | s4 = v0;
0x004094d0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x004094d4 bnez v0, 0x4094f8 |
0x004094d8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004094dc lui a1, 0x41 | a1 = 0x410000;
0x004094e0 move a0, zero | a0 = 0;
| /* str.malloc_error:__d_n */
0x004094e4 addiu a1, a1, 0x6970 | a1 += 0x6970;
0x004094e8 move a2, s1 | a2 = s1;
0x004094ec jalr t9 | t9 ();
0x004094f0 j 0x40931c | goto label_0;
0x004094f4 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x004094f8 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x004094fc move a0, v0 | a0 = v0;
0x00409500 move a1, zero | a1 = 0;
0x00409504 move a2, s1 | a2 = s1;
0x00409508 jalr t9 | t9 ();
0x0040950c lw gp, 0x18(sp) | gp = *(var_18h);
0x00409510 addiu v0, sp, 0x1024 | v0 = sp + 0x1024;
0x00409514 lw t9, -0x7f44(gp) | t9 = sym.data_decrypt;
0x00409518 lui a0, 0x41 | a0 = 0x410000;
0x0040951c sw s1, 0x1024(sp) | *(var_1024h) = s1;
0x00409520 sw v0, 0x10(sp) | *(var_10h) = v0;
| /* str.5_d_VdmW6_0u_k */
0x00409524 addiu a0, a0, 0x7e6c | a0 += 0x7e6c;
0x00409528 move a1, s3 | a1 = s3;
0x0040952c move a2, s1 | a2 = s1;
0x00409530 move a3, s4 | a3 = s4;
0x00409534 jalr t9 | t9 ();
0x00409538 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040953c move s0, v0 | s0 = v0;
0x00409540 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 < 0) {
0x00409544 bgez v0, 0x409560 |
0x00409548 lui a1, 0x41 | a1 = 0x410000;
0x0040954c move a0, zero | a0 = 0;
| /* str.data_decrypt_error_n */
0x00409550 addiu a1, a1, 0x6984 | a1 += 0x6984;
0x00409554 jalr t9 | t9 ();
0x00409558 j 0x4096bc | goto label_3;
0x0040955c lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x00409560 lui a1, 0x41 | a1 = 0x410000;
0x00409564 lui s5, 0x41 | s5 = 0x410000;
0x00409568 addiu a0, zero, 2 | a0 = 2;
| /* esilref: '&s
' */
0x0040956c addiu a1, a1, 0x6510 | a1 += 0x6510;
| /* str.ot_agent_recv_handler_one */
0x00409570 addiu a2, s5, 0x7c20 | a2 = s5 + 0x7c20;
0x00409574 jalr t9 | t9 ();
0x00409578 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040957c lw v0, 0x1024(sp) | v0 = *(var_1024h);
0x00409580 lui a1, 0x41 | a1 = 0x410000;
0x00409584 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409588 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040958c addiu a0, zero, 3 | a0 = 3;
| /* str.fd:__d__msg:__s__length:__d_bytes_n */
0x00409590 addiu a1, a1, 0x6998 | a1 += 0x6998;
0x00409594 move a2, s2 | a2 = s2;
0x00409598 move a3, s4 | a3 = s4;
0x0040959c jalr t9 | t9 ();
0x004095a0 lw gp, 0x18(sp) | gp = *(var_18h);
0x004095a4 lw t9, -0x7f8c(gp) | t9 = sym.json_verify;
0x004095a8 move a0, s4 | a0 = s4;
0x004095ac jalr t9 | t9 ();
0x004095b0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x004095b4 bltz v0, 0x4096bc | goto label_3;
| }
0x004095b8 lw t9, -0x7d5c(gp) | t9 = sym.imp.json_tokener_new;
0x004095bc move s5, s4 | s5 = s4;
0x004095c0 jalr t9 | t9 ();
0x004095c4 move s7, v0 | s7 = v0;
0x004095c8 j 0x409658 | goto label_24;
0x004095cc lw gp, 0x18(sp) | gp = *(var_18h);
| do {
0x004095d0 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x004095d4 move a2, v1 | a2 = v1;
0x004095d8 move a0, v0 | a0 = v0;
0x004095dc move a1, s5 | a1 = s5;
0x004095e0 sw v1, 0x102c(sp) | *(var_102ch) = v1;
0x004095e4 jalr t9 | t9 ();
0x004095e8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004095ec lw v1, 0x102c(sp) | v1 = *(var_102ch);
0x004095f0 lui a1, 0x41 | a1 = 0x410000;
0x004095f4 addu v1, s6, v1 | v1 = s6 + v1;
0x004095f8 lw t9, -0x7fa4(gp) | t9 = *((gp - 8169));
0x004095fc sb zero, (v1) | *(v1) = 0;
0x00409600 move a0, s5 | a0 = s5;
| /* str.method */
0x00409604 addiu a1, a1, 0x55d4 | a1 += 0x55d4;
0x00409608 jalr t9 | t9 ();
0x0040960c move a0, s2 | a0 = s2;
| if (v0 != 0) {
0x00409610 bnez v0, 0x409738 | goto label_25;
| }
0x00409614 move a1, s6 | a1 = s6;
0x00409618 jal 0x408c30 | fcn_00408c30 ();
0x0040961c lw gp, 0x18(sp) | gp = *(var_18h);
| label_4:
0x00409620 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00409624 move a0, s6 | a0 = s6;
0x00409628 jalr t9 | t9 ();
0x0040962c lw gp, 0x18(sp) | gp = *(var_18h);
0x00409630 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x00409634 move a0, fp | a0 = fp;
0x00409638 jalr t9 | t9 ();
0x0040963c lw v1, 0x18(s7) | v1 = *((s7 + 6));
0x00409640 lw v0, 0x1024(sp) | v0 = *(var_1024h);
0x00409644 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409648 subu v0, v0, v1 | __asm ("subu v0, v0, v1");
0x0040964c addu s0, s0, v1 | s0 += v1;
0x00409650 addu s5, s5, v1 | s5 += v1;
0x00409654 sw v0, 0x1024(sp) | *(var_1024h) = v0;
| label_24:
0x00409658 lw a2, 0x1024(sp) | a2 = *(var_1024h);
0x0040965c lw t9, -0x7d58(gp) | t9 = sym.imp.json_tokener_parse_ex;
| if (a2 <= 0) {
0x00409660 blez a2, 0x409748 | goto label_26;
| }
0x00409664 move a0, s7 | a0 = s7;
0x00409668 move a1, s5 | a1 = s5;
0x0040966c jalr t9 | t9 ();
0x00409670 move fp, v0 | fp = v0;
0x00409674 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00409678 bnez v0, 0x4096d0 |
0x0040967c lw a3, 0x1024(sp) | a3 = *(var_1024h);
0x00409680 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409684 lui v0, 0x41 | v0 = 0x410000;
0x00409688 lui a1, 0x41 | a1 = 0x410000;
0x0040968c addiu a0, zero, 1 | a0 = 1;
0x00409690 sw s5, 0x10(sp) | *(var_10h) = s5;
0x00409694 sw a3, 0x14(sp) | *(var_14h) = a3;
| /* str._s____token_parse_error_msg:__.s__length:__d_bytes_n */
0x00409698 addiu a1, a1, 0x68e4 | a1 += 0x68e4;
| /* str.ot_agent_recv_handler_one */
0x0040969c addiu a2, v0, 0x7c20 | a2 = v0 + 0x7c20;
0x004096a0 jalr t9 | t9 ();
0x004096a4 lw gp, 0x18(sp) | gp = *(var_18h);
0x004096a8 move a0, s7 | a0 = s7;
| label_21:
0x004096ac lw t9, -0x7d90(gp) | t9 = sym.imp.json_tokener_free;
0x004096b0 jalr t9 | t9 ();
0x004096b4 nop |
0x004096b8 lw gp, 0x18(sp) | gp = *(var_18h);
| label_3:
0x004096bc lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x004096c0 move a0, s4 | a0 = s4;
0x004096c4 jalr t9 | t9 ();
0x004096c8 j 0x40931c | goto label_0;
0x004096cc lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x004096d0 lw v1, 0x18(s7) | v1 = *((s7 + 6));
0x004096d4 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x004096d8 addiu a0, v1, 1 | a0 = v1 + 1;
0x004096dc sw v1, 0x102c(sp) | *(var_102ch) = v1;
0x004096e0 jalr t9 | t9 ();
0x004096e4 move s6, v0 | s6 = v0;
0x004096e8 lw gp, 0x18(sp) | gp = *(var_18h);
0x004096ec lw v1, 0x102c(sp) | v1 = *(var_102ch);
0x004096f0 bnez v0, 0x4095d0 |
| } while (v0 != 0);
0x004096f4 lui v0, 0x41 | v0 = 0x410000;
0x004096f8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004096fc lui a1, 0x41 | a1 = "%s(), malloc error\n";
| /* str._s____malloc_error_n */
0x00409700 addiu a1, a1, 0x691c |
| /* str.ot_agent_recv_handler_one */
0x00409704 addiu a2, v0, 0x7c20 | a2 = v0 + 0x7c20;
0x00409708 addiu a0, zero, 1 | a0 = 1;
0x0040970c jalr t9 | t9 ();
0x00409710 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409714 lw t9, -0x7d90(gp) | t9 = sym.imp.json_tokener_free;
0x00409718 move a0, s7 | a0 = s7;
0x0040971c jalr t9 | t9 ();
0x00409720 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409724 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x00409728 move a0, fp | a0 = fp;
0x0040972c jalr t9 | t9 ();
0x00409730 j 0x4096bc | goto label_3;
0x00409734 lw gp, 0x18(sp) | gp = *(var_18h);
| label_25:
0x00409738 move a0, s6 | a0 = s6;
0x0040973c jal 0x408d3c | fcn_00408d3c ();
0x00409740 j 0x409620 | goto label_4;
0x00409744 lw gp, 0x18(sp) | gp = *(var_18h);
| label_26:
0x00409748 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x0040974c move a0, s4 | a0 = s4;
0x00409750 jalr t9 | t9 ();
0x00409754 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409758 sll a1, s0, 1 | a1 = s0 << 1;
| label_23:
0x0040975c lw t9, -0x7cfc(gp) | t9 = sym.imp.memmove;
| if (a1 < 0) {
0x00409760 bgez a1, 0x409780 |
| label_11:
0x00409764 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| label_20:
0x00409768 lui a1, 0x41 | a1 = 0x410000;
0x0040976c addiu a0, zero, 1 | a0 = 1;
| /* str.ot_agent_recv_handler_one___return__1_n */
0x00409770 addiu a1, a1, 0x69bc | a1 += 0x69bc;
0x00409774 jalr t9 | t9 ();
0x00409778 j 0x4097a4 | goto label_8;
0x0040977c addiu s0, zero, -1 | s0 = -1;
| }
0x00409780 subu s1, s1, a1 | __asm ("subu s1, s1, a1");
0x00409784 move a0, s3 | a0 = s3;
0x00409788 addu a1, s3, a1 | a1 = s3 + a1;
0x0040978c move a2, s1 | a2 = s1;
0x00409790 jalr t9 | t9 ();
0x00409794 move s0, zero | s0 = 0;
0x00409798 j 0x408e7c | goto label_5;
0x0040979c lw gp, 0x18(sp) | gp = *(var_18h);
| label_6:
0x004097a0 addiu s0, zero, -1 | s0 = -1;
| label_8:
0x004097a4 lw ra, 0x1054(sp) | ra = *(var_1054h);
| label_9:
0x004097a8 move v0, s0 | v0 = s0;
0x004097ac lw fp, 0x1050(sp) | fp = *(var_1050h);
0x004097b0 lw s7, 0x104c(sp) | s7 = *(var_104ch);
0x004097b4 lw s6, 0x1048(sp) | s6 = *(var_1048h);
0x004097b8 lw s5, 0x1044(sp) | s5 = *(var_1044h);
0x004097bc lw s4, 0x1040(sp) | s4 = *(var_1040h);
0x004097c0 lw s3, 0x103c(sp) | s3 = *(var_103ch);
0x004097c4 lw s2, 0x1038(sp) | s2 = *(var_1038h);
0x004097c8 lw s1, 0x1034(sp) | s1 = *(var_1034h);
0x004097cc lw s0, 0x1030(sp) | s0 = *(var_1030h);
0x004097d0 addiu sp, sp, 0x1058 |
0x004097d4 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 @ 0x40989c */
| #include <stdint.h>
|
; (fcn) fcn.0040989c () | void fcn_0040989c () {
0x0040989c addiu sp, sp, -0x280 |
0x004098a0 sw s1, 0x260(sp) | *(var_260h) = s1;
0x004098a4 lui s1, 0x43 | s1 = 0x430000;
0x004098a8 sw s0, 0x25c(sp) | *(var_25ch) = s0;
0x004098ac lui gp, 0x43 |
| /* obj.miio */
0x004098b0 addiu s0, s1, -0x6dd0 | s0 = s1 + -0x6dd0;
0x004098b4 addiu gp, gp, 0x1620 | gp += 0x1620;
0x004098b8 lw a0, 0x2a0(s0) | a0 = *((s0 + 168));
0x004098bc lw t9, -0x7fac(gp) | t9 = sym.get_port;
0x004098c0 sw ra, 0x27c(sp) | *(var_27ch) = ra;
0x004098c4 sw s3, 0x268(sp) | *(var_268h) = s3;
0x004098c8 sw s2, 0x264(sp) | *(var_264h) = s2;
0x004098cc sw gp, 0x20(sp) | *(var_20h) = gp;
0x004098d0 addiu a0, a0, 4 | a0 += 4;
0x004098d4 sw s7, 0x278(sp) | *(var_278h) = s7;
0x004098d8 sw s6, 0x274(sp) | *(var_274h) = s6;
0x004098dc sw s5, 0x270(sp) | *(var_270h) = s5;
0x004098e0 sw s4, 0x26c(sp) | *(var_26ch) = s4;
0x004098e4 sb zero, 0x228(sp) | *(var_228h) = 0;
0x004098e8 jalr t9 | t9 ();
0x004098ec lw gp, 0x20(sp) | gp = *(var_20h);
0x004098f0 lw a0, 0x2a0(s0) | a0 = *((s0 + 168));
0x004098f4 addiu s2, sp, 0x228 | s2 = sp + 0x228;
0x004098f8 lw t9, -0x7fb0(gp) | t9 = sym.get_ip_str;
0x004098fc addiu a0, a0, 4 | a0 += 4;
0x00409900 move a1, s2 | a1 = s2;
0x00409904 addiu a2, zero, 0x2e | a2 = 0x2e;
0x00409908 move s3, v0 | s3 = v0;
0x0040990c jalr t9 | t9 ();
0x00409910 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409914 lw v0, 0x2c0(s0) | v0 = *((s0 + 176));
0x00409918 lui a1, 0x41 | a1 = 0x410000;
0x0040991c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409920 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00409924 addiu a0, zero, 3 | a0 = 3;
0x00409928 move a2, s2 | a2 = s2;
| /* str.OT_server:__s__port:__d_not_response__close__socket__d__n */
0x0040992c addiu a1, a1, 0x6a24 | a1 += 0x6a24;
0x00409930 move a3, s3 | a3 = s3;
0x00409934 jalr t9 | t9 ();
0x00409938 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040993c move a0, zero | a0 = 0;
0x00409940 move v0, zero | v0 = 0;
0x00409944 move a2, s0 | a2 = s0;
| label_0:
0x00409948 lw v1, 0x194(s0) | v1 = *((s0 + 101));
| do {
0x0040994c slt a1, v0, v1 | a1 = (v0 < v1) ? 1 : 0;
0x00409950 sll a3, v0, 3 | a3 = v0 << 3;
| if (a1 == 0) {
0x00409954 beqz a1, 0x4099a8 | goto label_4;
| }
0x00409958 addu a1, a3, a2 | a1 = a3 + a2;
0x0040995c lw t0, 4(a1) | t0 = *((a1 + 1));
0x00409960 lw a1, 0x2c0(a2) | a1 = *((a2 + 176));
0x00409964 addiu v0, v0, 1 | v0++;
0x00409968 bnel t0, a1, 0x40994c |
| } while (t0 == a1);
0x0040996c subu v0, v1, v0 | __asm ("subu v0, v1, v0");
0x00409970 sll v0, v0, 3 | v0 <<= 3;
0x00409974 move a1, zero | a1 = 0;
| do {
0x00409978 addu a0, a1, a3 | a0 = a1 + a3;
0x0040997c addu a0, s0, a0 | a0 = s0 + a0;
0x00409980 lw t0, 0xc(a0) | t0 = *((a0 + 3));
0x00409984 addiu a1, a1, 8 | a1 += 8;
0x00409988 sw t0, 4(a0) | *((a0 + 1)) = t0;
0x0040998c lw t0, 0x10(a0) | t0 = *((a0 + 4));
0x00409990 sw t0, 8(a0) | *((a0 + 2)) = t0;
0x00409994 bne a1, v0, 0x409978 |
| } while (a1 != v0);
0x00409998 move v0, v1 | v0 = v1;
0x0040999c addiu a0, zero, 1 | a0 = 1;
0x004099a0 j 0x409948 | goto label_0;
0x004099a4 addiu v0, v0, 1 | v0++;
| label_4:
0x004099a8 addiu v1, v1, -1 | v1 += -1;
| if (a0 != 0) {
0x004099ac beqz a0, 0x4099b8 |
0x004099b0 j 0x4099d4 | goto label_5;
0x004099b4 sw v1, 0x194(a2) | *((a2 + 101)) = v1;
| }
0x004099b8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004099bc lui a1, 0x41 | a1 = 0x410000;
0x004099c0 lw a2, 0x2c0(a2) | a2 = *((a2 + 176));
0x004099c4 addiu a0, zero, 1 | a0 = 1;
| /* str.miio.cloud_sockfd___d__not_in_pollfds._n */
0x004099c8 addiu a1, a1, 0x6a60 | a1 += 0x6a60;
0x004099cc jalr t9 | t9 ();
0x004099d0 lw gp, 0x20(sp) | gp = *(var_20h);
| label_5:
0x004099d4 lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x004099d8 lw a0, 0x2c0(s0) | a0 = *((s0 + 176));
0x004099dc jalr t9 | t9 ();
0x004099e0 sw zero, 0x2c0(s0) | *((s0 + 176)) = 0;
0x004099e4 jal 0x404d18 | fcn_00404d18 ();
0x004099e8 lw v0, 0x2c4(s0) | v0 = *((s0 + 177));
0x004099ec addiu a1, zero, 0xa | a1 = 0xa;
0x004099f0 slti v1, v0, 0xb | v1 = (v0 < 0xb) ? 1 : 0;
| if (v1 != 0) {
0x004099f4 movz v0, a1, v1 | v0 = a1;
| }
0x004099f8 addiu v0, v0, 1 | v0++;
0x004099fc addiu a1, zero, 0x2710 | a1 = 0x2710;
0x00409a00 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409a04 mul a1, v0, a1 | __asm ("mul a1, v0, a1");
0x00409a08 addiu v1, zero, 9 | v1 = 9;
0x00409a0c lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00409a10 lw a0, 0x1f0(s0) | a0 = *((s0 + 124));
0x00409a14 sw v1, -0x6dd0(s1) | *((s1 - 7028)) = v1;
0x00409a18 move a2, zero | a2 = 0;
0x00409a1c jalr t9 | t9 ();
0x00409a20 lw s1, 0x3ac(s0) | s1 = *((s0 + 235));
0x00409a24 lw gp, 0x20(sp) | gp = *(var_20h);
| if (s1 == 0) {
0x00409a28 bnez s1, 0x409a5c |
0x00409a2c lw s0, 0x3b0(s0) | s0 = *((s0 + 236));
| label_1:
0x00409a30 lui s1, 0x41 | s1 = 0x410000;
| if (s0 == 0) {
0x00409a34 beqz s0, 0x409bcc | goto label_6;
| }
0x00409a38 lui s2, 0x41 | s2 = 0x410000;
0x00409a3c lui s3, 0x43 | s3 = 0x430000;
0x00409a40 lui s4, 0x41 | s4 = 0x410000;
| /* str.data_queue_noack:_id:_d__size:_d__retry:_d__ack_timeout:_llu_n */
0x00409a44 addiu s1, s1, 0x6ac8 | s1 += 0x6ac8;
| /* str._id_:_d__error_:_code_:_30011__message_:_OT_server_disconnected_ */
0x00409a48 addiu s2, s2, 0x6b08 | s2 += 0x6b08;
| /* obj.miio_callback_queue */
0x00409a4c addiu s3, s3, -0x6680 | s3 += -0x6680;
| /* str.callback_queue_issue___id:__d__ret:__d_n */
0x00409a50 addiu s4, s4, 0x5680 | s4 += 0x5680;
0x00409a54 j 0x409b00 | goto label_7;
0x00409a58 lui s7, 0x41 | s7 = 0x410000;
| }
0x00409a5c lui s2, 0x41 | s2 = "data_queue desc: id:%d, size:%d, retry:%d, ack_timeout:%llu\n";
| /* str.data_queue_desc:_id:_d__size:_d__retry:_d__ack_timeout:_llu_n */
0x00409a60 addiu s2, s2, 0x6a88 |
| do {
0x00409a64 lw v0, 0xc(s1) | v0 = *((s1 + 3));
0x00409a68 lw a2, (s1) | a2 = *(s1);
0x00409a6c lw a3, 8(s1) | a3 = *((s1 + 2));
0x00409a70 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00409a74 lw v0, 0x10(s1) | v0 = *((s1 + 4));
0x00409a78 lw v1, 0x14(s1) | v1 = *((s1 + 5));
0x00409a7c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409a80 sw v0, 0x18(sp) | *(var_18h) = v0;
0x00409a84 sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x00409a88 addiu a0, zero, 3 | a0 = 3;
0x00409a8c move a1, s2 | a1 = s2;
0x00409a90 jalr t9 | t9 ();
0x00409a94 lw s1, 0x18(s1) | s1 = *((s1 + 6));
0x00409a98 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409a9c bnez s1, 0x409a64 |
| } while (s1 != 0);
0x00409aa0 lw s1, 0x3ac(s0) | s1 = *((s0 + 235));
0x00409aa4 addiu s2, zero, -1 | s2 = -1;
| if (s1 == 0) {
| label_2:
0x00409aa8 beql s1, zero, 0x409a30 | goto label_1;
| }
0x00409aac lw s0, 0x3b0(s0) | s0 = *((s0 + 236));
0x00409ab0 lw v0, 0x18(s1) | v0 = *((s1 + 6));
0x00409ab4 sw v0, 0x3ac(s0) | *((s0 + 235)) = v0;
0x00409ab8 lw v0, 0xc(s1) | v0 = *((s1 + 3));
0x00409abc lw v0, 0x3b0(s0) | v0 = *((s0 + 236));
| if (v0 != s2) {
0x00409ac0 bnel v0, s2, 0x409ae8 |
0x00409ac4 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00409ac8 lw a0, 4(s1) | a0 = *((s1 + 1));
0x00409acc jalr t9 | t9 ();
0x00409ad0 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409ad4 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00409ad8 move a0, s1 | a0 = s1;
0x00409adc jalr t9 | t9 ();
0x00409ae0 j 0x409af0 | goto label_8;
0x00409ae4 lw gp, 0x20(sp) | gp = *(var_20h);
| }
0x00409ae8 sw v0, 0x18(s1) | *((s1 + 6)) = v0;
0x00409aec sw s1, 0x3b0(s0) | *((s0 + 236)) = s1;
| label_8:
0x00409af0 j 0x409aa8 | goto label_2;
0x00409af4 lw s1, 0x3ac(s0) | s1 = *((s0 + 235));
| do {
| label_3:
0x00409af8 move s0, s6 | s0 = s6;
| if (s6 == 0) {
0x00409afc beqz s6, 0x409bcc | goto label_6;
| }
| label_7:
0x00409b00 lw v0, 0xc(s0) | v0 = *((s0 + 3));
0x00409b04 lw a3, 8(s0) | a3 = *((s0 + 2));
0x00409b08 lw a2, (s0) | a2 = *(s0);
0x00409b0c lw s6, 0x18(s0) | s6 = *((s0 + 6));
0x00409b10 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00409b14 lw v1, 0x14(s0) | v1 = *((s0 + 5));
0x00409b18 lw v0, 0x10(s0) | v0 = *((s0 + 4));
0x00409b1c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409b20 sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x00409b24 sw v0, 0x18(sp) | *(var_18h) = v0;
0x00409b28 addiu a0, zero, 3 | a0 = 3;
0x00409b2c move a1, s1 | a1 = s1;
0x00409b30 jalr t9 | t9 ();
0x00409b34 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409b38 addiu s5, sp, 0x28 | s5 = sp + 0x28;
0x00409b3c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00409b40 move a0, s5 | a0 = s5;
0x00409b44 move a1, zero | a1 = 0;
0x00409b48 addiu a2, zero, 0x200 | a2 = 0x200;
0x00409b4c jalr t9 | t9 ();
0x00409b50 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409b54 lw a2, (s0) | a2 = *(s0);
0x00409b58 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x00409b5c move a0, s5 | a0 = s5;
0x00409b60 move a1, s2 | a1 = s2;
0x00409b64 jalr t9 | t9 ();
0x00409b68 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409b6c lw a1, (s0) | a1 = *(s0);
0x00409b70 lw t9, -0x7f9c(gp) | t9 = sym.callback_queue_issue;
0x00409b74 move a2, s5 | a2 = s5;
0x00409b78 move a0, s3 | a0 = s3;
0x00409b7c jalr t9 | t9 ();
0x00409b80 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409b84 lw a2, (s0) | a2 = *(s0);
0x00409b88 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409b8c move s5, v0 | s5 = v0;
0x00409b90 addiu a0, zero, 3 | a0 = 3;
0x00409b94 move a1, s4 | a1 = s4;
0x00409b98 move a3, v0 | a3 = v0;
0x00409b9c jalr t9 | t9 ();
0x00409ba0 lw gp, 0x20(sp) | gp = *(var_20h);
0x00409ba4 bgez s5, 0x409af8 |
| } while (s5 >= 0);
0x00409ba8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409bac lw a2, (s0) | a2 = *(s0);
0x00409bb0 addiu a0, zero, 1 | a0 = 1;
| /* str.callback_queue_issue___ret___0__discard_data_desc:__d_n */
0x00409bb4 addiu a1, s7, 0x6b50 | a1 = s7 + 0x6b50;
0x00409bb8 jalr t9 | t9 ();
0x00409bbc lw a0, (s0) | a0 = *(s0);
0x00409bc0 jal 0x4097d8 | sym_queue_ack ();
0x00409bc4 j 0x409af8 | goto label_3;
0x00409bc8 lw gp, 0x20(sp) | gp = *(var_20h);
| label_6:
0x00409bcc lw ra, 0x27c(sp) | ra = *(var_27ch);
0x00409bd0 lw s7, 0x278(sp) | s7 = *(var_278h);
0x00409bd4 lw s6, 0x274(sp) | s6 = *(var_274h);
0x00409bd8 lw s5, 0x270(sp) | s5 = *(var_270h);
0x00409bdc lw s4, 0x26c(sp) | s4 = *(var_26ch);
0x00409be0 lw s3, 0x268(sp) | s3 = *(var_268h);
0x00409be4 lw s2, 0x264(sp) | s2 = *(var_264h);
0x00409be8 lw s1, 0x260(sp) | s1 = *(var_260h);
0x00409bec lw s0, 0x25c(sp) | s0 = *(var_25ch);
0x00409bf0 addiu sp, sp, 0x280 |
0x00409bf4 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 @ 0x409bf8 */
| #include <stdint.h>
|
; (fcn) fcn.00409bf8 () | void fcn_00409bf8 () {
0x00409bf8 lui gp, 0x43 |
0x00409bfc addiu sp, sp, -0x8c0 |
0x00409c00 addiu gp, gp, 0x1620 | gp += 0x1620;
0x00409c04 addiu v1, sp, 0x420 | v1 = sp + 0x420;
0x00409c08 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00409c0c move a1, zero | a1 = 0;
0x00409c10 sw ra, 0x8bc(sp) | *(var_8bch) = ra;
0x00409c14 sw v1, 0x88c(sp) | *(var_88ch) = v1;
0x00409c18 sw s3, 0x8a4(sp) | *(var_8a4h) = s3;
0x00409c1c sw s0, 0x898(sp) | *(var_898h) = s0;
0x00409c20 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00409c24 move s0, a0 | s0 = a0;
0x00409c28 addiu a2, zero, 0x400 | a2 = 0x400;
0x00409c2c move a0, v1 | a0 = v1;
0x00409c30 sw fp, 0x8b8(sp) | *(var_8b8h) = fp;
0x00409c34 sw s7, 0x8b4(sp) | *(var_8b4h) = s7;
0x00409c38 sw s6, 0x8b0(sp) | *(var_8b0h) = s6;
0x00409c3c sw s5, 0x8ac(sp) | *(var_8ach) = s5;
0x00409c40 sw s4, 0x8a8(sp) | *(var_8a8h) = s4;
0x00409c44 sw s2, 0x8a0(sp) | *(var_8a0h) = s2;
0x00409c48 sw s1, 0x89c(sp) | *(var_89ch) = s1;
0x00409c4c jalr t9 | t9 ();
0x00409c50 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409c54 move a0, s0 | a0 = s0;
0x00409c58 lw t9, -0x7ce0(gp) | t9 = sym.imp.recv;
0x00409c5c addiu a1, sp, 0x420 | a1 = sp + 0x420;
0x00409c60 addiu a2, zero, 0x400 | a2 = 0x400;
0x00409c64 addiu a3, zero, 0x40 | a3 = 0x40;
0x00409c68 jalr t9 | t9 ();
0x00409c6c lw gp, 0x18(sp) | gp = *(var_18h);
0x00409c70 lui a1, 0x41 | a1 = 0x410000;
0x00409c74 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409c78 move s3, v0 | s3 = v0;
0x00409c7c move a2, v0 | a2 = v0;
0x00409c80 addiu a0, zero, 4 | a0 = 4;
| /* str.OT_cloud_data_come:__d_bytes_n */
0x00409c84 addiu a1, a1, 0x6b88 | a1 += 0x6b88;
0x00409c88 jalr t9 | t9 ();
0x00409c8c sltiu v0, s3, 0x20 | v0 = (s3 < 0x20) ? 1 : 0;
0x00409c90 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00409c94 bnez v0, 0x409cb0 |
0x00409c98 lui v0, 0x43 | v0 = 0x430000;
| /* obj.miio */
0x00409c9c addiu s2, v0, -0x6dd0 | s2 = v0 + -0x6dd0;
0x00409ca0 sw zero, 0x888(sp) | *(var_888h) = 0;
0x00409ca4 move s7, s2 | s7 = s2;
0x00409ca8 j 0x409e18 | goto label_4;
0x00409cac addiu fp, s2, 0x330 | fp = s2 + 0x330;
| }
0x00409cb0 lui a1, 0x41 | a1 = 0x410000;
0x00409cb4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409cb8 addiu a0, zero, 1 | a0 = 1;
| /* str.OT_received___d___less_than_size_of_OT_header__32_.__m_n */
0x00409cbc addiu a1, a1, 0x6ba8 | a1 += 0x6ba8;
0x00409cc0 move a2, s3 | a2 = s3;
0x00409cc4 jalr t9 | t9 ();
0x00409cc8 j 0x409e70 | goto label_5;
0x00409ccc nop |
| do {
0x00409cd0 lui a3, 0xff | a3 = 0xff0000;
0x00409cd4 lwr v0, 0xc(s6) | __asm ("lwr v0, 0xc(s6)");
0x00409cd8 srl s5, v0, 0x18 | s5 = v0 >> 0x18;
0x00409cdc sll v1, v0, 0x18 | v1 = v0 << 0x18;
0x00409ce0 or v1, v1, s5 | v1 |= s5;
0x00409ce4 and s5, v0, a3 | s5 = v0 & a3;
0x00409ce8 srl s5, s5, 8 | s5 >>= 8;
0x00409cec andi v0, v0, 0xff00 | v0 &= 0xff00;
0x00409cf0 sll v0, v0, 8 | v0 <<= 8;
0x00409cf4 or s5, v1, s5 | s5 = v1 | s5;
0x00409cf8 or s5, s5, v0 | s5 |= v0;
0x00409cfc addiu v0, zero, 0x20 | v0 = 0x20;
0x00409d00 lwl v1, 0xb(s6) | __asm ("lwl v1, 0xb(s6)");
| if (s1 != v0) {
0x00409d04 bne s1, v0, 0x409f30 | goto label_6;
| }
0x00409d08 lwl v0, 7(s6) | __asm ("lwl v0, 7(s6)");
0x00409d0c lwr v0, 4(s6) | __asm ("lwr v0, 4(s6)");
0x00409d10 addiu a0, zero, -1 | a0 = -1;
0x00409d14 lwr v1, 8(s6) | __asm ("lwr v1, 8(s6)");
0x00409d18 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 != a0) {
0x00409d1c bne v0, a0, 0x409f0c | goto label_7;
| }
0x00409d20 lui a1, 0x41 | a1 = 0x410000;
| if (v1 == v0) {
0x00409d24 bnel v1, v0, 0x409f10 | goto label_8;
| }
0x00409d28 lui a1, 0x41 | a1 = 0x410000;
0x00409d2c addiu a0, zero, 3 | a0 = 3;
| /* str.Time_sync_msg_from_server_n */
0x00409d30 addiu a1, a1, 0x6c3c | a1 += 0x6c3c;
0x00409d34 jalr t9 | t9 ();
0x00409d38 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409d3c lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
0x00409d40 jalr t9 | t9 ();
0x00409d44 nop |
0x00409d48 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409d4c subu v1, s5, v0 | __asm ("subu v1, s5, v0");
0x00409d50 lui a1, 0x41 | a1 = 0x410000;
0x00409d54 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409d58 sw v1, 0x214(s2) | *((s2 + 133)) = v1;
0x00409d5c sw v0, 0x210(s2) | *((s2 + 132)) = v0;
0x00409d60 sw v1, 0x10(sp) | *(var_10h) = v1;
0x00409d64 move a3, v0 | a3 = v0;
0x00409d68 addiu a0, zero, 2 | a0 = 2;
| /* str.sync_time_with_server__server:__d__local_mono_:__u__diff:__d_n */
0x00409d6c addiu a1, a1, 0x6c58 | a1 += 0x6c58;
0x00409d70 move a2, s5 | a2 = s5;
0x00409d74 jalr t9 | t9 ();
0x00409d78 lw v1, 0x2e0(s2) | v1 = *((s2 + 184));
0x00409d7c addiu v0, zero, 1 | v0 = 1;
0x00409d80 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v1 != v0) {
0x00409d84 bne v1, v0, 0x409ef8 | goto label_9;
| }
0x00409d88 lw v0, 0x2e4(s7) | v0 = *((s7 + 185));
0x00409d8c lw t9, -0x7f40(gp) | t9 = sym.cmd_internal_get_info;
| if (v0 != 0) {
0x00409d90 bnez v0, 0x409efc | goto label_10;
| }
0x00409d94 lw v0, 0x200(s2) | v0 = *((s2 + 128));
0x00409d98 lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
| if (v0 != 0) {
0x00409d9c bnez v0, 0x409ed0 | goto label_11;
| }
| label_0:
0x00409da0 jal 0x40494c | fcn_0040494c ();
0x00409da4 nop |
0x00409da8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409dac lui a1, 0x41 | a1 = 0x410000;
0x00409db0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409db4 addiu a0, zero, 2 | a0 = 2;
| /* str.no_did__key__mac_2__request_from_server_and_ret:__d._n */
0x00409db8 addiu a1, a1, 0x6228 | a1 += 0x6228;
0x00409dbc move a2, v0 | a2 = v0;
0x00409dc0 jalr t9 | t9 ();
0x00409dc4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409dc8 lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
0x00409dcc jalr t9 | t9 ();
0x00409dd0 nop |
0x00409dd4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409dd8 sw v0, 0x200(s2) | *((s2 + 128)) = v0;
0x00409ddc lui v0, 0x43 | v0 = 0x430000;
| label_1:
0x00409de0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409de4 lw a2, -0x6dd0(v0) | a2 = *((v0 - 7028));
0x00409de8 lui a1, 0x41 | a1 = 0x410000;
0x00409dec addiu a0, zero, 2 | a0 = 2;
| /* str.STATE:___d_____STATE_DIDKEY_REQ2_n */
0x00409df0 addiu a1, a1, 0x6c98 | a1 += 0x6c98;
0x00409df4 jalr t9 | t9 ();
0x00409df8 addiu v0, zero, 2 | v0 = 2;
0x00409dfc lui v1, 0x43 | v1 = 0x430000;
0x00409e00 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409e04 sw v0, -0x6dd0(v1) | *((v1 - 7028)) = v0;
| label_2:
0x00409e08 lw v1, 0x888(sp) | v1 = *(var_888h);
| label_3:
0x00409e0c subu s3, s3, s1 | __asm ("subu s3, s3, s1");
0x00409e10 addu v1, v1, s1 | v1 += s1;
0x00409e14 sw v1, 0x888(sp) | *(var_888h) = v1;
| label_4:
0x00409e18 lw v0, 0x888(sp) | v0 = *(var_888h);
| if (s3 <= 0) {
0x00409e1c blez s3, 0x40a55c | goto label_12;
| }
0x00409e20 addiu v1, sp, 0x420 | v1 = sp + 0x420;
0x00409e24 addu s6, v1, v0 | s6 = v1 + v0;
0x00409e28 lbu v0, 3(s6) | v0 = *((s6 + 3));
0x00409e2c lbu s1, 2(s6) | s1 = *((s6 + 2));
0x00409e30 sll v0, v0, 8 | v0 <<= 8;
0x00409e34 or v0, v0, s1 | v0 |= s1;
0x00409e38 sll s1, v0, 8 | s1 = v0 << 8;
0x00409e3c srl v0, v0, 8 | v0 >>= 8;
0x00409e40 or v0, s1, v0 | v0 = s1 | v0;
0x00409e44 andi s1, v0, 0xffff | s1 = v0 & 0xffff;
0x00409e48 slt v0, s3, s1 | v0 = (s3 < s1) ? 1 : 0;
| if (v0 != 0) {
0x00409e4c beql v0, zero, 0x409e80 |
0x00409e50 lbu v1, (s6) | v1 = *(s6);
0x00409e54 lui a1, 0x41 | a1 = 0x410000;
0x00409e58 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409e5c addiu a0, zero, 1 | a0 = 1;
| /* str.OT_received___d___less_than_size_of_OT_packet___d_._n */
0x00409e60 addiu a1, a1, 0x6be0 | a1 += 0x6be0;
0x00409e64 move a2, s3 | a2 = s3;
0x00409e68 move a3, s1 | a3 = s1;
0x00409e6c jalr t9 | t9 ();
| label_5:
0x00409e70 jal 0x40989c | fcn_0040989c ();
0x00409e74 nop |
0x00409e78 j 0x40a560 | goto label_13;
0x00409e7c addiu v0, zero, -1 | v0 = -1;
| }
0x00409e80 addiu v0, zero, 0x21 | v0 = 0x21;
0x00409e84 addiu v0, zero, 0x31 | v0 = 0x31;
| if (v1 == v0) {
0x00409e88 bne v1, v0, 0x409e98 |
0x00409e8c lbu v1, 1(s6) | v1 = *((s6 + 1));
0x00409e90 sltiu v0, s1, 0x20 | v0 = (s1 < 0x20) ? 1 : 0;
| if (v1 == v0) {
0x00409e94 beq v1, v0, 0x409ea8 | goto label_14;
| }
| }
0x00409e98 lui v1, 0x41 | v1 = 0x410000;
0x00409e9c addiu a0, zero, 1 | a0 = 1;
0x00409ea0 j 0x40a024 | goto label_15;
| /* str.OT_protocol_version_not_match._n */
0x00409ea4 addiu a1, v1, 0x5998 | a1 = v1 + 0x5998;
| label_14:
0x00409ea8 beql v0, zero, 0x409cd0 |
| } while (v0 == 0);
0x00409eac lwl v0, 0xf(s6) | __asm ("lwl v0, 0xf(s6)");
0x00409eb0 lui a1, 0x41 | a1 = 0x410000;
0x00409eb4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409eb8 addiu a0, zero, 1 | a0 = 1;
| /* str.OT_packet_length_not_correct:__d._n */
0x00409ebc addiu a1, a1, 0x6c18 | a1 += 0x6c18;
0x00409ec0 move a2, s1 | a2 = s1;
0x00409ec4 jalr t9 | t9 ();
0x00409ec8 j 0x40a030 | goto label_16;
0x00409ecc nop |
| label_11:
0x00409ed0 jalr t9 | t9 ();
0x00409ed4 nop |
0x00409ed8 lw v1, 0x200(s7) | v1 = *((s7 + 128));
0x00409edc subu v0, v0, v1 | __asm ("subu v0, v0, v1");
0x00409ee0 lw v1, 0x204(s7) | v1 = *((s7 + 129));
0x00409ee4 sltu v0, v1, v0 | v0 = (v1 < v0) ? 1 : 0;
0x00409ee8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00409eec bnez v0, 0x409da0 | goto label_0;
| }
0x00409ef0 j 0x409de0 | goto label_1;
0x00409ef4 lui v0, 0x43 | v0 = 0x430000;
| label_9:
0x00409ef8 lw t9, -0x7f40(gp) | t9 = sym.cmd_internal_get_info;
| label_10:
0x00409efc jalr t9 | t9 ();
0x00409f00 nop |
0x00409f04 j 0x40a554 | goto label_17;
0x00409f08 lw gp, 0x18(sp) | gp = *(var_18h);
| label_7:
0x00409f0c lui a1, 0x41 | a1 = 0x410000;
| label_8:
0x00409f10 addiu a0, zero, 4 | a0 = 4;
| /* str.Ping___Pong_msg_from_server_n */
0x00409f14 addiu a1, a1, 0x6cbc | a1 += 0x6cbc;
0x00409f18 jalr t9 | t9 ();
0x00409f1c addiu v0, zero, 1 | v0 = 1;
0x00409f20 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409f24 sb v0, 0x20c(s2) | *((s2 + 524)) = v0;
0x00409f28 j 0x409e08 | goto label_2;
0x00409f2c sw zero, 0x218(s2) | *((s2 + 134)) = 0;
| label_6:
0x00409f30 lwl v0, 7(s6) | __asm ("lwl v0, 7(s6)");
0x00409f34 lwr v1, 8(s6) | __asm ("lwr v1, 8(s6)");
0x00409f38 lwr v0, 4(s6) | __asm ("lwr v0, 4(s6)");
0x00409f3c sll a1, v1, 0x18 | a1 = v1 << 0x18;
0x00409f40 srl a2, v1, 0x18 | a2 = v1 >> 0x18;
0x00409f44 or a2, a1, a2 | a2 = a1 | a2;
0x00409f48 and a1, v1, a3 | a1 = v1 & a3;
0x00409f4c srl a1, a1, 8 | a1 >>= 8;
0x00409f50 andi v1, v1, 0xff00 | v1 &= 0xff00;
0x00409f54 or a1, a2, a1 | a1 = a2 | a1;
0x00409f58 sll v1, v1, 8 | v1 <<= 8;
0x00409f5c srl a0, v0, 0x18 | a0 = v0 >> 0x18;
0x00409f60 or v1, a1, v1 | v1 = a1 | v1;
0x00409f64 sll a1, v0, 0x18 | a1 = v0 << 0x18;
0x00409f68 or a1, a1, a0 | a1 |= a0;
0x00409f6c and a0, v0, a3 | a0 = v0 & a3;
0x00409f70 srl a0, a0, 8 | a0 >>= 8;
0x00409f74 andi v0, v0, 0xff00 | v0 &= 0xff00;
0x00409f78 or a0, a1, a0 | a0 = a1 | a0;
0x00409f7c sll v0, v0, 8 | v0 <<= 8;
0x00409f80 or v0, a0, v0 | v0 = a0 | v0;
0x00409f84 lw a0, 0x2e0(s7) | a0 = *((s7 + 184));
0x00409f88 lui a1, 0x41 | a1 = 0x410000;
| if (a0 != v1) {
0x00409f8c bnel a0, v1, 0x409fa0 |
0x00409f90 lw v1, 0x2e4(s7) | v1 = *((s7 + 185));
0x00409f94 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| if (v1 == v0) {
0x00409f98 beq v1, v0, 0x409fac | goto label_18;
| }
0x00409f9c lui a1, 0x41 | a1 = 0x410000;
| }
0x00409fa0 addiu a0, zero, 1 | a0 = 1;
0x00409fa4 j 0x40a024 | goto label_15;
| /* str.OT_device_id_not_match._n */
0x00409fa8 addiu a1, a1, 0x59b8 | a1 += 0x59b8;
| label_18:
0x00409fac addiu s0, s6, 0x10 | s0 = s6 + 0x10;
0x00409fb0 addiu s4, sp, 0x870 | s4 = sp + 0x870;
0x00409fb4 move a1, s0 | a1 = s0;
0x00409fb8 move a0, s4 | a0 = s4;
0x00409fbc addiu a2, zero, 0x10 | a2 = 0x10;
0x00409fc0 jalr t9 | t9 ();
0x00409fc4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409fc8 move a0, s0 | a0 = s0;
0x00409fcc lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00409fd0 move a1, fp | a1 = fp;
0x00409fd4 addiu a2, zero, 0x10 | a2 = 0x10;
0x00409fd8 jalr t9 | t9 ();
0x00409fdc lw gp, 0x18(sp) | gp = *(var_18h);
0x00409fe0 addiu s0, sp, 0x860 | s0 = sp + 0x860;
0x00409fe4 lw t9, -0x7fd4(gp) | t9 = sym.myMD5;
0x00409fe8 move a0, s6 | a0 = s6;
0x00409fec move a1, s1 | a1 = s1;
0x00409ff0 move a2, s0 | a2 = s0;
0x00409ff4 jalr t9 | t9 ();
0x00409ff8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00409ffc move a0, s4 | a0 = s4;
0x0040a000 lw t9, -0x7dbc(gp) | t9 = sym.imp.memcmp;
0x0040a004 move a1, s0 | a1 = s0;
0x0040a008 addiu a2, zero, 0x10 | a2 = 0x10;
0x0040a00c jalr t9 | t9 ();
0x0040a010 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040a014 beqz v0, 0x40a040 |
0x0040a018 lui a1, 0x41 | a1 = 0x410000;
0x0040a01c addiu a0, zero, 1 | a0 = 1;
| /* str.OT_MD5_not_match._n */
0x0040a020 addiu a1, a1, 0x59d4 | a1 += 0x59d4;
| label_15:
0x0040a024 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a028 jalr t9 | t9 ();
0x0040a02c nop |
| label_16:
0x0040a030 move a0, s6 | a0 = s6;
0x0040a034 jal 0x406148 | fcn_00406148 ();
0x0040a038 j 0x40a554 | goto label_17;
0x0040a03c lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040a040 addiu a3, sp, 0x850 | a3 = sp + 0x850;
0x0040a044 lw t9, -0x7fd4(gp) | t9 = sym.myMD5;
0x0040a048 move a2, a3 | a2 = a3;
0x0040a04c move a0, fp | a0 = fp;
0x0040a050 addiu a1, zero, 0x10 | a1 = 0x10;
0x0040a054 sw a3, 0x894(sp) | *(var_894h) = a3;
0x0040a058 jalr t9 | t9 ();
0x0040a05c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a060 lw a3, 0x894(sp) | a3 = *(var_894h);
0x0040a064 addiu s0, sp, 0x820 | s0 = sp + 0x820;
0x0040a068 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040a06c move a1, a3 | a1 = a3;
0x0040a070 move a0, s0 | a0 = s0;
0x0040a074 addiu a2, zero, 0x10 | a2 = 0x10;
0x0040a078 jalr t9 | t9 ();
0x0040a07c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a080 addiu a0, sp, 0x830 | a0 = sp + 0x830;
0x0040a084 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040a088 move a1, fp | a1 = fp;
0x0040a08c addiu a2, zero, 0x10 | a2 = 0x10;
0x0040a090 jalr t9 | t9 ();
0x0040a094 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a098 addiu t0, sp, 0x840 | t0 = sp + 0x840;
0x0040a09c lw t9, -0x7fd4(gp) | t9 = sym.myMD5;
0x0040a0a0 move a2, t0 | a2 = t0;
0x0040a0a4 sw t0, 0x890(sp) | *(var_890h) = t0;
0x0040a0a8 move a0, s0 | a0 = s0;
0x0040a0ac addiu a1, zero, 0x20 | a1 = 0x20;
0x0040a0b0 jalr t9 | t9 ();
0x0040a0b4 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a0b8 addiu s4, s1, -0x20 | s4 = s1 + -0x20;
0x0040a0bc lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040a0c0 move a0, s4 | a0 = s4;
0x0040a0c4 jalr t9 | t9 ();
0x0040a0c8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a0cc lw a3, 0x894(sp) | a3 = *(var_894h);
0x0040a0d0 lw t0, 0x890(sp) | t0 = *(var_890h);
| if (v0 == 0) {
0x0040a0d4 bnez v0, 0x40a0fc |
0x0040a0d8 lui a0, 0x41 | a0 = 0x410000;
0x0040a0dc lui a1, 0x41 | a1 = 0x410000;
0x0040a0e0 lui a3, 0x41 | a3 = 0x410000;
0x0040a0e4 lw t9, -0x7e4c(gp) | t9 = sym.imp.__assert;
| /* str.decbuf_____void__0_ */
0x0040a0e8 addiu a0, a0, 0x59e8 | a0 += 0x59e8;
| /* str.miio_client.c */
0x0040a0ec addiu a1, a1, 0x5028 | a1 += 0x5028;
0x0040a0f0 addiu a2, zero, 0x856 | a2 = 0x856;
| /* str.cloud_recv_one */
0x0040a0f4 addiu a3, a3, 0x7c68 | a3 += 0x7c68;
0x0040a0f8 jalr t9 | t9 ();
| }
0x0040a0fc lw t9, -0x7f94(gp) | t9 = sym.AES128_CBC_decrypt_buffer;
0x0040a100 addiu s0, s6, 0x20 | s0 = s6 + 0x20;
0x0040a104 sw t0, 0x10(sp) | *(var_10h) = t0;
0x0040a108 move a0, v0 | a0 = v0;
0x0040a10c move a1, s0 | a1 = s0;
0x0040a110 move a2, s4 | a2 = s4;
0x0040a114 sw v0, 0x890(sp) | *(var_890h) = v0;
0x0040a118 jalr t9 | t9 ();
0x0040a11c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a120 lw v1, 0x890(sp) | v1 = *(var_890h);
0x0040a124 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040a128 move a1, v1 | a1 = v1;
0x0040a12c move a0, s0 | a0 = s0;
0x0040a130 move a2, s4 | a2 = s4;
0x0040a134 jalr t9 | t9 ();
0x0040a138 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a13c lw v1, 0x890(sp) | v1 = *(var_890h);
0x0040a140 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x0040a144 move a0, v1 | a0 = v1;
0x0040a148 jalr t9 | t9 ();
0x0040a14c addiu v0, s1, -1 | v0 = s1 + -1;
0x0040a150 addu s6, s6, v0 | s6 += v0;
0x0040a154 lbu v1, (s6) | v1 = *(s6);
0x0040a158 sltiu v0, v1, 0x11 | v0 = (v1 < 0x11) ? 1 : 0;
0x0040a15c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040a160 beqz v0, 0x40a16c |
0x0040a164 j 0x40a18c | goto label_19;
0x0040a168 move v0, v1 | v0 = v1;
| }
0x0040a16c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a170 lui a1, 0x41 | a1 = 0x410000;
0x0040a174 addiu a0, zero, 1 | a0 = 1;
| /* str.OT_padding_panic__pad_len:__d_n */
0x0040a178 addiu a1, a1, 0x5a00 | a1 += 0x5a00;
0x0040a17c move a2, v1 | a2 = v1;
0x0040a180 jalr t9 | t9 ();
0x0040a184 j 0x40a554 | goto label_17;
0x0040a188 lw gp, 0x18(sp) | gp = *(var_18h);
| do {
| label_19:
0x0040a18c addiu v0, v0, -1 | v0 += -1;
| if (v0 == 0) {
0x0040a190 beqz v0, 0x40a1a4 | goto label_20;
| }
0x0040a194 sb zero, (s6) | *(s6) = 0;
0x0040a198 andi v0, v0, 0xff | v0 &= 0xff;
0x0040a19c j 0x40a18c |
| } while (1);
0x0040a1a0 addiu s6, s6, -1 | s6 += -1;
| label_20:
0x0040a1a4 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040a1a8 lui a1, 0x41 | a1 = 0x410000;
0x0040a1ac sw v1, 0x890(sp) | *(var_890h) = v1;
0x0040a1b0 move a0, s0 | a0 = s0;
| /* esilref: 'id' */
0x0040a1b4 addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040a1b8 addiu a2, sp, 0x880 | a2 = sp + 0x880;
0x0040a1bc jalr t9 | t9 ();
0x0040a1c0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a1c4 lw v1, 0x890(sp) | v1 = *(var_890h);
| if (v0 < 0) {
0x0040a1c8 bgez v0, 0x40a1e8 |
0x0040a1cc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a1d0 lui a1, 0x41 | a1 = 0x410000;
0x0040a1d4 move a0, zero | a0 = 0;
| /* str.id:json_verify_get_int_fail_n */
0x0040a1d8 addiu a1, a1, 0x5a20 | a1 += 0x5a20;
0x0040a1dc jalr t9 | t9 ();
0x0040a1e0 j 0x40a554 | goto label_17;
0x0040a1e4 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040a1e8 lw t9, -0x7f3c(gp) | t9 = sym.is_cloud_msg_valid;
0x0040a1ec lw a0, 0x880(sp) | a0 = *(var_880h);
0x0040a1f0 sw v1, 0x890(sp) | *(var_890h) = v1;
0x0040a1f4 move a1, s5 | a1 = s5;
0x0040a1f8 jalr t9 | t9 ();
0x0040a1fc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a200 lw v1, 0x890(sp) | v1 = *(var_890h);
0x0040a204 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 < 0) {
0x0040a208 bgez v0, 0x40a22c |
0x0040a20c lui a1, 0x41 | a1 = 0x410000;
0x0040a210 lw a3, 0x880(sp) | a3 = *(var_880h);
0x0040a214 addiu a0, zero, 3 | a0 = 3;
| /* str.look_like_a_repeated_msg:_d___d_n */
0x0040a218 addiu a1, a1, 0x6cdc | a1 += 0x6cdc;
0x0040a21c move a2, v0 | a2 = v0;
0x0040a220 jalr t9 | t9 ();
0x0040a224 j 0x40a554 | goto label_17;
0x0040a228 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040a22c lui a1, 0x41 | a1 = 0x410000;
0x0040a230 lui a2, 0x41 | a2 = 0x410000;
| /* esilref: '&s
' */
0x0040a234 addiu a1, a1, 0x6510 | a1 += 0x6510;
| /* str.cloud_handle_msg */
0x0040a238 addiu a2, a2, 0x7c54 | a2 += 0x7c54;
0x0040a23c addiu a0, zero, 2 | a0 = 2;
0x0040a240 subu s4, s4, v1 | __asm ("subu s4, s4, v1");
0x0040a244 jalr t9 | t9 ();
0x0040a248 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a24c lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040a250 move a0, s0 | a0 = s0;
0x0040a254 jalr t9 | t9 ();
0x0040a258 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a25c lui a1, 0x41 | a1 = 0x410000;
0x0040a260 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a264 addiu a0, zero, 3 | a0 = 3;
| /* str.msg:__s__strlen:__d__len:__d_n */
0x0040a268 addiu a1, a1, 0x6d00 | a1 += 0x6d00;
0x0040a26c move a2, s0 | a2 = s0;
0x0040a270 move a3, v0 | a3 = v0;
0x0040a274 sw s4, 0x10(sp) | *(var_10h) = s4;
0x0040a278 jalr t9 | t9 ();
0x0040a27c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a280 lw t9, -0x7f8c(gp) | t9 = sym.json_verify;
0x0040a284 move a0, s0 | a0 = s0;
0x0040a288 jalr t9 | t9 ();
0x0040a28c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x0040a290 bltz v0, 0x409e08 | goto label_2;
| }
0x0040a294 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040a298 addiu s5, sp, 0x20 | s5 = sp + 0x20;
0x0040a29c move a0, s5 | a0 = s5;
0x0040a2a0 move a1, zero | a1 = 0;
0x0040a2a4 addiu a2, zero, 0x400 | a2 = 0x400;
0x0040a2a8 jalr t9 | t9 ();
0x0040a2ac lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a2b0 lui s6, 0x41 | s6 = 0x410000;
0x0040a2b4 lw t9, -0x7fa4(gp) | t9 = *((gp - 8169));
0x0040a2b8 move a0, s0 | a0 = s0;
| /* str.method */
0x0040a2bc addiu a1, s6, 0x55d4 | a1 = s6 + 0x55d4;
0x0040a2c0 jalr t9 | t9 ();
0x0040a2c4 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a2c8 move a0, s0 | a0 = s0;
| if (v0 != 0) {
0x0040a2cc bnez v0, 0x40a548 | goto label_21;
| }
0x0040a2d0 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x0040a2d4 lui a2, 0x41 | a2 = 0x410000;
| /* str.method */
0x0040a2d8 addiu a1, s6, 0x55d4 | a1 = s6 + 0x55d4;
| /* str.miIO.wifi_assoc_state */
0x0040a2dc addiu a2, a2, 0x5b0c | a2 += 0x5b0c;
0x0040a2e0 addiu a3, zero, 6 | a3 = 6;
0x0040a2e4 jalr t9 | t9 ();
0x0040a2e8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040a2ec bnez v0, 0x40a334 |
0x0040a2f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a2f4 lui a1, 0x41 | a1 = 0x410000;
0x0040a2f8 addiu a0, zero, 2 | a0 = 2;
| /* str.Got_miIO.wifi_assoc_state._n */
0x0040a2fc addiu a1, a1, 0x5b24 | a1 += 0x5b24;
0x0040a300 jalr t9 | t9 ();
0x0040a304 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a308 move a0, s0 | a0 = s0;
0x0040a30c lw t9, -0x7f84(gp) | t9 = sym.method_miio_wifi_assoc_state;
0x0040a310 move a1, s5 | a1 = s5;
0x0040a314 addiu a2, zero, 0x400 | a2 = 0x400;
0x0040a318 jalr t9 | t9 ();
0x0040a31c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x0040a320 bgez v0, 0x40a530 | goto label_22;
| }
0x0040a324 lui a1, 0x41 | a1 = 0x410000;
0x0040a328 addiu a0, zero, 1 | a0 = 1;
0x0040a32c j 0x40a4a8 | goto label_23;
| /* str.miIO.wifi_assoc_state_fail_n */
0x0040a330 addiu a1, a1, 0x5b40 | a1 += 0x5b40;
| }
0x0040a334 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x0040a338 lui a2, 0x41 | a2 = 0x410000;
0x0040a33c move a0, s0 | a0 = s0;
| /* str.method */
0x0040a340 addiu a1, s6, 0x55d4 | a1 = s6 + 0x55d4;
| /* str.miIO.stop_diag_mode */
0x0040a344 addiu a2, a2, 0x5b5c | a2 += 0x5b5c;
0x0040a348 addiu a3, zero, 6 | a3 = 6;
0x0040a34c jalr t9 | t9 ();
0x0040a350 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040a354 bnez v0, 0x40a368 |
0x0040a358 lui a1, 0x41 | a1 = 0x410000;
0x0040a35c addiu a0, zero, 2 | a0 = 2;
0x0040a360 j 0x40a4a8 | goto label_23;
| /* str.Got_miIO.stop_diag_mode._n */
0x0040a364 addiu a1, a1, 0x5b70 | a1 += 0x5b70;
| }
0x0040a368 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x0040a36c lui a2, 0x41 | a2 = 0x410000;
0x0040a370 move a0, s0 | a0 = s0;
| /* str.method */
0x0040a374 addiu a1, s6, 0x55d4 | a1 = s6 + 0x55d4;
| /* str.miIO.config */
0x0040a378 addiu a2, a2, 0x5b8c | a2 += 0x5b8c;
0x0040a37c addiu a3, zero, 6 | a3 = 6;
0x0040a380 jalr t9 | t9 ();
0x0040a384 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040a388 bnez v0, 0x40a3d0 |
0x0040a38c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a390 lui a1, 0x41 | a1 = 0x410000;
0x0040a394 addiu a0, zero, 2 | a0 = 2;
| /* str.Got_miIO.config._n */
0x0040a398 addiu a1, a1, 0x5b98 | a1 += 0x5b98;
0x0040a39c jalr t9 | t9 ();
0x0040a3a0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a3a4 move a0, s0 | a0 = s0;
0x0040a3a8 lw t9, -0x7f80(gp) | t9 = sym.method_miio_config;
0x0040a3ac move a1, s5 | a1 = s5;
0x0040a3b0 addiu a2, zero, 0x400 | a2 = 0x400;
0x0040a3b4 jalr t9 | t9 ();
0x0040a3b8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x0040a3bc bgez v0, 0x40a530 | goto label_22;
| }
0x0040a3c0 lui a1, 0x41 | a1 = 0x410000;
0x0040a3c4 addiu a0, zero, 1 | a0 = 1;
0x0040a3c8 j 0x40a4a8 | goto label_23;
| /* str.miIO.config_fail_n */
0x0040a3cc addiu a1, a1, 0x5bac | a1 += 0x5bac;
| }
0x0040a3d0 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x0040a3d4 lui a2, 0x41 | a2 = 0x410000;
0x0040a3d8 move a0, s0 | a0 = s0;
| /* str.method */
0x0040a3dc addiu a1, s6, 0x55d4 | a1 = s6 + 0x55d4;
| /* str.miIO.info */
0x0040a3e0 addiu a2, a2, 0x5bc0 | a2 += 0x5bc0;
0x0040a3e4 addiu a3, zero, 6 | a3 = 6;
0x0040a3e8 jalr t9 | t9 ();
0x0040a3ec lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040a3f0 bnez v0, 0x40a440 |
0x0040a3f4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a3f8 lui a1, 0x41 | a1 = 0x410000;
0x0040a3fc addiu a0, zero, 2 | a0 = 2;
| /* str.Got_miIO.info._n */
0x0040a400 addiu a1, a1, 0x5bcc | a1 += 0x5bcc;
0x0040a404 jalr t9 | t9 ();
0x0040a408 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a40c lui a1, 0x43 | a1 = 0x430000;
0x0040a410 lw t9, -0x7f7c(gp) | t9 = sym.method_miio_info;
0x0040a414 move a0, s0 | a0 = s0;
0x0040a418 addiu a1, a1, -0x6af0 | a1 += -0x6af0;
0x0040a41c move a2, s5 | a2 = s5;
0x0040a420 addiu a3, zero, 0x400 | a3 = 0x400;
0x0040a424 jalr t9 | t9 ();
0x0040a428 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x0040a42c bgez v0, 0x40a530 | goto label_22;
| }
0x0040a430 lui a1, 0x41 | a1 = 0x410000;
0x0040a434 addiu a0, zero, 1 | a0 = 1;
0x0040a438 j 0x40a4a8 | goto label_23;
| /* str.miIO.info_fail_n */
0x0040a43c addiu a1, a1, 0x5bdc | a1 += 0x5bdc;
| }
0x0040a440 lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x0040a444 lui v0, 0x41 | v0 = 0x410000;
0x0040a448 lui a2, 0x41 | a2 = 0x410000;
0x0040a44c move a0, s0 | a0 = s0;
| /* str.method */
0x0040a450 addiu a1, v0, 0x55d4 | a1 = v0 + 0x55d4;
| /* str.miIO.config_tz */
0x0040a454 addiu a2, a2, 0x5bec | a2 += 0x5bec;
0x0040a458 addiu a3, zero, 6 | a3 = 6;
0x0040a45c jalr t9 | t9 ();
0x0040a460 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040a464 bnez v0, 0x40a4bc | goto label_24;
| }
0x0040a468 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a46c lui a1, 0x41 | a1 = 0x410000;
0x0040a470 addiu a0, zero, 2 | a0 = 2;
| /* str.set_miIO.config_tz._n */
0x0040a474 addiu a1, a1, 0x5bfc | a1 += 0x5bfc;
0x0040a478 jalr t9 | t9 ();
0x0040a47c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a480 move a0, s0 | a0 = s0;
0x0040a484 lw t9, -0x7f78(gp) | t9 = sym.method_miio_config_tz;
0x0040a488 move a1, s5 | a1 = s5;
0x0040a48c addiu a2, zero, 0x400 | a2 = 0x400;
0x0040a490 jalr t9 | t9 ();
0x0040a494 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x0040a498 bgez v0, 0x40a530 | goto label_22;
| }
0x0040a49c lui a1, 0x41 | a1 = 0x410000;
0x0040a4a0 addiu a0, zero, 1 | a0 = 1;
| /* str.miIO.config_tz_fail_n */
0x0040a4a4 addiu a1, a1, 0x5c14 | a1 += 0x5c14;
| do {
| label_23:
0x0040a4a8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a4ac jalr t9 | t9 ();
0x0040a4b0 nop |
0x0040a4b4 j 0x40a534 | goto label_25;
0x0040a4b8 move a0, s5 | a0 = s5;
| label_24:
0x0040a4bc lw t9, -0x7f88(gp) | t9 = sym.json_verify_method_value;
0x0040a4c0 lui v1, 0x41 | v1 = 0x410000;
0x0040a4c4 lui a2, 0x41 | a2 = 0x410000;
0x0040a4c8 move a0, s0 | a0 = s0;
| /* str.method */
0x0040a4cc addiu a1, v1, 0x55d4 | a1 = v1 + 0x55d4;
| /* str.miIO.config_loglevel */
0x0040a4d0 addiu a2, a2, 0x6d20 | a2 += 0x6d20;
0x0040a4d4 addiu a3, zero, 6 | a3 = 6;
0x0040a4d8 jalr t9 | t9 ();
0x0040a4dc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040a4e0 bnez v0, 0x40a528 | goto label_26;
| }
0x0040a4e4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a4e8 lui a1, 0x41 | a1 = 0x410000;
0x0040a4ec addiu a0, zero, 2 | a0 = 2;
| /* str.set_miIO.config_loglevel._n */
0x0040a4f0 addiu a1, a1, 0x6d38 | a1 += 0x6d38;
0x0040a4f4 jalr t9 | t9 ();
0x0040a4f8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040a4fc move a0, s0 | a0 = s0;
0x0040a500 lw t9, -0x7f38(gp) | t9 = sym.method_miio_config_loglevel;
0x0040a504 move a1, s5 | a1 = s5;
0x0040a508 addiu a2, zero, 0x400 | a2 = 0x400;
0x0040a50c jalr t9 | t9 ();
0x0040a510 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x0040a514 bgez v0, 0x40a530 | goto label_22;
| }
0x0040a518 lui a1, 0x41 | a1 = 0x410000;
0x0040a51c addiu a0, zero, 1 | a0 = 1;
0x0040a520 j 0x40a4a8 |
| } while (1);
| /* str.miIO.config_loglevel_fail_n */
0x0040a524 addiu a1, a1, 0x6d54 | a1 += 0x6d54;
| label_26:
0x0040a528 j 0x40a548 | goto label_21;
0x0040a52c move a0, s0 | a0 = s0;
| label_22:
0x0040a530 move a0, s5 | a0 = s5;
| label_25:
0x0040a534 move a1, zero | a1 = 0;
0x0040a538 move a2, zero | a2 = 0;
0x0040a53c jal 0x408b5c | sym_report_to_cloud ();
0x0040a540 j 0x40a554 | goto label_17;
0x0040a544 lw gp, 0x18(sp) | gp = *(var_18h);
| label_21:
0x0040a548 move a1, s4 | a1 = s4;
0x0040a54c jal 0x4059f8 | fcn_004059f8 ();
0x0040a550 lw gp, 0x18(sp) | gp = *(var_18h);
| label_17:
0x0040a554 j 0x409e0c | goto label_3;
0x0040a558 lw v1, 0x888(sp) | v1 = *(var_888h);
| label_12:
0x0040a55c move v0, zero | v0 = 0;
| label_13:
0x0040a560 lw ra, 0x8bc(sp) | ra = *(var_8bch);
0x0040a564 lw fp, 0x8b8(sp) | fp = *(var_8b8h);
0x0040a568 lw s7, 0x8b4(sp) | s7 = *(var_8b4h);
0x0040a56c lw s6, 0x8b0(sp) | s6 = *(var_8b0h);
0x0040a570 lw s5, 0x8ac(sp) | s5 = *(var_8ach);
0x0040a574 lw s4, 0x8a8(sp) | s4 = *(var_8a8h);
0x0040a578 lw s3, 0x8a4(sp) | s3 = *(var_8a4h);
0x0040a57c lw s2, 0x8a0(sp) | s2 = *(var_8a0h);
0x0040a580 lw s1, 0x89c(sp) | s1 = *(var_89ch);
0x0040a584 lw s0, 0x898(sp) | s0 = *(var_898h);
0x0040a588 addiu sp, sp, 0x8c0 |
0x0040a58c 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 @ 0x40a590 */
| #include <stdint.h>
|
; (fcn) fcn.0040a590 () | void fcn_0040a590 () {
0x0040a590 lui gp, 0x43 |
0x0040a594 addiu gp, gp, 0x1620 |
0x0040a598 addiu sp, sp, -0x470 |
0x0040a59c lw t9, -0x7f6c(gp) | t9 = sym.get_micro_second;
0x0040a5a0 move v0, zero | v0 = 0;
0x0040a5a4 move v1, zero | v1 = 0;
0x0040a5a8 sw ra, 0x46c(sp) | *(var_46ch) = ra;
0x0040a5ac sw s5, 0x45c(sp) | *(var_45ch) = s5;
0x0040a5b0 sw s4, 0x458(sp) | *(var_458h) = s4;
0x0040a5b4 sw s3, 0x454(sp) | *(var_454h) = s3;
0x0040a5b8 sw s2, 0x450(sp) | *(var_450h) = s2;
0x0040a5bc sw s1, 0x44c(sp) | *(var_44ch) = s1;
0x0040a5c0 sw s0, 0x448(sp) | *(var_448h) = s0;
0x0040a5c4 sw gp, 0x30(sp) | *(var_30h) = gp;
0x0040a5c8 sw fp, 0x468(sp) | *(var_468h) = fp;
0x0040a5cc sw s7, 0x464(sp) | *(var_464h) = s7;
0x0040a5d0 sw s6, 0x460(sp) | *(var_460h) = s6;
0x0040a5d4 sw v0, 0x438(sp) | *(var_438h) = v0;
0x0040a5d8 sw v1, 0x43c(sp) | *(var_43ch) = v1;
0x0040a5dc move s5, a0 | s5 = a0;
0x0040a5e0 jalr t9 | t9 ();
0x0040a5e4 lw gp, 0x30(sp) | gp = *(var_30h);
0x0040a5e8 move a0, v0 | a0 = v0;
0x0040a5ec lw t9, -0x7f68(gp) | t9 = sym.__udivdi3;
0x0040a5f0 move a1, v1 | a1 = v1;
0x0040a5f4 addiu a2, zero, 0x3e8 | a2 = 0x3e8;
0x0040a5f8 move a3, zero | a3 = 0;
0x0040a5fc lui s3, 0x43 | s3 = 0x430000;
0x0040a600 jalr t9 | t9 ();
| /* obj.miio */
0x0040a604 addiu s2, s3, -0x6dd0 | s2 = s3 + -0x6dd0;
0x0040a608 move s1, v0 | s1 = v0;
0x0040a60c lw v0, 0x2a0(s2) | v0 = *((s2 + 168));
0x0040a610 lw gp, 0x30(sp) | gp = *(var_30h);
0x0040a614 lw v0, (v0) | v0 = *(v0);
0x0040a618 move s0, v1 | s0 = v1;
0x0040a61c xori v0, v0, 1 | v0 ^= 1;
0x0040a620 addiu v1, zero, 3 | v1 = 3;
| if (v0 != 0) {
0x0040a624 movz v1, zero, v0 | v1 = 0;
| }
0x0040a628 lw t9, -0x7d98(gp) | t9 = sym.imp.read;
0x0040a62c sw v1, 0x440(sp) | *(var_440h) = v1;
0x0040a630 move a0, s5 | a0 = s5;
0x0040a634 addiu a1, sp, 0x438 | a1 = sp + 0x438;
0x0040a638 addiu a2, zero, 8 | a2 = 8;
0x0040a63c lw s4, 0x3b0(s2) | s4 = *((s2 + 236));
0x0040a640 jalr t9 | t9 ();
0x0040a644 lw v1, -0x6dd0(s3) | v1 = *((s3 - 7028));
0x0040a648 lw gp, 0x30(sp) | gp = *(var_30h);
0x0040a64c addiu v1, v1, -7 | v1 += -7;
0x0040a650 sltiu v1, v1, 2 | v1 = (v1 < 2) ? 1 : 0;
0x0040a654 addiu v0, zero, -1 | v0 = -1;
| if (v1 == 0) {
0x0040a658 beqz v1, 0x40a868 | goto label_2;
| }
0x0040a65c move v0, zero | v0 = 0;
| if (s4 == 0) {
0x0040a660 beqz s4, 0x40a868 | goto label_2;
| }
0x0040a664 lui s5, 0x41 | s5 = 0x410000;
0x0040a668 lui s6, 0x41 | s6 = 0x410000;
0x0040a66c addiu s3, zero, 0xbb8 | s3 = 0xbb8;
| /* str.ack_timer_handler */
0x0040a670 addiu s5, s5, 0x7d14 | s5 += 0x7d14;
| /* str._id_:_d__error_:_code_:_30011__message_:_OT_server_noack_ */
0x0040a674 addiu s6, s6, 0x6dc8 | s6 += 0x6dc8;
0x0040a678 lui fp, 0x43 | fp = 0x430000;
0x0040a67c lw v1, 0x18(s4) | v1 = *((s4 + 6));
| label_1:
0x0040a680 sw s4, 0x10(sp) | *(var_10h) = s4;
0x0040a684 lw v0, (s4) | v0 = *(s4);
0x0040a688 sw s1, 0x18(sp) | *(var_18h) = s1;
0x0040a68c sw v0, 0x14(sp) | *(var_14h) = v0;
0x0040a690 sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x0040a694 lw v0, 0x10(s4) | v0 = *((s4 + 4));
0x0040a698 sw v1, 0x444(sp) | *(var_444h) = v1;
0x0040a69c lw v1, 0x14(s4) | v1 = *((s4 + 5));
0x0040a6a0 sw v0, 0x20(sp) | *(var_20h) = v0;
0x0040a6a4 sw v1, 0x24(sp) | *(var_24h) = v1;
0x0040a6a8 lw v0, 8(s4) | v0 = *((s4 + 2));
0x0040a6ac lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a6b0 sw v0, 0x28(sp) | *(var_28h) = v0;
0x0040a6b4 lw v0, 0xc(s4) | v0 = *((s4 + 3));
0x0040a6b8 lui a1, 0x41 | a1 = 0x410000;
0x0040a6bc sw v0, 0x2c(sp) | *(var_2ch) = v0;
0x0040a6c0 addiu a0, zero, 3 | a0 = 3;
| /* str._s__d:_tmpd:_p__id:__d__curr_time:__llu__ack_timeout:__llu__size:__d__tmpd__retry:__d_n */
0x0040a6c4 addiu a1, a1, 0x6d70 | a1 += 0x6d70;
0x0040a6c8 move a2, s5 | a2 = s5;
0x0040a6cc addiu a3, zero, 0xe33 | a3 = 0xe33;
0x0040a6d0 jalr t9 | t9 ();
0x0040a6d4 lw v1, 0x14(s4) | v1 = *((s4 + 5));
0x0040a6d8 lw gp, 0x30(sp) | gp = *(var_30h);
0x0040a6dc sltu a0, s0, v1 | a0 = (s0 < v1) ? 1 : 0;
0x0040a6e0 lw v0, 0x10(s4) | v0 = *((s4 + 4));
| if (a0 != 0) {
0x0040a6e4 bnez a0, 0x40a748 | goto label_3;
| }
0x0040a6e8 lw a0, 0xc(s4) | a0 = *((s4 + 3));
| if (v1 != s0) {
0x0040a6ec bnel v1, s0, 0x40a700 |
0x0040a6f0 sltu v1, s1, v0 | v1 = (s1 < v0) ? 1 : 0;
0x0040a6f4 subu s3, v0, s1 | __asm ("subu s3, v0, s1");
| if (v1 == 0) {
0x0040a6f8 bnel v1, zero, 0x40a834 | goto label_4;
| }
0x0040a6fc lw a0, 0xc(s4) | a0 = *((s4 + 3));
| }
0x0040a700 addiu a0, a0, 1 | a0++;
0x0040a704 sw a0, 0xc(s4) | *((s4 + 3)) = a0;
| do {
0x0040a708 lw v1, 0x14(s4) | v1 = *((s4 + 5));
0x0040a70c sltu a1, s0, v1 | a1 = (s0 < v1) ? 1 : 0;
0x0040a710 lw v0, 0x10(s4) | v0 = *((s4 + 4));
| if (a1 != 0) {
0x0040a714 bnez a1, 0x40a750 | goto label_5;
| }
0x0040a718 sltu a1, s1, v0 | a1 = (s1 < v0) ? 1 : 0;
| if (v1 == s0) {
0x0040a71c beq v1, s0, 0x40a738 | goto label_6;
| }
0x0040a720 addiu a1, v0, 0xbb8 | a1 = v0 + 0xbb8;
| label_0:
0x0040a724 sltu v0, a1, v0 | v0 = (a1 < v0) ? 1 : 0;
0x0040a728 addu v0, v0, v1 | v0 += v1;
0x0040a72c sw a1, 0x10(s4) | *((s4 + 4)) = a1;
0x0040a730 j 0x40a708 |
| } while (1);
0x0040a734 sw v0, 0x14(s4) | *((s4 + 5)) = v0;
| if (a1 == 0) {
| label_6:
0x0040a738 beql a1, zero, 0x40a724 | goto label_0;
| }
0x0040a73c addiu a1, v0, 0xbb8 | a1 = v0 + 0xbb8;
0x0040a740 j 0x40a754 | goto label_7;
0x0040a744 subu a1, v0, s1 | __asm ("subu a1, v0, s1");
| label_3:
0x0040a748 j 0x40a834 | goto label_4;
0x0040a74c subu s3, v0, s1 | __asm ("subu s3, v0, s1");
| label_5:
0x0040a750 subu a1, v0, s1 | __asm ("subu a1, v0, s1");
| label_7:
0x0040a754 subu v1, v1, s0 | __asm ("subu v1, v1, s0");
0x0040a758 sltu v0, v0, a1 | v0 = (v0 < a1) ? 1 : 0;
0x0040a75c sra a2, s3, 0x1f | a2 = s3 >> 0x1f;
0x0040a760 subu v0, v1, v0 | __asm ("subu v0, v1, v0");
0x0040a764 sltu v1, v0, a2 | v1 = (v0 < a2) ? 1 : 0;
0x0040a768 move s3, a1 | s3 = a1;
| if (v1 != 0) {
0x0040a76c bnel v1, zero, 0x40a788 |
0x0040a770 lw v1, 0x440(sp) | v1 = *(var_440h);
| if (a2 != v0) {
0x0040a774 bne a2, v0, 0x40a78c | goto label_8;
| }
0x0040a778 sltu v0, a1, s3 | v0 = (a1 < s3) ? 1 : 0;
| if (v0 == 0) {
0x0040a77c beql v0, zero, 0x40a790 | goto label_9;
| }
0x0040a780 slt a0, a0, v1 | a0 = (a0 < v1) ? 1 : 0;
0x0040a784 move s3, a1 | s3 = a1;
| }
0x0040a788 lw v1, 0x440(sp) | v1 = *(var_440h);
| label_8:
0x0040a78c slt a0, a0, v1 | a0 = (a0 < v1) ? 1 : 0;
| label_9:
0x0040a790 lw s4, 0x444(sp) | s4 = *(var_444h);
| if (a0 != 0) {
0x0040a794 bnel a0, zero, 0x40a838 |
0x0040a798 addiu s7, sp, 0x38 | s7 = sp + 0x38;
0x0040a79c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040a7a0 move a0, s7 | a0 = s7;
0x0040a7a4 move a1, zero | a1 = 0;
0x0040a7a8 addiu a2, zero, 0x400 | a2 = 0x400;
0x0040a7ac lw s4, (s4) | s4 = *(s4);
0x0040a7b0 jalr t9 | t9 ();
0x0040a7b4 lw gp, 0x30(sp) | gp = *(var_30h);
0x0040a7b8 move a0, s7 | a0 = s7;
0x0040a7bc lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040a7c0 move a1, s6 | a1 = s6;
0x0040a7c4 move a2, s4 | a2 = s4;
0x0040a7c8 jalr t9 | t9 ();
0x0040a7cc lw gp, 0x30(sp) | gp = *(var_30h);
0x0040a7d0 move a2, s7 | a2 = s7;
0x0040a7d4 lw t9, -0x7f9c(gp) | t9 = sym.callback_queue_issue;
| /* obj.miio_callback_queue */
0x0040a7d8 addiu a0, fp, -0x6680 | a0 = fp + -0x6680;
0x0040a7dc move a1, s4 | a1 = s4;
0x0040a7e0 jalr t9 | t9 ();
0x0040a7e4 lw gp, 0x30(sp) | gp = *(var_30h);
0x0040a7e8 lui a1, 0x41 | a1 = 0x410000;
0x0040a7ec lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a7f0 move s7, v0 | s7 = v0;
0x0040a7f4 addiu a0, zero, 3 | a0 = 3;
| /* str.callback_queue_issue___id:__d__ret:__d_n */
0x0040a7f8 addiu a1, a1, 0x5680 | a1 += 0x5680;
0x0040a7fc move a2, s4 | a2 = s4;
0x0040a800 move a3, v0 | a3 = v0;
0x0040a804 jalr t9 | t9 ();
0x0040a808 lw gp, 0x30(sp) | gp = *(var_30h);
| if (s7 < 0) {
0x0040a80c bgez s7, 0x40a834 |
0x0040a810 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040a814 lui a1, 0x41 | a1 = 0x410000;
0x0040a818 addiu a0, zero, 1 | a0 = 1;
| /* str.callback_queue_issue___ret___0__discard_data_desc:__d_n */
0x0040a81c addiu a1, a1, 0x6b50 | a1 += 0x6b50;
0x0040a820 move a2, s4 | a2 = s4;
0x0040a824 jalr t9 | t9 ();
0x0040a828 move a0, s4 | a0 = s4;
0x0040a82c jal 0x4097d8 | sym_queue_ack ();
0x0040a830 lw gp, 0x30(sp) | gp = *(var_30h);
| }
| label_4:
0x0040a834 lw s4, 0x444(sp) | s4 = *(var_444h);
| }
0x0040a838 lw v1, 0x18(s4) | v1 = *((s4 + 6));
| if (s4 == 0) {
0x0040a83c bnel s4, zero, 0x40a680 | goto label_1;
| }
0x0040a840 lw a0, 0x2c0(s2) | a0 = *((s2 + 176));
0x0040a844 addiu a1, zero, 4 | a1 = 4;
0x0040a848 jal 0x406dec | fcn_00406dec ();
0x0040a84c lw gp, 0x30(sp) | gp = *(var_30h);
0x0040a850 lw a0, 0x1fc(s2) | a0 = *((s2 + 127));
0x0040a854 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x0040a858 move a1, s3 | a1 = s3;
0x0040a85c move a2, zero | a2 = 0;
0x0040a860 jalr t9 | t9 ();
0x0040a864 move v0, zero | v0 = 0;
| label_2:
0x0040a868 lw ra, 0x46c(sp) | ra = *(var_46ch);
0x0040a86c lw fp, 0x468(sp) | fp = *(var_468h);
0x0040a870 lw s7, 0x464(sp) | s7 = *(var_464h);
0x0040a874 lw s6, 0x460(sp) | s6 = *(var_460h);
0x0040a878 lw s5, 0x45c(sp) | s5 = *(var_45ch);
0x0040a87c lw s4, 0x458(sp) | s4 = *(var_458h);
0x0040a880 lw s3, 0x454(sp) | s3 = *(var_454h);
0x0040a884 lw s2, 0x450(sp) | s2 = *(var_450h);
0x0040a888 lw s1, 0x44c(sp) | s1 = *(var_44ch);
0x0040a88c lw s0, 0x448(sp) | s0 = *(var_448h);
0x0040a890 addiu sp, sp, 0x470 |
0x0040a894 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 @ 0x40abb0 */
| #include <stdint.h>
|
; (fcn) fcn.0040abb0 () | void fcn_0040abb0 () {
0x0040abb0 lui gp, 0x43 |
0x0040abb4 addiu gp, gp, 0x1620 |
0x0040abb8 addiu sp, sp, -0x90 |
0x0040abbc lw t9, -0x7f74(gp) | t9 = sym.generate_random_id;
0x0040abc0 sw ra, 0x8c(sp) | *(var_8ch) = ra;
0x0040abc4 sw s5, 0x84(sp) | *(var_84h) = s5;
0x0040abc8 sw s3, 0x7c(sp) | *(var_7ch) = s3;
0x0040abcc sw s2, 0x78(sp) | *(var_78h) = s2;
0x0040abd0 sw s0, 0x70(sp) | *(var_70h) = s0;
0x0040abd4 sw gp, 0x20(sp) | *(var_20h) = gp;
0x0040abd8 sw s6, 0x88(sp) | *(var_88h) = s6;
0x0040abdc sw s4, 0x80(sp) | *(var_80h) = s4;
0x0040abe0 sw s1, 0x74(sp) | *(var_74h) = s1;
0x0040abe4 move s5, a0 | s5 = a0;
0x0040abe8 jalr t9 | t9 ();
0x0040abec lw gp, 0x20(sp) | gp = *(var_20h);
0x0040abf0 lui a1, 0x41 | a1 = 0x410000;
0x0040abf4 lw s0, -0x7f28(gp) | s0 = *(gp);
0x0040abf8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040abfc lw a2, 0x1ec(s0) | a2 = *((s0 + 123));
0x0040ac00 addiu a0, zero, 2 | a0 = 2;
| /* str.report_otcinfo_flag:__u_n */
0x0040ac04 addiu a1, a1, 0x7e90 | a1 += 0x7e90;
0x0040ac08 move s3, v0 | s3 = v0;
0x0040ac0c jalr t9 | t9 ();
0x0040ac10 lw v0, 0x1ec(s0) | v0 = *((s0 + 123));
0x0040ac14 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ac18 move s2, s0 | s2 = s0;
| if (v0 == 0) {
0x0040ac1c beqz v0, 0x40acd0 | goto label_1;
| }
0x0040ac20 lw s0, 0x3ac(s0) | s0 = *((s0 + 235));
0x0040ac24 lui s1, 0x41 | s1 = 0x410000;
| if (s0 == 0) {
0x0040ac28 bnez s0, 0x40ac40 |
0x0040ac2c lw s0, 0x3b0(s2) | s0 = *((s2 + 236));
| label_0:
0x0040ac30 lui s1, 0x41 | s1 = 0x410000;
| if (s0 != 0) {
0x0040ac34 bnez s0, 0x40ac88 | goto label_2;
| }
0x0040ac38 j 0x40b018 | goto label_3;
0x0040ac3c move v0, zero | v0 = 0;
| }
| /* str.data_queue_desc:_id:_d__size:_d__retry:_d__ack_timeout:_llu_n */
0x0040ac40 addiu s1, s1, 0x6a88 | s1 += 0x6a88;
| do {
0x0040ac44 lw v0, 0xc(s0) | v0 = *((s0 + 3));
0x0040ac48 lw a2, (s0) | a2 = *(s0);
0x0040ac4c lw a3, 8(s0) | a3 = *((s0 + 2));
0x0040ac50 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040ac54 lw v0, 0x10(s0) | v0 = *((s0 + 4));
0x0040ac58 lw v1, 0x14(s0) | v1 = *((s0 + 5));
0x0040ac5c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040ac60 sw v0, 0x18(sp) | *(var_18h) = v0;
0x0040ac64 sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x0040ac68 addiu a0, zero, 3 | a0 = 3;
0x0040ac6c move a1, s1 | a1 = s1;
0x0040ac70 jalr t9 | t9 ();
0x0040ac74 lw s0, 0x18(s0) | s0 = *((s0 + 6));
0x0040ac78 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ac7c bnez s0, 0x40ac44 |
| } while (s0 != 0);
0x0040ac80 j 0x40ac30 | goto label_0;
0x0040ac84 lw s0, 0x3b0(s2) | s0 = *((s2 + 236));
| /* str.data_queue_noack:_id:_d__size:_d__retry:_d__ack_timeout:_llu_n */
| label_2:
0x0040ac88 addiu s1, s1, 0x6ac8 | s1 += 0x6ac8;
| do {
0x0040ac8c lw v0, 0xc(s0) | v0 = *((s0 + 3));
0x0040ac90 lw a2, (s0) | a2 = *(s0);
0x0040ac94 lw a3, 8(s0) | a3 = *((s0 + 2));
0x0040ac98 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040ac9c lw v0, 0x10(s0) | v0 = *((s0 + 4));
0x0040aca0 lw v1, 0x14(s0) | v1 = *((s0 + 5));
0x0040aca4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040aca8 sw v0, 0x18(sp) | *(var_18h) = v0;
0x0040acac sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x0040acb0 addiu a0, zero, 3 | a0 = 3;
0x0040acb4 move a1, s1 | a1 = s1;
0x0040acb8 jalr t9 | t9 ();
0x0040acbc lw s0, 0x18(s0) | s0 = *((s0 + 6));
0x0040acc0 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040acc4 bnez s0, 0x40ac8c |
| } while (s0 != 0);
0x0040acc8 j 0x40b018 | goto label_3;
0x0040accc move v0, zero | v0 = 0;
| label_1:
0x0040acd0 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040acd4 addiu s4, sp, 0x28 | s4 = sp + 0x28;
0x0040acd8 move a0, s4 | a0 = s4;
0x0040acdc move a1, zero | a1 = 0;
0x0040ace0 addiu a2, zero, 0x21 | a2 = 0x21;
0x0040ace4 jalr t9 | t9 ();
0x0040ace8 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040acec addiu a1, s5, 0x60 | a1 = s5 + 0x60;
0x0040acf0 lw t9, -0x7f24(gp) | t9 = sym.str2hex;
0x0040acf4 addiu a2, zero, 0x10 | a2 = 0x10;
0x0040acf8 move a0, s4 | a0 = s4;
0x0040acfc jalr t9 | t9 ();
0x0040ad00 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ad04 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040ad08 lw a0, 0x3a8(s0) | a0 = *((s0 + 234));
0x0040ad0c jalr t9 | t9 ();
0x0040ad10 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ad14 move a0, s3 | a0 = s3;
0x0040ad18 lw t9, -0x7d88(gp) | t9 = sym.imp.json_object_new_int;
0x0040ad1c move s1, v0 | s1 = v0;
0x0040ad20 jalr t9 | t9 ();
0x0040ad24 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ad28 lui a1, 0x41 | a1 = 0x410000;
0x0040ad2c lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
| /* esilref: 'id' */
0x0040ad30 addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040ad34 move a2, v0 | a2 = v0;
0x0040ad38 move a0, s1 | a0 = s1;
0x0040ad3c jalr t9 | t9 ();
0x0040ad40 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ad44 lui a0, 0x41 | a0 = 0x410000;
0x0040ad48 lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
| /* str._otc.info */
0x0040ad4c addiu a0, a0, 0x7eac | a0 += 0x7eac;
0x0040ad50 jalr t9 | t9 ();
0x0040ad54 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ad58 lui a1, 0x41 | a1 = 0x410000;
0x0040ad5c lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040ad60 move a2, v0 | a2 = v0;
0x0040ad64 move a0, s1 | a0 = s1;
| /* str.method */
0x0040ad68 addiu a1, a1, 0x55d4 | a1 += 0x55d4;
0x0040ad6c jalr t9 | t9 ();
0x0040ad70 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ad74 lui a1, 0x41 | a1 = 0x410000;
0x0040ad78 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040ad7c move a0, s1 | a0 = s1;
| /* str.params */
0x0040ad80 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040ad84 addiu a2, sp, 0x6c | a2 = sp + 0x6c;
0x0040ad88 jalr t9 | t9 ();
0x0040ad8c lw s6, 0x6c(sp) | s6 = *(var_6ch);
0x0040ad90 lw gp, 0x20(sp) | gp = *(var_20h);
| if (s6 == 0) {
0x0040ad94 bnez s6, 0x40add0 |
0x0040ad98 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040ad9c move a0, s1 | a0 = s1;
0x0040ada0 jalr t9 | t9 ();
0x0040ada4 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ada8 lui a1, 0x41 | a1 = 0x410000;
0x0040adac lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040adb0 lw a2, 0x3a8(s0) | a2 = *((s0 + 234));
0x0040adb4 move a0, zero | a0 = 0;
| /* str.into_str_does_not_have__params_:__s_n */
0x0040adb8 addiu a1, a1, 0x7eb8 | a1 += 0x7eb8;
0x0040adbc jalr t9 | t9 ();
0x0040adc0 addiu v0, zero, 1 | v0 = 1;
0x0040adc4 sb v0, 0x20a(s0) | *((s0 + 522)) = v0;
0x0040adc8 j 0x40b018 | goto label_3;
0x0040adcc addiu v0, zero, -1 | v0 = -1;
| }
0x0040add0 lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
0x0040add4 addiu a0, s5, 0x80 | a0 = s5 + 0x80;
0x0040add8 jalr t9 | t9 ();
0x0040addc lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ade0 lui a1, 0x41 | a1 = 0x410000;
0x0040ade4 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
| /* str.model */
0x0040ade8 addiu a1, a1, 0x65c8 | a1 += 0x65c8;
0x0040adec move a2, v0 | a2 = v0;
0x0040adf0 move a0, s6 | a0 = s6;
0x0040adf4 jalr t9 | t9 ();
0x0040adf8 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040adfc addiu a0, s5, 0x98 | a0 = s5 + 0x98;
0x0040ae00 lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
0x0040ae04 lw s0, 0x6c(sp) | s0 = *(var_6ch);
0x0040ae08 jalr t9 | t9 ();
0x0040ae0c lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ae10 lui a1, 0x41 | a1 = 0x410000;
0x0040ae14 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040ae18 move a0, s0 | a0 = s0;
| /* esilref: 'mac' */
0x0040ae1c addiu a1, a1, 0x62f4 | a1 += 0x62f4;
0x0040ae20 move a2, v0 | a2 = v0;
0x0040ae24 jalr t9 | t9 ();
0x0040ae28 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ae2c move a0, s4 | a0 = s4;
0x0040ae30 lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
0x0040ae34 lw s0, 0x6c(sp) | s0 = *(var_6ch);
0x0040ae38 jalr t9 | t9 ();
0x0040ae3c lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ae40 lui a1, 0x41 | a1 = 0x410000;
0x0040ae44 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040ae48 move a0, s0 | a0 = s0;
| /* esilref: 'token' */
0x0040ae4c addiu a1, a1, 0x6668 | a1 += 0x6668;
0x0040ae50 move a2, v0 | a2 = v0;
0x0040ae54 jalr t9 | t9 ();
0x0040ae58 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ae5c lw t9, -0x7f20(gp) | t9 = sym.get_uptime;
0x0040ae60 lw s0, 0x6c(sp) | s0 = *(var_6ch);
0x0040ae64 jalr t9 | t9 ();
0x0040ae68 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ae6c lw t9, -0x7d88(gp) | t9 = sym.imp.json_object_new_int;
0x0040ae70 move a0, v0 | a0 = v0;
0x0040ae74 jalr t9 | t9 ();
0x0040ae78 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040ae7c lui a1, 0x41 | a1 = 0x410000;
0x0040ae80 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040ae84 move a2, v0 | a2 = v0;
0x0040ae88 move a0, s0 | a0 = s0;
| /* str.life */
0x0040ae8c addiu a1, a1, 0x7ee0 | a1 += 0x7ee0;
0x0040ae90 jalr t9 | t9 ();
0x0040ae94 lw s5, 0x2e8(s2) | s5 = *((s2 + 186));
0x0040ae98 lw s4, 0x2ec(s2) | s4 = *((s2 + 187));
0x0040ae9c or v0, s5, s4 | v0 = s5 | s4;
0x0040aea0 lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 != 0) {
0x0040aea4 beqz v0, 0x40af14 |
0x0040aea8 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040aeac addiu s0, sp, 0x4c | s0 = sp + 0x4c;
0x0040aeb0 move a0, s0 | a0 = s0;
0x0040aeb4 move a1, zero | a1 = 0;
0x0040aeb8 addiu a2, zero, 0x20 | a2 = 0x20;
0x0040aebc jalr t9 | t9 ();
0x0040aec0 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040aec4 lui a1, 0x42 | a1 = 0x420000;
0x0040aec8 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040aecc move a3, s4 | a3 = s4;
| /* esilref: '&llu' */
0x0040aed0 addiu a1, a1, -0x7f94 | a1 += -0x7f94;
0x0040aed4 move a2, s5 | a2 = s5;
0x0040aed8 move a0, s0 | a0 = s0;
0x0040aedc jalr t9 | t9 ();
0x0040aee0 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040aee4 move a0, s0 | a0 = s0;
0x0040aee8 lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
0x0040aeec lw s4, 0x6c(sp) | s4 = *(var_6ch);
0x0040aef0 jalr t9 | t9 ();
0x0040aef4 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040aef8 lui a1, 0x41 | a1 = 0x410000;
0x0040aefc lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040af00 move a0, s4 | a0 = s4;
| /* esilref: 'uid' */
0x0040af04 addiu a1, a1, 0x7ee8 | a1 += 0x7ee8;
0x0040af08 move a2, v0 | a2 = v0;
0x0040af0c jalr t9 | t9 ();
0x0040af10 lw gp, 0x20(sp) | gp = *(var_20h);
| }
0x0040af14 lw t9, -0x7d08(gp) | t9 = sym.imp.json_object_to_json_string_ext;
0x0040af18 move a0, s1 | a0 = s1;
0x0040af1c move a1, zero | a1 = 0;
0x0040af20 jalr t9 | t9 ();
0x0040af24 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040af28 move a0, v0 | a0 = v0;
0x0040af2c lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040af30 move s0, v0 | s0 = v0;
0x0040af34 jalr t9 | t9 ();
0x0040af38 sltiu v0, v0, 0x400 | v0 = (v0 < 0x400) ? 1 : 0;
0x0040af3c lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 == 0) {
0x0040af40 bnez v0, 0x40af6c |
0x0040af44 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040af48 lui a1, 0x41 | a1 = 0x410000;
0x0040af4c lui a2, 0x41 | a2 = 0x410000;
0x0040af50 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040af54 addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040af58 addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040af5c addiu a3, zero, 0x3e7 | a3 = 0x3e7;
0x0040af60 jalr t9 | t9 ();
0x0040af64 j 0x40af9c | goto label_4;
0x0040af68 lw gp, 0x20(sp) | gp = *(var_20h);
| }
0x0040af6c lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040af70 addiu a0, zero, 0x10 | a0 = 0x10;
0x0040af74 jalr t9 | t9 ();
0x0040af78 move a1, v0 | a1 = v0;
0x0040af7c lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 == 0) {
0x0040af80 bnez v0, 0x40afa4 |
0x0040af84 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040af88 lui a1, 0x41 | a1 = 0x410000;
0x0040af8c move a0, zero | a0 = 0;
| /* esilref: 'malloc fail
' */
0x0040af90 addiu a1, a1, 0x544c | a1 += 0x544c;
0x0040af94 jalr t9 | t9 ();
0x0040af98 lw gp, 0x20(sp) | gp = *(var_20h);
| label_4:
0x0040af9c j 0x40b008 | goto label_5;
0x0040afa0 addiu s0, zero, -1 | s0 = -1;
| }
0x0040afa4 sw s3, (v0) | *(v0) = s3;
0x0040afa8 lui v0, 0x41 | v0 = 0x40b628;
0x0040afac addiu v0, v0, -0x49d8 |
0x0040afb0 lw t9, -0x7f70(gp) | t9 = sym.callback_queue_add;
0x0040afb4 lw a0, -0x7f1c(gp) | a0 = *(gp);
0x0040afb8 sw v0, 4(a1) | *((a1 + 1)) = v0;
0x0040afbc sw zero, 8(a1) | *((a1 + 2)) = 0;
0x0040afc0 jalr t9 | t9 ();
0x0040afc4 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040afc8 lui a1, 0x41 | a1 = 0x410000;
0x0040afcc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040afd0 move a2, s0 | a2 = s0;
0x0040afd4 addiu a0, zero, 3 | a0 = 3;
| /* str.report_to_cloud__otc.info:__s_n */
0x0040afd8 addiu a1, a1, 0x7f1c | a1 += 0x7f1c;
0x0040afdc jalr t9 | t9 ();
0x0040afe0 lw gp, 0x20(sp) | gp = *(var_20h);
0x0040afe4 move a0, s0 | a0 = s0;
0x0040afe8 lw t9, -0x7f18(gp) | t9 = sym.report_to_cloud;
0x0040afec move a1, s3 | a1 = s3;
0x0040aff0 addiu a2, zero, 1 | a2 = 1;
0x0040aff4 jalr t9 | t9 ();
0x0040aff8 move s0, zero | s0 = 0;
0x0040affc lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 == 0) {
0x0040b000 bnez v0, 0x40b008 |
0x0040b004 sw s3, 0x1ec(s2) | *((s2 + 123)) = s3;
| }
| label_5:
0x0040b008 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040b00c move a0, s1 | a0 = s1;
0x0040b010 jalr t9 | t9 ();
0x0040b014 move v0, s0 | v0 = s0;
| label_3:
0x0040b018 lw ra, 0x8c(sp) | ra = *(var_8ch);
0x0040b01c lw s6, 0x88(sp) | s6 = *(var_88h);
0x0040b020 lw s5, 0x84(sp) | s5 = *(var_84h);
0x0040b024 lw s4, 0x80(sp) | s4 = *(var_80h);
0x0040b028 lw s3, 0x7c(sp) | s3 = *(var_7ch);
0x0040b02c lw s2, 0x78(sp) | s2 = *(var_78h);
0x0040b030 lw s1, 0x74(sp) | s1 = *(var_74h);
0x0040b034 lw s0, 0x70(sp) | s0 = *(var_70h);
0x0040b038 addiu sp, sp, 0x90 |
0x0040b03c 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 @ 0x40b040 */
| #include <stdint.h>
|
; (fcn) fcn.0040b040 () | void fcn_0040b040 () {
0x0040b040 lui gp, 0x43 |
0x0040b044 addiu gp, gp, 0x1620 |
0x0040b048 addiu sp, sp, -0x450 |
0x0040b04c lw t9, -0x7f74(gp) | t9 = sym.generate_random_id;
0x0040b050 sw ra, 0x44c(sp) | *(var_44ch) = ra;
0x0040b054 sw s1, 0x448(sp) | *(var_448h) = s1;
0x0040b058 sw s0, 0x444(sp) | *(var_444h) = s0;
0x0040b05c sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040b060 addiu s1, sp, 0x418 | s1 = sp + 0x418;
0x0040b064 jalr t9 | t9 ();
0x0040b068 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b06c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040b070 move a0, s1 | a0 = s1;
0x0040b074 move a1, zero | a1 = 0;
0x0040b078 addiu a2, zero, 0x21 | a2 = 0x21;
0x0040b07c move s0, v0 | s0 = v0;
0x0040b080 jalr t9 | t9 ();
0x0040b084 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b088 move a0, s1 | a0 = s1;
0x0040b08c lw a1, -0x7f28(gp) | a1 = *(gp);
0x0040b090 lw t9, -0x7f24(gp) | t9 = sym.str2hex;
0x0040b094 addiu a1, a1, 0x340 | a1 += 0x340;
0x0040b098 addiu a2, zero, 0x10 | a2 = 0x10;
0x0040b09c jalr t9 | t9 ();
0x0040b0a0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b0a4 addiu s1, sp, 0x18 | s1 = sp + 0x18;
0x0040b0a8 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040b0ac move a0, s1 | a0 = s1;
0x0040b0b0 move a1, zero | a1 = 0;
0x0040b0b4 addiu a2, zero, 0x400 | a2 = 0x400;
0x0040b0b8 jalr t9 | t9 ();
0x0040b0bc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b0c0 lui a1, 0x41 | a1 = 0x410000;
0x0040b0c4 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040b0c8 move a0, s1 | a0 = s1;
| /* str._id_:_u__method_:_props___params_:_ota_state_:_idle_ */
0x0040b0cc addiu a1, a1, 0x7f3c | a1 += 0x7f3c;
0x0040b0d0 move a2, s0 | a2 = s0;
0x0040b0d4 jalr t9 | t9 ();
0x0040b0d8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b0dc lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040b0e0 addiu a0, zero, 0x10 | a0 = 0x10;
0x0040b0e4 jalr t9 | t9 ();
0x0040b0e8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040b0ec bnez v0, 0x40b10c |
0x0040b0f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040b0f4 lui a1, 0x41 | a1 = 0x410000;
0x0040b0f8 move a0, zero | a0 = 0;
| /* esilref: 'malloc fail
' */
0x0040b0fc addiu a1, a1, 0x544c | a1 += 0x544c;
0x0040b100 jalr t9 | t9 ();
0x0040b104 j 0x40b168 | goto label_0;
0x0040b108 addiu v0, zero, -1 | v0 = -1;
| }
0x0040b10c lui v1, 0x41 | v1 = 0x40b2e4;
0x0040b110 addiu v1, v1, -0x4d1c |
0x0040b114 lw t9, -0x7f70(gp) | t9 = sym.callback_queue_add;
0x0040b118 lw a0, -0x7f1c(gp) | a0 = *(gp);
0x0040b11c move a1, v0 | a1 = v0;
0x0040b120 sw s0, (v0) | *(v0) = s0;
0x0040b124 sw v1, 4(v0) | *((v0 + 1)) = v1;
0x0040b128 sw zero, 8(v0) | *((v0 + 2)) = 0;
0x0040b12c jalr t9 | t9 ();
0x0040b130 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b134 lui a1, 0x41 | a1 = 0x410000;
0x0040b138 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040b13c lui a2, 0x42 | a2 = 0x420000;
0x0040b140 addiu a0, zero, 2 | a0 = 2;
| /* esilref: '&s
' */
0x0040b144 addiu a1, a1, 0x6510 | a1 += 0x6510;
| /* str.report_ota_state_idle */
0x0040b148 addiu a2, a2, -0x77b4 | a2 += -0x77b4;
0x0040b14c jalr t9 | t9 ();
0x0040b150 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b154 move a0, s1 | a0 = s1;
0x0040b158 lw t9, -0x7f18(gp) | t9 = sym.report_to_cloud;
0x0040b15c move a1, s0 | a1 = s0;
0x0040b160 addiu a2, zero, 1 | a2 = 1;
0x0040b164 jalr t9 | t9 ();
| label_0:
0x0040b168 lw ra, 0x44c(sp) | ra = *(var_44ch);
0x0040b16c lw s1, 0x448(sp) | s1 = *(var_448h);
0x0040b170 lw s0, 0x444(sp) | s0 = *(var_444h);
0x0040b174 addiu sp, sp, 0x450 |
0x0040b178 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 @ 0x40b17c */
| #include <stdint.h>
|
; (fcn) fcn.0040b17c () | void fcn_0040b17c () {
0x0040b17c lui gp, 0x43 |
0x0040b180 addiu gp, gp, 0x1620 |
0x0040b184 addiu sp, sp, -0x450 |
0x0040b188 lw t9, -0x7f74(gp) | t9 = sym.generate_random_id;
0x0040b18c sw s2, 0x448(sp) | *(var_448h) = s2;
0x0040b190 sw s1, 0x444(sp) | *(var_444h) = s1;
0x0040b194 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040b198 sw ra, 0x44c(sp) | *(var_44ch) = ra;
0x0040b19c sw s0, 0x440(sp) | *(var_440h) = s0;
0x0040b1a0 jalr t9 | t9 ();
0x0040b1a4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b1a8 move s1, v0 | s1 = v0;
0x0040b1ac lw s2, -0x7f28(gp) | s2 = *(gp);
0x0040b1b0 lw v0, 0x39c(s2) | v0 = *((s2 + 231));
0x0040b1b4 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
| if (v0 == 0) {
0x0040b1b8 bnez v0, 0x40b1cc |
0x0040b1bc lui a1, 0x41 | a1 = 0x410000;
0x0040b1c0 addiu a0, zero, 3 | a0 = 3;
0x0040b1c4 j 0x40b258 | goto label_0;
| /* str.no_bind_key_to_report_n */
0x0040b1c8 addiu a1, a1, 0x7f78 | a1 += 0x7f78;
| }
0x0040b1cc addiu s0, sp, 0x418 | s0 = sp + 0x418;
0x0040b1d0 move a0, s0 | a0 = s0;
0x0040b1d4 move a1, zero | a1 = 0;
0x0040b1d8 addiu a2, zero, 0x21 | a2 = 0x21;
0x0040b1dc jalr t9 | t9 ();
0x0040b1e0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b1e4 move a0, s0 | a0 = s0;
0x0040b1e8 lw t9, -0x7f24(gp) | t9 = sym.str2hex;
0x0040b1ec addiu a1, s2, 0x340 | a1 = s2 + 0x340;
0x0040b1f0 addiu a2, zero, 0x10 | a2 = 0x10;
0x0040b1f4 jalr t9 | t9 ();
0x0040b1f8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b1fc addiu s0, sp, 0x18 | s0 = sp + 0x18;
0x0040b200 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040b204 move a0, s0 | a0 = s0;
0x0040b208 move a1, zero | a1 = 0;
0x0040b20c addiu a2, zero, 0x400 | a2 = 0x400;
0x0040b210 jalr t9 | t9 ();
0x0040b214 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b218 lw a3, 0x39c(s2) | a3 = *((s2 + 231));
0x0040b21c lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040b220 lui a1, 0x41 | a1 = 0x410000;
0x0040b224 move a0, s0 | a0 = s0;
| /* str._id_:_u__method_:_props___params_:_bind_key_:__s_ */
0x0040b228 addiu a1, a1, 0x7f90 | a1 += 0x7f90;
0x0040b22c move a2, s1 | a2 = s1;
0x0040b230 jalr t9 | t9 ();
0x0040b234 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b238 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040b23c addiu a0, zero, 0x10 | a0 = 0x10;
0x0040b240 jalr t9 | t9 ();
0x0040b244 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040b248 bnez v0, 0x40b26c |
0x0040b24c lui a1, 0x41 | a1 = 0x410000;
0x0040b250 move a0, zero | a0 = 0;
| /* esilref: 'malloc fail
' */
0x0040b254 addiu a1, a1, 0x544c | a1 += 0x544c;
| label_0:
0x0040b258 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040b25c jalr t9 | t9 ();
0x0040b260 nop |
0x0040b264 j 0x40b2cc | goto label_1;
0x0040b268 addiu v0, zero, -1 | v0 = -1;
| }
0x0040b26c lui v1, 0x41 | v1 = 0x40b38c;
0x0040b270 addiu v1, v1, -0x4c74 |
0x0040b274 lw t9, -0x7f70(gp) | t9 = sym.callback_queue_add;
0x0040b278 lw a0, -0x7f1c(gp) | a0 = *(gp);
0x0040b27c move a1, v0 | a1 = v0;
0x0040b280 sw s1, (v0) | *(v0) = s1;
0x0040b284 sw v1, 4(v0) | *((v0 + 1)) = v1;
0x0040b288 sw zero, 8(v0) | *((v0 + 2)) = 0;
0x0040b28c jalr t9 | t9 ();
0x0040b290 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b294 lui a1, 0x41 | a1 = 0x410000;
0x0040b298 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040b29c lui a2, 0x42 | a2 = 0x420000;
0x0040b2a0 addiu a0, zero, 2 | a0 = 2;
| /* str._s:__s_n */
0x0040b2a4 addiu a1, a1, 0x7fc8 | a1 += 0x7fc8;
| /* str.report_bind_key */
0x0040b2a8 addiu a2, a2, -0x77e4 | a2 += -0x77e4;
0x0040b2ac move a3, s0 | a3 = s0;
0x0040b2b0 jalr t9 | t9 ();
0x0040b2b4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040b2b8 move a0, s0 | a0 = s0;
0x0040b2bc lw t9, -0x7f18(gp) | t9 = sym.report_to_cloud;
0x0040b2c0 move a1, s1 | a1 = s1;
0x0040b2c4 addiu a2, zero, 1 | a2 = 1;
0x0040b2c8 jalr t9 | t9 ();
| label_1:
0x0040b2cc lw ra, 0x44c(sp) | ra = *(var_44ch);
0x0040b2d0 lw s2, 0x448(sp) | s2 = *(var_448h);
0x0040b2d4 lw s1, 0x444(sp) | s1 = *(var_444h);
0x0040b2d8 lw s0, 0x440(sp) | s0 = *(var_440h);
0x0040b2dc addiu sp, sp, 0x450 |
0x0040b2e0 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 @ 0x40b440 */
| #include <stdint.h>
|
; (fcn) fcn.0040b440 () | void fcn_0040b440 () {
0x0040b440 lui gp, 0x43 |
0x0040b444 addiu gp, gp, 0x1620 |
0x0040b448 addiu sp, sp, -0x258 |
0x0040b44c lw t9, -0x7f10(gp) | t9 = sym.mdnsd_start;
0x0040b450 sw s2, 0x24c(sp) | *(var_24ch) = s2;
0x0040b454 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0040b458 sw ra, 0x254(sp) | *(var_254h) = ra;
0x0040b45c sw s3, 0x250(sp) | *(var_250h) = s3;
0x0040b460 sw s1, 0x248(sp) | *(var_248h) = s1;
0x0040b464 sw s0, 0x244(sp) | *(var_244h) = s0;
0x0040b468 jalr t9 | t9 ();
0x0040b46c move s2, v0 | s2 = v0;
0x0040b470 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040b474 bnez v0, 0x40b488 |
0x0040b478 lui a0, 0x42 | a0 = "mdnsd_start() error";
| /* str.mdnsd_start___error */
0x0040b47c addiu a0, a0, -0x7fcc |
0x0040b480 j 0x40b604 | goto label_0;
0x0040b484 lw t9, -0x7d10(gp) | t9 = sym.imp.perror;
| }
0x0040b488 lw s0, -0x7f28(gp) | s0 = *(gp);
0x0040b48c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040b490 addiu s1, sp, 0x220 | s1 = sp + 0x220;
0x0040b494 move a0, s1 | a0 = s1;
0x0040b498 addiu a1, s0, 0x360 | a1 = s0 + 0x360;
0x0040b49c sw v0, 0x26c(s0) | *((s0 + 155)) = v0;
0x0040b4a0 addiu a2, zero, 0x18 | a2 = 0x18;
0x0040b4a4 jalr t9 | t9 ();
0x0040b4a8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b4ac move v1, s1 | v1 = s1;
0x0040b4b0 addiu a0, zero, 0x2e | a0 = 0x2e;
0x0040b4b4 addiu a1, zero, 0x2d | a1 = 0x2d;
| do {
0x0040b4b8 lb v0, (v1) | v0 = *(v1);
0x0040b4bc lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
| if (v0 == 0) {
0x0040b4c0 beqz v0, 0x40b4d4 | goto label_1;
| }
| if (v0 != a0) {
0x0040b4c4 beql v0, a0, 0x40b4cc |
0x0040b4c8 sb a1, (v1) | *(v1) = a1;
| }
0x0040b4cc j 0x40b4b8 |
| } while (1);
0x0040b4d0 addiu v1, v1, 1 | v1++;
| label_1:
0x0040b4d4 move a0, s1 | a0 = s1;
0x0040b4d8 jalr t9 | t9 ();
0x0040b4dc addiu v0, v0, 0x19 | v0 += 0x19;
0x0040b4e0 sltiu v1, v0, 0x200 | v1 = (v0 < 0x200) ? 1 : 0;
0x0040b4e4 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b4e8 addiu s3, sp, 0x20 | s3 = sp + 0x20;
| if (v1 == 0) {
0x0040b4ec bnez v1, 0x40b518 |
0x0040b4f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040b4f4 lui a1, 0x42 | a1 = 0x420000;
0x0040b4f8 lui a2, 0x41 | a2 = 0x410000;
0x0040b4fc move a0, zero | a0 = 0;
| /* str.string_too_long.__s__line__d_n */
0x0040b500 addiu a1, a1, -0x7fb8 | a1 += -0x7fb8;
| /* str.miio_misc.c */
0x0040b504 addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040b508 addiu a3, zero, 0x29c | a3 = 0x29c;
0x0040b50c jalr t9 | t9 ();
0x0040b510 j 0x40b54c | goto label_2;
0x0040b514 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040b518 lw v0, 0x2e0(s0) | v0 = *((s0 + 184));
0x0040b51c lw v1, 0x2e4(s0) | v1 = *((s0 + 185));
0x0040b520 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040b524 lui a1, 0x42 | a1 = 0x420000;
0x0040b528 lui a3, 0x42 | a3 = 0x420000;
0x0040b52c sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040b530 sw v1, 0x14(sp) | *(var_14h) = v1;
0x0040b534 move a0, s3 | a0 = s3;
| /* str._s_s_llu */
0x0040b538 addiu a1, a1, -0x7f98 | a1 += -0x7f98;
0x0040b53c move a2, s1 | a2 = s1;
| /* str._miio */
0x0040b540 addiu a3, a3, -0x7f8c | a3 += -0x7f8c;
0x0040b544 jalr t9 | t9 ();
0x0040b548 lw gp, 0x18(sp) | gp = *(var_18h);
| label_2:
0x0040b54c lw t9, -0x7d70(gp) | t9 = sym.imp.inet_addr;
0x0040b550 addiu a0, s0, 0x38a | a0 = s0 + 0x38a;
0x0040b554 jalr t9 | t9 ();
0x0040b558 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b55c move a2, v0 | a2 = v0;
0x0040b560 lw t9, -0x7f0c(gp) | t9 = sym.mdnsd_set_hostname;
0x0040b564 move a1, s3 | a1 = s3;
0x0040b568 move a0, s2 | a0 = s2;
0x0040b56c jalr t9 | t9 ();
0x0040b570 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b574 lw t9, -0x7f08(gp) | t9 = sym.create_nlabel;
0x0040b578 move a0, s3 | a0 = s3;
0x0040b57c jalr t9 | t9 ();
0x0040b580 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b584 addiu a0, s0, 0x38a | a0 = s0 + 0x38a;
0x0040b588 lw t9, -0x7d70(gp) | t9 = sym.imp.inet_addr;
0x0040b58c move s1, v0 | s1 = v0;
0x0040b590 jalr t9 | t9 ();
0x0040b594 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b598 move a0, s1 | a0 = s1;
0x0040b59c lw t9, -0x7f04(gp) | t9 = sym.rr_create_a;
0x0040b5a0 move a1, v0 | a1 = v0;
0x0040b5a4 jalr t9 | t9 ();
0x0040b5a8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b5ac move a1, v0 | a1 = v0;
0x0040b5b0 lw t9, -0x7f00(gp) | t9 = sym.mdnsd_add_rr;
0x0040b5b4 move a0, s2 | a0 = s2;
0x0040b5b8 jalr t9 | t9 ();
0x0040b5bc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b5c0 lui v1, 0x42 | v1 = "path=/mydevice";
| /* str.path_mydevice */
0x0040b5c4 addiu v1, v1, -0x7f84 |
0x0040b5c8 lw t9, -0x7efc(gp) | t9 = sym.mdnsd_register_svc;
0x0040b5cc addiu v0, sp, 0x238 | v0 = sp + 0x238;
0x0040b5d0 lui a2, 0x42 | a2 = 0x420000;
0x0040b5d4 move a0, s2 | a0 = s2;
0x0040b5d8 sw v1, 0x238(sp) | *(var_238h) = v1;
0x0040b5dc sw zero, 0x23c(sp) | *(var_23ch) = 0;
0x0040b5e0 sw zero, 0x10(sp) | *(var_10h) = 0;
0x0040b5e4 sw v0, 0x14(sp) | *(var_14h) = v0;
0x0040b5e8 move a1, s3 | a1 = s3;
| /* str._miio._udp.local */
0x0040b5ec addiu a2, a2, -0x7f74 | a2 += -0x7f74;
0x0040b5f0 ori a3, zero, 0xd431 | a3 = 0xd431;
0x0040b5f4 jalr t9 | t9 ();
0x0040b5f8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040b5fc move a0, v0 | a0 = v0;
0x0040b600 lw t9, -0x7ef8(gp) | t9 = sym.mdns_service_destroy;
| label_0:
0x0040b604 jalr t9 | t9 ();
0x0040b608 nop |
0x0040b60c lw ra, 0x254(sp) | ra = *(var_254h);
0x0040b610 lw s3, 0x250(sp) | s3 = *(var_250h);
0x0040b614 lw s2, 0x24c(sp) | s2 = *(var_24ch);
0x0040b618 lw s1, 0x248(sp) | s1 = *(var_248h);
0x0040b61c lw s0, 0x244(sp) | s0 = *(var_244h);
0x0040b620 addiu sp, sp, 0x258 |
0x0040b624 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 @ 0x40bbbc */
| #include <stdint.h>
|
; (fcn) fcn.0040bbbc () | void fcn_0040bbbc () {
0x0040bbbc lui gp, 0x43 |
0x0040bbc0 addiu sp, sp, -0x1060 |
0x0040bbc4 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040bbc8 sw s1, 0x1040(sp) | *(var_1040h) = s1;
0x0040bbcc lw s1, -0x7f28(gp) | s1 = *(gp);
0x0040bbd0 sw s5, 0x1050(sp) | *(var_1050h) = s5;
0x0040bbd4 lw s5, 0x268(s1) | s5 = *((s1 + 154));
0x0040bbd8 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040bbdc sw a2, 0x1030(sp) | *(var_1030h) = a2;
0x0040bbe0 sw a3, 0x1034(sp) | *(var_1034h) = a3;
0x0040bbe4 sw ra, 0x105c(sp) | *(var_105ch) = ra;
0x0040bbe8 sw s7, 0x1058(sp) | *(var_1058h) = s7;
0x0040bbec sw s6, 0x1054(sp) | *(var_1054h) = s6;
0x0040bbf0 sw s4, 0x104c(sp) | *(var_104ch) = s4;
0x0040bbf4 sw s3, 0x1048(sp) | *(var_1048h) = s3;
0x0040bbf8 sw s2, 0x1044(sp) | *(var_1044h) = s2;
0x0040bbfc sw s0, 0x103c(sp) | *(var_103ch) = s0;
0x0040bc00 sw gp, 0x28(sp) | *(var_28h) = gp;
0x0040bc04 move s2, a0 | s2 = a0;
0x0040bc08 move a0, s5 | a0 = s5;
0x0040bc0c move s4, a1 | s4 = a1;
0x0040bc10 lw s3, 0x1070(sp) | s3 = *(arg_1070h);
0x0040bc14 jalr t9 | t9 ();
0x0040bc18 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040bc1c move a0, s2 | a0 = s2;
0x0040bc20 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040bc24 move s0, v0 | s0 = v0;
0x0040bc28 jalr t9 | t9 ();
0x0040bc2c lw gp, 0x28(sp) | gp = *(var_28h);
0x0040bc30 move a0, s4 | a0 = s4;
0x0040bc34 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040bc38 move s7, v0 | s7 = v0;
0x0040bc3c jalr t9 | t9 ();
0x0040bc40 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040bc44 addu s0, s0, s7 | s0 += s7;
0x0040bc48 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040bc4c move s6, v0 | s6 = v0;
0x0040bc50 move a0, s3 | a0 = s3;
0x0040bc54 addiu s0, s0, 0x96 | s0 += 0x96;
0x0040bc58 jalr t9 | t9 ();
0x0040bc5c addu s0, s0, s6 | s0 += s6;
0x0040bc60 addu v0, s0, v0 | v0 = s0 + v0;
0x0040bc64 sltiu s0, v0, 0xfff | s0 = (v0 < 0xfff) ? 1 : 0;
0x0040bc68 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040bc6c lw a2, 0x1030(sp) | a2 = *(var_1030h);
0x0040bc70 lw a3, 0x1034(sp) | a3 = *(var_1034h);
| if (s0 == 0) {
0x0040bc74 bnez s0, 0x40bca0 |
0x0040bc78 lui a1, 0x41 | a1 = 0x410000;
0x0040bc7c lui a2, 0x42 | a2 = 0x420000;
0x0040bc80 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bc84 addiu a0, zero, 3 | a0 = 3;
| /* str._s:_dir_too_long:__s_n */
0x0040bc88 addiu a1, a1, 0x5048 | a1 += 0x5048;
| /* str.cmd_internal_wifi_start */
0x0040bc8c addiu a2, a2, -0x7764 | a2 += -0x7764;
0x0040bc90 move a3, s5 | a3 = s5;
0x0040bc94 jalr t9 | t9 ();
0x0040bc98 j 0x40bd44 | goto label_0;
0x0040bc9c nop |
| }
0x0040bca0 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040bca4 addiu v0, s1, 0x21c | v0 = s1 + 0x21c;
0x0040bca8 addiu s0, sp, 0x30 | s0 = sp + 0x30;
0x0040bcac lui a1, 0x42 | a1 = 0x420000;
0x0040bcb0 sw a2, 0x18(sp) | *(var_18h) = a2;
0x0040bcb4 sw a3, 0x1c(sp) | *(var_1ch) = a3;
0x0040bcb8 sw s4, 0x10(sp) | *(var_10h) = s4;
0x0040bcbc move a3, s2 | a3 = s2;
0x0040bcc0 sw v0, 0x20(sp) | *(var_20h) = v0;
0x0040bcc4 sw s3, 0x24(sp) | *(var_24h) = s3;
0x0040bcc8 move a0, s0 | a0 = s0;
| /* str._method_:__internal.wifi_start___params_:_datadir_:__s___ssid_:__s___passwd_:__s___uid_:__llu___country_domain_:__s___tz_:__s_ */
0x0040bccc addiu a1, a1, -0x7dd4 | a1 += -0x7dd4;
0x0040bcd0 move a2, s5 | a2 = s5;
0x0040bcd4 jalr t9 | t9 ();
0x0040bcd8 lw s2, 0x2d4(s1) | s2 = *((s1 + 181));
0x0040bcdc addu v0, s0, v0 | v0 = s0 + v0;
0x0040bce0 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040bce4 sb zero, (v0) | *(v0) = 0;
| if (s2 > 0) {
0x0040bce8 blez s2, 0x40bd30 |
0x0040bcec lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040bcf0 move a0, s0 | a0 = s0;
0x0040bcf4 jalr t9 | t9 ();
0x0040bcf8 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040bcfc move a0, s2 | a0 = s2;
0x0040bd00 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x0040bd04 move a1, s0 | a1 = s0;
0x0040bd08 move a2, v0 | a2 = v0;
0x0040bd0c jalr t9 | t9 ();
0x0040bd10 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 >= 0) {
0x0040bd14 bgez v0, 0x40bd44 | goto label_0;
| }
0x0040bd18 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x0040bd1c lw a1, 0x2d4(s1) | a1 = *((s1 + 181));
0x0040bd20 move a0, s1 | a0 = s1;
0x0040bd24 jalr t9 | t9 ();
0x0040bd28 j 0x40bd44 | goto label_0;
0x0040bd2c sw zero, 0x2d4(s1) | *((s1 + 181)) = 0;
| }
0x0040bd30 lui a1, 0x41 | a1 = 0x410000;
0x0040bd34 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bd38 addiu a0, zero, 1 | a0 = 1;
| /* str.No_helper_script__n */
0x0040bd3c addiu a1, a1, 0x50b4 | a1 += 0x50b4;
0x0040bd40 jalr t9 | t9 ();
| label_0:
0x0040bd44 lw ra, 0x105c(sp) | ra = *(var_105ch);
0x0040bd48 lw s7, 0x1058(sp) | s7 = *(var_1058h);
0x0040bd4c lw s6, 0x1054(sp) | s6 = *(var_1054h);
0x0040bd50 lw s5, 0x1050(sp) | s5 = *(var_1050h);
0x0040bd54 lw s4, 0x104c(sp) | s4 = *(var_104ch);
0x0040bd58 lw s3, 0x1048(sp) | s3 = *(var_1048h);
0x0040bd5c lw s2, 0x1044(sp) | s2 = *(var_1044h);
0x0040bd60 lw s1, 0x1040(sp) | s1 = *(var_1040h);
0x0040bd64 lw s0, 0x103c(sp) | s0 = *(var_103ch);
0x0040bd68 addiu sp, sp, 0x1060 |
0x0040bd6c 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 @ 0x40eb6c */
| #include <stdint.h>
|
; (fcn) fcn.0040eb6c () | void fcn_0040eb6c () {
0x0040eb6c lui gp, 0x43 |
0x0040eb70 addiu gp, gp, 0x1620 |
0x0040eb74 addiu sp, sp, -0x20 |
0x0040eb78 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040eb7c sw ra, 0x1c(sp) | *(var_1ch) = ra;
0x0040eb80 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040eb84 addiu a0, zero, 0xc | a0 = 0xc;
0x0040eb88 jalr t9 | t9 ();
0x0040eb8c sw zero, 8(v0) | *((v0 + 2)) = 0;
| if (v0 != 0) {
0x0040eb90 bnel v0, zero, 0x40ebb4 |
0x0040eb94 lui a1, 0x42 | a1 = 0x420000;
0x0040eb98 lui a2, 0x42 | a2 = 0x420000;
0x0040eb9c move a0, zero | a0 = 0;
| /* str._s___NO_enough_memory_n */
0x0040eba0 addiu a1, a1, -0x7524 | a1 += -0x7524;
| /* str.init_list */
0x0040eba4 addiu a2, a2, -0x74d0 | a2 += -0x74d0;
0x0040eba8 jal 0x40dfb8 | sym_log_printf ()
0x0040ebac j 0x40ebbc | goto label_0;
0x0040ebb0 move v0, zero | v0 = 0;
| }
0x0040ebb4 sw zero, (v0) | *(v0) = 0;
0x0040ebb8 sw zero, 4(v0) | *((v0 + 1)) = 0;
| label_0:
0x0040ebbc lw ra, 0x1c(sp) | ra = *(var_1ch);
0x0040ebc0 addiu sp, sp, 0x20 |
0x0040ebc4 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 @ 0x40ebc8 */
| #include <stdint.h>
|
; (fcn) fcn.0040ebc8 () | void fcn_0040ebc8 () {
0x0040ebc8 addiu sp, sp, -0x30 |
0x0040ebcc sw s1, 0x20(sp) | *(var_20h) = s1;
0x0040ebd0 lw s1, (a0) | s1 = *(a0);
0x0040ebd4 lui gp, 0x43 |
0x0040ebd8 addiu gp, gp, 0x1620 |
0x0040ebdc slti v0, s1, 0x3e9 | v0 = (s1 < 0x3e9) ? 1 : 0;
0x0040ebe0 sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x0040ebe4 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x0040ebe8 sw s3, 0x28(sp) | *(var_28h) = s3;
0x0040ebec sw s2, 0x24(sp) | *(var_24h) = s2;
0x0040ebf0 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040ebf4 move s0, a0 | s0 = a0;
| if (v0 == 0) {
0x0040ebf8 bnez v0, 0x40ec14 |
0x0040ebfc lui a1, 0x42 | a1 = 0x420000;
0x0040ec00 addiu a0, zero, 1 | a0 = 1;
| /* str.there_are_too_many_msgs_n */
0x0040ec04 addiu a1, a1, -0x750c | a1 += -0x750c;
0x0040ec08 jal 0x40dfb8 | sym_log_printf ()
0x0040ec0c j 0x40ec48 | goto label_0;
0x0040ec10 nop |
| }
0x0040ec14 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040ec18 addiu a0, zero, 0xc | a0 = 0xc;
0x0040ec1c move s3, a1 | s3 = a1;
0x0040ec20 move s2, a2 | s2 = a2;
0x0040ec24 jalr t9 | t9 ();
0x0040ec28 lw v1, 8(s0) | v1 = *((s0 + 2));
| if (v0 != 0) {
0x0040ec2c bnel v0, zero, 0x40ec50 |
0x0040ec30 lui a1, 0x42 | a1 = 0x420000;
0x0040ec34 lui a2, 0x42 | a2 = 0x420000;
0x0040ec38 move a0, zero | a0 = 0;
| /* str._s___NO_enough_memory_n */
0x0040ec3c addiu a1, a1, -0x7524 | a1 += -0x7524;
| /* str.insert_list */
0x0040ec40 addiu a2, a2, -0x74dc | a2 += -0x74dc;
0x0040ec44 jal 0x40dfb8 | sym_log_printf ()
| label_0:
0x0040ec48 j 0x40ec6c | goto label_1;
0x0040ec4c addiu v0, zero, -1 | v0 = -1;
| }
0x0040ec50 addiu s1, s1, 1 | s1++;
0x0040ec54 sw s3, (v0) | *(v0) = s3;
0x0040ec58 sw s2, 4(v0) | *((v0 + 1)) = s2;
0x0040ec5c sw v1, 8(v0) | *((v0 + 2)) = v1;
0x0040ec60 sw v0, 8(s0) | *((s0 + 2)) = v0;
0x0040ec64 sw s1, (s0) | *(s0) = s1;
0x0040ec68 move v0, zero | v0 = 0;
| label_1:
0x0040ec6c lw ra, 0x2c(sp) | ra = *(var_2ch);
0x0040ec70 lw s3, 0x28(sp) | s3 = *(var_28h);
0x0040ec74 lw s2, 0x24(sp) | s2 = *(var_24h);
0x0040ec78 lw s1, 0x20(sp) | s1 = *(var_20h);
0x0040ec7c lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x0040ec80 addiu sp, sp, 0x30 |
0x0040ec84 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 @ 0x402060 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [09] -r-x section size 76048 named .text */
0x00402060 lui gp, 0x43 |
0x00402064 addiu gp, gp, 0x1620 |
0x00402068 lw v0, -0x7cdc(gp) | v0 = *((gp - 7991));
0x0040206c addiu sp, sp, -0x100 |
0x00402070 lw v1, (v0) | v1 = *(v0);
0x00402074 lw v0, -0x7f98(gp) | v0 = *(gp);
0x00402078 sw s5, 0xec(sp) | *(var_ech) = s5;
0x0040207c sw s3, 0xe4(sp) | *(var_e4h) = s3;
0x00402080 sw s0, 0xd8(sp) | *(var_d8h) = s0;
0x00402084 lui s3, 0x41 | s3 = 0x410000;
0x00402088 lui s0, 0x43 | s0 = 0x430000;
0x0040208c lui s5, 0x43 | s5 = 0x430000;
0x00402090 sw s7, 0xf4(sp) | *(var_f4h) = s7;
0x00402094 sw s6, 0xf0(sp) | *(var_f0h) = s6;
0x00402098 sw s4, 0xe8(sp) | *(var_e8h) = s4;
0x0040209c sw s2, 0xe0(sp) | *(var_e0h) = s2;
0x004020a0 sw ra, 0xfc(sp) | *(var_fch) = ra;
0x004020a4 sw fp, 0xf8(sp) | *(var_f8h) = fp;
0x004020a8 sw s1, 0xdc(sp) | *(var_dch) = s1;
0x004020ac sw gp, 0x28(sp) | *(var_28h) = gp;
0x004020b0 move s7, a0 | s7 = a0;
0x004020b4 move s4, a1 | s4 = a1;
0x004020b8 sw v1, (v0) | *(v0) = v1;
0x004020bc move s2, zero | s2 = 0;
| /* str.Dp:H:i:l:L:hvd:eEC: */
0x004020c0 addiu s3, s3, 0x6e6c | s3 += 0x6e6c;
0x004020c4 addiu s0, s0, -0x6bac | s0 += -0x6bac;
0x004020c8 addiu s6, s5, -0x6bb4 | s6 = s5 + -0x6bb4;
0x004020cc lw t9, -0x7d00(gp) | t9 = sym.imp.getopt_long;
| do {
| label_0:
0x004020d0 lui a3, 0x43 | a3 = 0x430000;
0x004020d4 sw zero, 0x10(sp) | *(var_10h) = 0;
0x004020d8 move a0, s7 | a0 = s7;
0x004020dc move a1, s4 | a1 = s4;
0x004020e0 move a2, s3 | a2 = s3;
| /* esilref: 'help' */
0x004020e4 addiu a3, a3, -0x6ea0 | a3 += -0x6ea0;
0x004020e8 jalr t9 | t9 ();
0x004020ec lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x004020f0 bltz v0, 0x40254c | goto label_12;
| }
0x004020f4 addiu v1, zero, 0x64 | v1 = 0x64;
0x004020f8 slti v1, v0, 0x65 | v1 = (v0 < 0x65) ? 1 : 0;
| if (v0 == v1) {
0x004020fc beq v0, v1, 0x4022c8 | goto label_13;
| }
0x00402100 addiu v1, zero, 0x45 | v1 = 0x45;
| if (v1 == 0) {
0x00402104 beqz v1, 0x402158 | goto label_14;
| }
0x00402108 slti v1, v0, 0x46 | v1 = (v0 < 0x46) ? 1 : 0;
| if (v0 == v1) {
0x0040210c beq v0, v1, 0x402344 | goto label_15;
| }
0x00402110 addiu a0, zero, 0x48 | a0 = 0x48;
| if (v1 == 0) {
0x00402114 beqz v1, 0x402134 | goto label_16;
| }
0x00402118 addiu v1, zero, 0x43 | v1 = 0x43;
0x0040211c addiu v1, zero, 0x44 | v1 = 0x44;
| if (v0 == v1) {
0x00402120 beq v0, v1, 0x4021d8 | goto label_17;
| }
0x00402124 addiu s2, zero, 1 | s2 = 1;
| if (v0 != v1) {
0x00402128 bne v0, v1, 0x40245c | goto label_18;
| }
0x0040212c j 0x4020d0 |
| } while (1);
0x00402130 lw t9, -0x7d00(gp) | t9 = sym.imp.getopt_long;
| label_16:
0x00402134 lw v1, -0x7d18(gp) | v1 = *((gp - 8006));
| if (v0 != a0) {
0x00402138 beq v0, a0, 0x4023c8 |
0x0040213c addiu a0, zero, 0x4c | a0 = 0x4c;
0x00402140 lui v0, 0x41 | v0 = 0x410000;
| if (v0 != a0) {
0x00402144 bne v0, a0, 0x402460 | goto label_19;
| }
0x00402148 lw a0, (v1) | a0 = *(v1);
0x0040214c jal 0x40aae0 | fcn_0040aae0 ();
0x00402150 j 0x402454 | goto label_20;
0x00402154 lw gp, 0x28(sp) | gp = *(var_28h);
| label_14:
0x00402158 addiu v1, zero, 0x6c | v1 = 0x6c;
0x0040215c lui s1, 0x43 | s1 = 0x430000;
| if (v0 != v1) {
0x00402160 beq v0, v1, 0x40238c |
0x00402164 slti v1, v0, 0x6d | v1 = (v0 < 0x6d) ? 1 : 0;
| /* obj.miio */
0x00402168 addiu s1, s1, -0x6dd0 | s1 += -0x6dd0;
| if (v1 != 0) {
0x0040216c beqz v1, 0x4021ac |
0x00402170 addiu v1, zero, 0x65 | v1 = 0x65;
0x00402174 addiu v1, zero, 0x69 | v1 = 0x69;
| if (v0 == v1) {
0x00402178 beq v0, v1, 0x40232c | goto label_21;
| }
0x0040217c lw v0, -0x7d18(gp) | v0 = *((gp - 8006));
| if (v0 != v1) {
0x00402180 bne v0, v1, 0x40245c | goto label_18;
| }
0x00402184 lw t9, -0x7e3c(gp) | t9 = sym.imp.atoi;
0x00402188 lw a0, (v0) | a0 = *(v0);
0x0040218c jalr t9 | t9 ();
0x00402190 lui a1, 0x41 | a1 = 0x410000;
0x00402194 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402198 sw v0, 0x1f8(s1) | *((s1 + 126)) = v0;
0x0040219c addiu a0, zero, 2 | a0 = 2;
| /* str.Set_sync_interval_of__otc.info_to:__d_ms_n */
0x004021a0 addiu a1, a1, 0x6f50 | a1 += 0x6f50;
0x004021a4 j 0x402444 | goto label_22;
0x004021a8 move a2, v0 | a2 = v0;
| }
0x004021ac addiu v1, zero, 0x70 | v1 = 0x70;
0x004021b0 addiu v1, zero, 0x76 | v1 = 0x76;
| if (v0 != v1) {
0x004021b4 beq v0, v1, 0x402370 |
0x004021b8 lw v0, -0x7e08(gp) | v0 = *((gp - 8066));
| if (v0 != v1) {
0x004021bc bne v0, v1, 0x40245c | goto label_18;
| }
0x004021c0 lui a1, 0x41 | a1 = 0x410000;
0x004021c4 lui a2, 0x41 | a2 = 0x410000;
0x004021c8 lw a0, (v0) | a0 = *(v0);
| /* esilref: '&s
' */
0x004021cc addiu a1, a1, 0x6510 | a1 += 0x6510;
0x004021d0 j 0x4024b8 | goto label_23;
| /* str.miio_client_3.3.9 */
0x004021d4 addiu a2, a2, 0x6fbc | a2 += 0x6fbc;
| label_17:
0x004021d8 lw fp, -0x7d18(gp) | fp = *((gp - 8006));
0x004021dc lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004021e0 lw s1, (fp) | s1 = *(fp);
0x004021e4 move a0, s1 | a0 = s1;
0x004021e8 jalr t9 | t9 ();
0x004021ec addiu v1, v0, -1 | v1 = v0 + -1;
0x004021f0 sltiu v1, v1, 7 | v1 = (v1 < 7) ? 1 : 0;
0x004021f4 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v1 != 0) {
0x004021f8 beqz v1, 0x4022b4 |
0x004021fc lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00402200 move a1, s1 | a1 = s1;
0x00402204 sw zero, -0x6bb4(s5) | *((s5 - 6893)) = 0;
0x00402208 move a0, s6 | a0 = s6;
0x0040220c move a2, v0 | a2 = v0;
0x00402210 sw zero, 4(s6) | *((s6 + 1)) = 0;
0x00402214 jalr t9 | t9 ();
0x00402218 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040221c move a0, s0 | a0 = s0;
0x00402220 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00402224 move a1, zero | a1 = 0;
0x00402228 addiu a2, zero, 0x20 | a2 = 0x20;
0x0040222c jalr t9 | t9 ();
0x00402230 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402234 lui v0, 0x41 | v0 = 0x410000;
0x00402238 lui v1, 0x41 | v1 = 0x410000;
| /* str.ott.io.mi.com */
0x0040223c addiu v0, v0, 0x67a4 | v0 += 0x67a4;
0x00402240 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
| /* str._s._s */
0x00402244 addiu a2, v1, 0x679c | a2 = v1 + 0x679c;
0x00402248 move a3, s1 | a3 = s1;
0x0040224c sw v1, 0xd4(sp) | *(var_d4h) = v1;
0x00402250 move a0, s0 | a0 = s0;
0x00402254 addiu a1, zero, 0x20 | a1 = 0x20;
0x00402258 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040225c jalr t9 | t9 ();
0x00402260 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402264 lui s1, 0x43 | s1 = 0x429474;
0x00402268 addiu s1, s1, -0x6b8c |
0x0040226c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x00402270 move a0, s1 | a0 = s1;
0x00402274 move a1, zero | a1 = 0;
0x00402278 addiu a2, zero, 0x20 | a2 = 0x20;
0x0040227c jalr t9 | t9 ();
0x00402280 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402284 lw v1, 0xd4(sp) | v1 = *(var_d4h);
0x00402288 lui v0, 0x41 | v0 = 0x410000;
0x0040228c lw a3, (fp) | a3 = *(fp);
| /* str.ot.io.mi.com */
0x00402290 addiu v0, v0, 0x67b4 | v0 += 0x67b4;
0x00402294 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
0x00402298 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040229c move a0, s1 | a0 = s1;
0x004022a0 addiu a1, zero, 0x20 | a1 = 0x20;
0x004022a4 addiu a2, v1, 0x679c | a2 = v1 + 0x679c;
0x004022a8 jalr t9 | t9 ();
0x004022ac j 0x402454 | goto label_20;
0x004022b0 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x004022b4 lui a1, 0x41 | a1 = 0x410000;
0x004022b8 move a0, zero | a0 = 0;
| /* str.Illegal_country_domain:__s */
0x004022bc addiu a1, a1, 0x6e80 | a1 += 0x6e80;
0x004022c0 j 0x402444 | goto label_22;
0x004022c4 move a2, s1 | a2 = s1;
| label_13:
0x004022c8 lw v0, -0x7d18(gp) | v0 = *((gp - 8006));
0x004022cc lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004022d0 lw a2, (v0) | a2 = *(v0);
0x004022d4 move a0, a2 | a0 = a2;
0x004022d8 sw a2, 0xc4(sp) | *(var_c4h) = a2;
0x004022dc jalr t9 | t9 ();
0x004022e0 addiu v0, v0, 0x14 | v0 += 0x14;
0x004022e4 lw gp, 0x28(sp) | gp = *(var_28h);
0x004022e8 sltiu v0, v0, 0x1000 | v0 = (v0 < 0x1000) ? 1 : 0;
0x004022ec lw a2, 0xc4(sp) | a2 = *(var_c4h);
0x004022f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 == 0) {
0x004022f4 bnez v0, 0x402314 |
0x004022f8 lui a1, 0x41 | a1 = 0x410000;
0x004022fc move a0, zero | a0 = 0;
| /* str.Data_dir_path___s__too_deep__should_be_less_than:__d_n */
0x00402300 addiu a1, a1, 0x6e9c | a1 += 0x6e9c;
0x00402304 addiu a3, zero, 0xfec | a3 = 0xfec;
0x00402308 jalr t9 | t9 ();
0x0040230c j 0x402544 | goto label_24;
0x00402310 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00402314 lui v0, 0x43 | v0 = 0x430000;
0x00402318 lui a1, 0x41 | a1 = 0x410000;
0x0040231c sw a2, -0x6b68(v0) | *((v0 - 6874)) = a2;
0x00402320 addiu a0, zero, 2 | a0 = 2;
0x00402324 j 0x402448 | goto label_25;
| /* str.Set_data_dir_to:__s_n */
0x00402328 addiu a1, a1, 0x6ed4 | a1 += 0x6ed4;
| label_21:
0x0040232c addiu v0, zero, 1 | v0 = 1;
0x00402330 lui a1, 0x41 | a1 = 0x410000;
0x00402334 sb v0, 0x208(s1) | *((s1 + 520)) = v0;
0x00402338 addiu a0, zero, 2 | a0 = 2;
0x0040233c j 0x40235c | goto label_26;
| /* str.Key_encrypted._n */
0x00402340 addiu a1, a1, 0x6eec | a1 += 0x6eec;
| label_15:
0x00402344 addiu v1, zero, 1 | v1 = 1;
0x00402348 lui v0, 0x43 | v0 = 0x430000;
0x0040234c lui a1, 0x41 | a1 = 0x410000;
0x00402350 sb v1, -0x6bc7(v0) | *((v0 - 27591)) = v1;
0x00402354 addiu a0, zero, 2 | a0 = 2;
| /* str.DATA_btw_app_and_miio_encrypted._n */
0x00402358 addiu a1, a1, 0x6efc | a1 += 0x6efc;
| label_26:
0x0040235c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402360 jalr t9 | t9 ();
0x00402364 nop |
0x00402368 j 0x402454 | goto label_20;
0x0040236c lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00402370 lw v0, -0x7d18(gp) | v0 = *((gp - 8006));
0x00402374 lui a1, 0x41 | a1 = 0x410000;
0x00402378 lw a2, (v0) | a2 = *(v0);
0x0040237c addiu a0, zero, 2 | a0 = 2;
0x00402380 sw a2, 0x264(s1) | *((s1 + 153)) = a2;
0x00402384 j 0x402444 | goto label_22;
| /* str.Set_TCP_port_to___s__n */
0x00402388 addiu a1, a1, 0x6f20 | a1 += 0x6f20;
| }
0x0040238c lw v0, -0x7d18(gp) | v0 = *((gp - 8006));
0x00402390 lw t9, -0x7e3c(gp) | t9 = sym.imp.atoi;
0x00402394 lw a0, (v0) | a0 = *(v0);
0x00402398 jalr t9 | t9 ();
0x0040239c lw gp, 0x28(sp) | gp = *(var_28h);
0x004023a0 sltiu a0, v0, 5 | a0 = (v0 < 5) ? 1 : 0;
0x004023a4 lw v1, -0x7f34(gp) | v1 = *(gp);
| if (a0 == 0) {
0x004023a8 bnez a0, 0x4023b0 |
0x004023ac addiu v0, zero, 4 | v0 = 4;
| }
0x004023b0 sw v0, (v1) | *(v1) = v0;
0x004023b4 lui a1, 0x41 | a1 = 0x410000;
0x004023b8 addiu a0, zero, 2 | a0 = 2;
| /* str.Set_log_level_to:__d_n */
0x004023bc addiu a1, a1, 0x6f38 | a1 += 0x6f38;
0x004023c0 j 0x402444 | goto label_22;
0x004023c4 lw a2, (v1) | a2 = *(v1);
| }
0x004023c8 lw fp, (v1) | fp = *(v1);
0x004023cc lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x004023d0 move a0, fp | a0 = fp;
0x004023d4 jalr t9 | t9 ();
0x004023d8 move s1, v0 | s1 = v0;
0x004023dc sltiu v0, v0, 0x20 | v0 = (v0 < 0x20) ? 1 : 0;
0x004023e0 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == 0) {
0x004023e4 bnez v0, 0x40240c |
0x004023e8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004023ec lui a1, 0x41 | a1 = 0x410000;
0x004023f0 addiu a0, zero, 1 | a0 = 1;
| /* str.Set_TCP_host_to___s__fail:_too_long__d_ */
0x004023f4 addiu a1, a1, 0x6f7c | a1 += 0x6f7c;
0x004023f8 move a2, s0 | a2 = s0;
0x004023fc move a3, s1 | a3 = s1;
0x00402400 jalr t9 | t9 ();
0x00402404 j 0x402454 | goto label_20;
0x00402408 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x0040240c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00402410 move a2, s1 | a2 = s1;
0x00402414 move a0, s0 | a0 = s0;
0x00402418 move a1, fp | a1 = fp;
0x0040241c jalr t9 | t9 ();
0x00402420 lui a3, 0x43 | a3 = miio;
| /* obj.miio */
0x00402424 addiu a3, a3, -0x6dd0 |
0x00402428 addu s1, s1, a3 | s1 += a3;
0x0040242c lui a1, 0x41 | a1 = 0x410000;
0x00402430 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402434 addiu a0, zero, 2 | a0 = 2;
0x00402438 sb zero, 0x224(s1) | *((s1 + 548)) = 0;
| /* str.Set_TCP_host_to___s__n */
0x0040243c addiu a1, a1, 0x6fa4 | a1 += 0x6fa4;
0x00402440 move a2, s0 | a2 = s0;
| label_22:
0x00402444 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| label_25:
0x00402448 jalr t9 | t9 ();
0x0040244c nop |
0x00402450 lw gp, 0x28(sp) | gp = *(var_28h);
| label_20:
0x00402454 j 0x4020d0 | goto label_0;
0x00402458 lw t9, -0x7d00(gp) | t9 = sym.imp.getopt_long;
| label_18:
0x0040245c lui v0, 0x41 | v0 = 0x410000;
| label_19:
0x00402460 lw s0, -0x7e08(gp) | s0 = *((gp - 8066));
| /* str.Apr_12_2017 */
0x00402464 addiu v0, v0, 0x7074 | v0 += 0x7074;
0x00402468 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040246c lw t9, -0x7d68(gp) | t9 = sym.imp.fprintf
0x00402470 lw a0, (s0) | a0 = *(s0);
0x00402474 lui a1, 0x41 | a1 = 0x410000;
0x00402478 lui a2, 0x41 | a2 = 0x410000;
0x0040247c lui a3, 0x41 | a3 = 0x410000;
| /* str.miio_client_3.3.9 */
0x00402480 addiu a2, a2, 0x6fbc | a2 += 0x6fbc;
| /* str.miio_client___MIIO_OT_protocol_implementation_nCopyright__C__2015_2016_Xiaomi_nAuthor:_Yin_Kangkai__yinkangkai_xiaomi.com__nVersion:__s_nBuild_time:__s__s_n */
0x00402484 addiu a1, a1, 0x6fd0 | a1 += 0x6fd0;
| /* str.20:38:06 */
0x00402488 addiu a3, a3, 0x7068 | a3 += 0x7068;
0x0040248c jalr t9 | t9 ();
0x00402490 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402494 lw a1, (s0) | a1 = *(s0);
0x00402498 lw t9, -0x7e0c(gp) | t9 = sym.imp.fputc;
0x0040249c addiu a0, zero, 0xa | a0 = 0xa;
0x004024a0 jalr t9 | t9 ();
0x004024a4 lui a1, 0x41 | a1 = 0x410000;
0x004024a8 lw gp, 0x28(sp) | gp = *(var_28h);
0x004024ac lw a0, (s0) | a0 = *(s0);
0x004024b0 lw a2, (s4) | a2 = *(s4);
| /* str.Usage:__s_n_t__D___daemonize__n_t__H___host_host___enture_mutual_exclusion_with__C_you_can_only_use__C_or__H_at_the_same_time_n_t__p___port_port___n_t__i___interval_int__ms__set_sync_interval_of__otc.info_n_t__l___loglevel_level___set_loglevel__0_4___bigger__more_verbose_n_t__L___logfilefile__output_log_into_file_instead_of_stdout_n_t__d___datadir_path___set_miio_data_dir_path__ending_with___n_t__e___enckey__key_s__are_encrypted_saved_n_t__E___encdata__data_communication_are_encrypted_n_t__C___dcountry__set_the_country_domain_where_the_device_locates_in_ignore_if_it_in_China_n_t__h___help__n */
0x004024b4 addiu a1, a1, 0x7080 | a1 += 0x7080;
| label_23:
0x004024b8 lw t9, -0x7d68(gp) | t9 = sym.imp.fprintf
0x004024bc jalr t9 | t9 ();
0x004024c0 nop |
0x004024c4 lw gp, 0x28(sp) | gp = *(var_28h);
0x004024c8 addiu a0, zero, 1 | a0 = 1;
| do {
0x004024cc lw t9, -0x7e30(gp) | t9 = sym.imp.exit;
0x004024d0 jalr t9 | t9 ();
0x004024d4 nop |
| label_1:
0x004024d8 lw t9, -0x7d78(gp) | t9 = sym.imp.setsockopt;
0x004024dc addiu v0, zero, 4 | v0 = 4;
0x004024e0 sw v0, 0x10(sp) | *(var_10h) = v0;
0x004024e4 move a0, s1 | a0 = s1;
0x004024e8 ori a1, zero, 0xffff | a1 = 0xffff;
0x004024ec addiu a2, zero, 4 | a2 = 4;
0x004024f0 addiu a3, sp, 0xb0 | a3 = sp + 0xb0;
0x004024f4 jalr t9 | t9 ();
0x004024f8 move s3, v0 | s3 = v0;
0x004024fc lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 >= 0) {
0x00402500 bgez v0, 0x4026d0 | goto label_27;
| }
0x00402504 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402508 lui a1, 0x41 | a1 = 0x410000;
0x0040250c move a0, zero | a0 = 0;
| /* str.smart_conn_setsockopt_SO_REUSEADDR_:__m */
0x00402510 addiu a1, a1, 0x730c | a1 += 0x730c;
0x00402514 jalr t9 | t9 ();
0x00402518 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040251c move s1, s3 | s1 = s3;
| label_2:
0x00402520 sw s1, 0x2cc(s0) | *((s0 + 179)) = s1;
| if (s1 > 0) {
0x00402524 bgtz s1, 0x402760 | goto label_28;
| }
0x00402528 lui a1, 0x41 | a1 = 0x410000;
0x0040252c move a0, zero | a0 = 0;
| /* str.Quit__maybe_another_miio_client_is_already_running._n */
0x00402530 addiu a1, a1, 0x7358 | a1 += 0x7358;
| label_3:
0x00402534 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| label_4:
0x00402538 jalr t9 | t9 ();
0x0040253c nop |
0x00402540 lw gp, 0x28(sp) | gp = *(var_28h);
| label_24:
0x00402544 j 0x4024cc |
| } while (1);
0x00402548 addiu a0, zero, -1 | a0 = -1;
| label_12:
0x0040254c lui s1, 0x43 | s1 = 0x430000;
| /* obj.miio */
0x00402550 addiu s0, s1, -0x6dd0 | s0 = s1 + -0x6dd0;
0x00402554 lw v0, 0x1f8(s0) | v0 = *((s0 + 126));
0x00402558 lb v0, 0x224(s0) | v0 = *((s0 + 548));
| if (v0 != 0) {
0x0040255c bnel v0, zero, 0x402570 |
0x00402560 lui v0, 0x1b | v0 = 0x1b7740;
0x00402564 addiu v0, v0, 0x7740 |
0x00402568 sw v0, 0x1f8(s0) | *((s0 + 126)) = v0;
0x0040256c lb v0, 0x224(s0) | v0 = *((s0 + 548));
| }
0x00402570 lb v0, 0x244(s0) | v0 = *((s0 + 580));
| if (v0 != 0) {
0x00402574 bnel v0, zero, 0x4025c0 |
0x00402578 lui v1, 0x43 | v1 = 0x430000;
0x0040257c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x00402580 addiu v1, v1, -0x6bac | v1 += -0x6bac;
0x00402584 lui a1, 0x41 | a1 = 0x410000;
0x00402588 move a0, v1 | a0 = v1;
| /* str.ott.io.mi.com */
0x0040258c addiu a1, a1, 0x67a4 | a1 += 0x67a4;
0x00402590 addiu a2, zero, 0xd | a2 = 0xd;
0x00402594 jalr t9 | t9 ();
0x00402598 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040259c lui a1, 0x41 | a1 = 0x410000;
0x004025a0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004025a4 sb zero, 0x231(s0) | *((s0 + 561)) = 0;
0x004025a8 addiu a0, zero, 2 | a0 = 2;
| /* str.Set_TCP_host_to___s__n */
0x004025ac addiu a1, a1, 0x6fa4 | a1 += 0x6fa4;
0x004025b0 move a2, v0 | a2 = v0;
0x004025b4 jalr t9 | t9 ();
0x004025b8 lw gp, 0x28(sp) | gp = *(var_28h);
0x004025bc lb v0, 0x244(s0) | v0 = *((s0 + 580));
| }
0x004025c0 lw t9, -0x7d94(gp) | t9 = sym.imp.signal;
| if (v0 == 0) {
0x004025c4 bnez v0, 0x402610 |
0x004025c8 lui v0, 0x41 | v0 = 0x410000;
0x004025cc lw v1, 0x67b4(v0) | v1 = *((v0 + 6637));
0x004025d0 lui a2, 0x43 | a2 = 0x430000;
| /* str.ot.io.mi.com */
0x004025d4 addiu v0, v0, 0x67b4 | v0 += 0x67b4;
0x004025d8 sw v1, -0x6b8c(a2) | *((a2 - 6883)) = v1;
0x004025dc lw v1, 4(v0) | v1 = *((v0 + 1));
0x004025e0 lw v0, 8(v0) | v0 = *((v0 + 2));
0x004025e4 addiu a2, a2, -0x6b8c | a2 += -0x6b8c;
0x004025e8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004025ec lui a1, 0x41 | a1 = 0x410000;
0x004025f0 sw v1, 4(a2) | *((a2 + 1)) = v1;
0x004025f4 sw v0, 8(a2) | *((a2 + 2)) = v0;
0x004025f8 addiu a0, zero, 2 | a0 = 2;
0x004025fc sb zero, 0x250(s0) | *((s0 + 592)) = 0;
| /* str.Set_UDP_host_to___s__n */
0x00402600 addiu a1, a1, 0x72cc | a1 += 0x72cc;
0x00402604 jalr t9 | t9 ();
0x00402608 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040260c lw t9, -0x7d94(gp) | t9 = sym.imp.signal;
| }
0x00402610 lui a1, 0x40 | a1 = 0x400000;
0x00402614 addiu a0, zero, 2 | a0 = 2;
0x00402618 addiu a1, a1, 0x71b8 | a1 += 0x71b8;
0x0040261c jalr t9 | t9 ();
0x00402620 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402624 addiu a0, zero, 0xd | a0 = 0xd;
0x00402628 lw t9, -0x7d94(gp) | t9 = sym.imp.signal;
0x0040262c addiu a1, zero, 1 | a1 = 1;
0x00402630 jalr t9 | t9 ();
0x00402634 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402638 lw t9, -0x7f30(gp) | t9 = sym.otd_donot_trust_peer;
| /* obj.miio */
0x0040263c addiu a0, s1, -0x6dd0 | a0 = s1 + -0x6dd0;
0x00402640 jalr t9 | t9 ();
0x00402644 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 != 0) {
0x00402648 beqz v0, 0x402668 |
0x0040264c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402650 lui a1, 0x41 | a1 = 0x410000;
0x00402654 addiu a0, zero, 2 | a0 = 2;
| /* str.enauth:_0_n */
0x00402658 addiu a1, a1, 0x72e4 | a1 += 0x72e4;
0x0040265c jalr t9 | t9 ();
0x00402660 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402664 sb zero, 0x20b(s0) | *((s0 + 523)) = 0;
| }
0x00402668 lw t9, -0x7d2c(gp) | t9 = sym.imp.socket;
0x0040266c addiu v0, zero, 1 | v0 = 1;
0x00402670 sw v0, 0xb0(sp) | *(var_b0h) = v0;
0x00402674 addiu a0, zero, 2 | a0 = 2;
0x00402678 addiu a1, zero, 1 | a1 = 1;
0x0040267c move a2, zero | a2 = 0;
0x00402680 jalr t9 | t9 ();
0x00402684 move s1, v0 | s1 = v0;
0x00402688 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 >= 0) {
0x0040268c bgez v0, 0x4024d8 | goto label_1;
| }
0x00402690 lw t9, -0x7e2c(gp) | t9 = sym.imp.__errno_location;
0x00402694 jalr t9 | t9 ();
0x00402698 nop |
0x0040269c lw gp, 0x28(sp) | gp = *(var_28h);
0x004026a0 lw t9, -0x7cec(gp) | t9 = sym.imp.strerror;
0x004026a4 lw a0, (v0) | a0 = *(v0);
0x004026a8 jalr t9 | t9 ();
0x004026ac lw gp, 0x28(sp) | gp = *(var_28h);
0x004026b0 lui a1, 0x41 | a1 = 0x410000;
0x004026b4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004026b8 move a0, zero | a0 = 0;
| /* str.Create_socket_error:__s_n */
0x004026bc addiu a1, a1, 0x72f0 | a1 += 0x72f0;
0x004026c0 move a2, v0 | a2 = v0;
0x004026c4 jalr t9 | t9 ();
0x004026c8 j 0x402758 | goto label_29;
0x004026cc lw gp, 0x28(sp) | gp = *(var_28h);
| label_27:
0x004026d0 addiu v0, zero, 2 | v0 = 2;
0x004026d4 lw t9, -0x7d6c(gp) | t9 = sym.imp.bind;
0x004026d8 sh v0, 0x30(sp) | *(var_30h) = v0;
0x004026dc addiu v0, zero, 0x31d4 | v0 = 0x31d4;
0x004026e0 sw zero, 0x34(sp) | *(var_34h) = 0;
0x004026e4 sw zero, 0x38(sp) | *(var_38h) = 0;
0x004026e8 sw zero, 0x3c(sp) | *(var_3ch) = 0;
0x004026ec sh v0, 0x32(sp) | *(var_32h) = v0;
0x004026f0 move a0, s1 | a0 = s1;
0x004026f4 addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x004026f8 addiu a2, zero, 0x10 | a2 = 0x10;
0x004026fc jalr t9 | t9 ();
0x00402700 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 >= 0) {
0x00402704 bgez v0, 0x402520 | goto label_2;
| }
0x00402708 lw t9, -0x7e2c(gp) | t9 = sym.imp.__errno_location;
0x0040270c jalr t9 | t9 ();
0x00402710 nop |
0x00402714 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402718 lw t9, -0x7cec(gp) | t9 = sym.imp.strerror;
0x0040271c lw a0, (v0) | a0 = *(v0);
0x00402720 jalr t9 | t9 ();
0x00402724 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402728 lui a1, 0x41 | a1 = 0x410000;
0x0040272c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402730 move a0, zero | a0 = 0;
| /* str.Socket_bind_port___d__error:__s_n */
0x00402734 addiu a1, a1, 0x7334 | a1 += 0x7334;
0x00402738 ori a2, zero, 0xd431 | a2 = 0xd431;
0x0040273c move a3, v0 | a3 = v0;
0x00402740 jalr t9 | t9 ();
0x00402744 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402748 lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x0040274c move a0, s1 | a0 = s1;
0x00402750 jalr t9 | t9 ();
0x00402754 lw gp, 0x28(sp) | gp = *(var_28h);
| label_29:
0x00402758 j 0x402520 | goto label_2;
0x0040275c addiu s1, zero, -1 | s1 = -1;
| label_28:
0x00402760 addiu v0, zero, 1 | v0 = 1;
0x00402764 sw v0, 0xb0(sp) | *(var_b0h) = v0;
0x00402768 addiu a1, zero, -1 | a1 = -1;
0x0040276c move v0, zero | v0 = 0;
0x00402770 addiu v1, zero, 0x50 | v1 = 0x50;
| do {
0x00402774 addu a0, s0, v0 | a0 = s0 + v0;
0x00402778 addiu v0, v0, 4 | v0 += 4;
0x0040277c addiu s4, zero, -1 | s4 = -1;
0x00402780 sw a1, 0x198(a0) | *((a0 + 102)) = a1;
0x00402784 bne v0, v1, 0x402774 |
| } while (v0 != v1);
0x00402788 lw t9, -0x7d2c(gp) | t9 = sym.imp.socket;
0x0040278c addiu a0, zero, 2 | a0 = 2;
0x00402790 addiu a1, zero, 2 | a1 = 2;
0x00402794 move a2, zero | a2 = 0;
0x00402798 jalr t9 | t9 ();
0x0040279c move s3, v0 | s3 = v0;
0x004027a0 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x004027a4 bgez v0, 0x4027e8 |
0x004027a8 lw t9, -0x7e2c(gp) | t9 = sym.imp.__errno_location;
0x004027ac jalr t9 | t9 ();
0x004027b0 nop |
0x004027b4 lw gp, 0x28(sp) | gp = *(var_28h);
0x004027b8 lw t9, -0x7cec(gp) | t9 = sym.imp.strerror;
0x004027bc lw a0, (v0) | a0 = *(v0);
0x004027c0 jalr t9 | t9 ();
0x004027c4 lw gp, 0x28(sp) | gp = *(var_28h);
0x004027c8 lui a1, 0x41 | a1 = 0x410000;
0x004027cc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004027d0 move a0, zero | a0 = 0;
| /* str.Create_ot_server_socket_error:__s_n */
0x004027d4 addiu a1, a1, 0x7390 | a1 += 0x7390;
0x004027d8 move a2, v0 | a2 = v0;
0x004027dc jalr t9 | t9 ();
0x004027e0 j 0x40290c | goto label_30;
0x004027e4 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x004027e8 lw t9, -0x7d78(gp) | t9 = sym.imp.setsockopt;
0x004027ec addiu v0, zero, 4 | v0 = 4;
0x004027f0 addiu s5, sp, 0xb0 | s5 = sp + 0xb0;
0x004027f4 sw v0, 0x10(sp) | *(var_10h) = v0;
0x004027f8 move a0, s3 | a0 = s3;
0x004027fc ori a1, zero, 0xffff | a1 = 0xffff;
0x00402800 addiu a2, zero, 4 | a2 = 4;
0x00402804 move a3, s5 | a3 = s5;
0x00402808 jalr t9 | t9 ();
0x0040280c move s1, v0 | s1 = v0;
0x00402810 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00402814 bgez v0, 0x402844 |
0x00402818 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040281c lui a1, 0x41 | a1 = 0x410000;
0x00402820 move a0, zero | a0 = 0;
| /* str.OT_server_setsockopt_SO_REUSEADDR_:__m */
0x00402824 addiu a1, a1, 0x73b4 | a1 += 0x73b4;
0x00402828 jalr t9 | t9 ();
0x0040282c lw gp, 0x28(sp) | gp = *(var_28h);
0x00402830 lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x00402834 move a0, s3 | a0 = s3;
0x00402838 jalr t9 | t9 ();
0x0040283c j 0x402944 | goto label_31;
0x00402840 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00402844 lw t9, -0x7cd8(gp) | t9 = sym.imp.ioctl;
0x00402848 move a0, s3 | a0 = s3;
0x0040284c addiu a1, zero, 0x667e | a1 = 0x667e;
0x00402850 move a2, s5 | a2 = s5;
0x00402854 jalr t9 | t9 ();
0x00402858 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x0040285c bgez v0, 0x40287c |
0x00402860 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402864 lui a1, 0x41 | a1 = 0x410000;
0x00402868 move a0, zero | a0 = 0;
| /* str.ioctl_FIONBIO_failed:__m */
0x0040286c addiu a1, a1, 0x73dc | a1 += 0x73dc;
0x00402870 jalr t9 | t9 ();
0x00402874 j 0x4028fc | goto label_32;
0x00402878 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x0040287c addiu v0, zero, 2 | v0 = 2;
0x00402880 sh v0, 0x30(sp) | *(var_30h) = v0;
0x00402884 addiu v0, zero, 0x32d4 | v0 = 0x32d4;
0x00402888 sh v0, 0x32(sp) | *(var_32h) = v0;
0x0040288c lui v0, 0x100 | v0 = 0x1000000;
0x00402890 lw t9, -0x7d6c(gp) | t9 = sym.imp.bind;
0x00402894 addiu v0, v0, 0x7f | v0 += 0x7f;
0x00402898 sw zero, 0x38(sp) | *(var_38h) = 0;
0x0040289c sw zero, 0x3c(sp) | *(var_3ch) = 0;
0x004028a0 sw v0, 0x34(sp) | *(var_34h) = v0;
0x004028a4 move a0, s3 | a0 = s3;
0x004028a8 addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x004028ac addiu a2, zero, 0x10 | a2 = 0x10;
0x004028b0 jalr t9 | t9 ();
0x004028b4 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x004028b8 bgez v0, 0x402914 |
0x004028bc lw t9, -0x7e2c(gp) | t9 = sym.imp.__errno_location;
0x004028c0 jalr t9 | t9 ();
0x004028c4 nop |
0x004028c8 lw gp, 0x28(sp) | gp = *(var_28h);
0x004028cc lw t9, -0x7cec(gp) | t9 = sym.imp.strerror;
0x004028d0 lw a0, (v0) | a0 = *(v0);
0x004028d4 jalr t9 | t9 ();
0x004028d8 lw gp, 0x28(sp) | gp = *(var_28h);
0x004028dc lui a1, 0x41 | a1 = 0x410000;
0x004028e0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004028e4 move a0, zero | a0 = 0;
| /* str.Socket_bind_port___d__error:__s_n */
0x004028e8 addiu a1, a1, 0x7334 | a1 += 0x7334;
0x004028ec ori a2, zero, 0xd432 | a2 = 0xd432;
0x004028f0 move a3, v0 | a3 = v0;
0x004028f4 jalr t9 | t9 ();
0x004028f8 lw gp, 0x28(sp) | gp = *(var_28h);
| label_32:
0x004028fc lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x00402900 move a0, s3 | a0 = s3;
0x00402904 jalr t9 | t9 ();
0x00402908 lw gp, 0x28(sp) | gp = *(var_28h);
| label_30:
0x0040290c j 0x402950 | goto label_33;
0x00402910 addiu s1, zero, -1 | s1 = -1;
| }
0x00402914 lw t9, -0x7dc0(gp) | t9 = sym.imp.listen;
0x00402918 move a0, s3 | a0 = s3;
0x0040291c addiu a1, zero, 0x20 | a1 = 0x20;
0x00402920 jalr t9 | t9 ();
0x00402924 move s1, v0 | s1 = v0;
0x00402928 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == s4) {
0x0040292c bne v0, s4, 0x40294c |
0x00402930 lw t9, -0x7d10(gp) | t9 = sym.imp.perror;
0x00402934 lui a0, 0x41 | a0 = "listen";
| /* str.listen */
0x00402938 addiu a0, a0, 0x73f8 |
0x0040293c jalr t9 | t9 ();
0x00402940 lw gp, 0x28(sp) | gp = *(var_28h);
| label_31:
0x00402944 j 0x402954 | goto label_34;
0x00402948 sw s1, 0x2d0(s0) | *((s0 + 180)) = s1;
| }
0x0040294c move s1, s3 | s1 = s3;
| label_33:
0x00402950 sw s1, 0x2d0(s0) | *((s0 + 180)) = s1;
| label_34:
0x00402954 lw t9, -0x7d2c(gp) | t9 = sym.imp.socket;
| if (s1 <= 0) {
0x00402958 bgtz s1, 0x40296c |
0x0040295c lui a1, 0x41 | a1 = 0x410000;
0x00402960 move a0, zero | a0 = 0;
0x00402964 j 0x402534 | goto label_3;
| /* str.ot_agent_listenfd_fail__maybe_another_miio_client_is_already_running._n */
0x00402968 addiu a1, a1, 0x7400 | a1 += 0x7400;
| }
0x0040296c addiu v0, zero, 1 | v0 = 1;
0x00402970 addiu s4, zero, -1 | s4 = -1;
0x00402974 sw v0, 0xb0(sp) | *(var_b0h) = v0;
0x00402978 sw s4, 0x2dc(s0) | *((s0 + 183)) = s4;
0x0040297c addiu a0, zero, 2 | a0 = 2;
0x00402980 addiu a1, zero, 2 | a1 = 2;
0x00402984 move a2, zero | a2 = 0;
0x00402988 jalr t9 | t9 ();
0x0040298c move s3, v0 | s3 = v0;
0x00402990 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00402994 bgez v0, 0x4029d8 |
0x00402998 lw t9, -0x7e2c(gp) | t9 = sym.imp.__errno_location;
0x0040299c jalr t9 | t9 ();
0x004029a0 nop |
0x004029a4 lw gp, 0x28(sp) | gp = *(var_28h);
0x004029a8 lw t9, -0x7cec(gp) | t9 = sym.imp.strerror;
0x004029ac lw a0, (v0) | a0 = *(v0);
0x004029b0 jalr t9 | t9 ();
0x004029b4 lw gp, 0x28(sp) | gp = *(var_28h);
0x004029b8 lui a1, 0x41 | a1 = 0x410000;
0x004029bc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x004029c0 move a0, zero | a0 = 0;
| /* str.Create_bt_server_socket_error:__s_n */
0x004029c4 addiu a1, a1, 0x7448 | a1 += 0x7448;
0x004029c8 move a2, v0 | a2 = v0;
0x004029cc jalr t9 | t9 ();
0x004029d0 j 0x402afc | goto label_35;
0x004029d4 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x004029d8 lw t9, -0x7d78(gp) | t9 = sym.imp.setsockopt;
0x004029dc addiu v0, zero, 4 | v0 = 4;
0x004029e0 addiu s5, sp, 0xb0 | s5 = sp + 0xb0;
0x004029e4 sw v0, 0x10(sp) | *(var_10h) = v0;
0x004029e8 move a0, s3 | a0 = s3;
0x004029ec ori a1, zero, 0xffff | a1 = 0xffff;
0x004029f0 addiu a2, zero, 4 | a2 = 4;
0x004029f4 move a3, s5 | a3 = s5;
0x004029f8 jalr t9 | t9 ();
0x004029fc move s1, v0 | s1 = v0;
0x00402a00 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00402a04 bgez v0, 0x402a34 |
0x00402a08 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402a0c lui a1, 0x41 | a1 = 0x410000;
0x00402a10 move a0, zero | a0 = 0;
| /* str.BT_server_setsockopt_SO_REUSEADDR_:__m */
0x00402a14 addiu a1, a1, 0x746c | a1 += 0x746c;
0x00402a18 jalr t9 | t9 ();
0x00402a1c lw gp, 0x28(sp) | gp = *(var_28h);
0x00402a20 lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x00402a24 move a0, s3 | a0 = s3;
0x00402a28 jalr t9 | t9 ();
0x00402a2c j 0x402b34 | goto label_36;
0x00402a30 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00402a34 lw t9, -0x7cd8(gp) | t9 = sym.imp.ioctl;
0x00402a38 move a0, s3 | a0 = s3;
0x00402a3c addiu a1, zero, 0x667e | a1 = 0x667e;
0x00402a40 move a2, s5 | a2 = s5;
0x00402a44 jalr t9 | t9 ();
0x00402a48 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00402a4c bgez v0, 0x402a6c |
0x00402a50 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402a54 lui a1, 0x41 | a1 = 0x410000;
0x00402a58 move a0, zero | a0 = 0;
| /* str.ioctl_FIONBIO_failed:__m */
0x00402a5c addiu a1, a1, 0x73dc | a1 += 0x73dc;
0x00402a60 jalr t9 | t9 ();
0x00402a64 j 0x402aec | goto label_37;
0x00402a68 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00402a6c addiu v0, zero, 2 | v0 = 2;
0x00402a70 sh v0, 0x30(sp) | *(var_30h) = v0;
0x00402a74 addiu v0, zero, 0x33d4 | v0 = 0x33d4;
0x00402a78 sh v0, 0x32(sp) | *(var_32h) = v0;
0x00402a7c lui v0, 0x100 | v0 = 0x1000000;
0x00402a80 lw t9, -0x7d6c(gp) | t9 = sym.imp.bind;
0x00402a84 addiu v0, v0, 0x7f | v0 += 0x7f;
0x00402a88 sw zero, 0x38(sp) | *(var_38h) = 0;
0x00402a8c sw zero, 0x3c(sp) | *(var_3ch) = 0;
0x00402a90 sw v0, 0x34(sp) | *(var_34h) = v0;
0x00402a94 move a0, s3 | a0 = s3;
0x00402a98 addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x00402a9c addiu a2, zero, 0x10 | a2 = 0x10;
0x00402aa0 jalr t9 | t9 ();
0x00402aa4 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00402aa8 bgez v0, 0x402b04 |
0x00402aac lw t9, -0x7e2c(gp) | t9 = sym.imp.__errno_location;
0x00402ab0 jalr t9 | t9 ();
0x00402ab4 nop |
0x00402ab8 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402abc lw t9, -0x7cec(gp) | t9 = sym.imp.strerror;
0x00402ac0 lw a0, (v0) | a0 = *(v0);
0x00402ac4 jalr t9 | t9 ();
0x00402ac8 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402acc lui a1, 0x41 | a1 = 0x410000;
0x00402ad0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402ad4 move a0, zero | a0 = 0;
| /* str.Socket_bind_port___d__error:__s_n */
0x00402ad8 addiu a1, a1, 0x7334 | a1 += 0x7334;
0x00402adc ori a2, zero, 0xd433 | a2 = 0xd433;
0x00402ae0 move a3, v0 | a3 = v0;
0x00402ae4 jalr t9 | t9 ();
0x00402ae8 lw gp, 0x28(sp) | gp = *(var_28h);
| label_37:
0x00402aec lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x00402af0 move a0, s3 | a0 = s3;
0x00402af4 jalr t9 | t9 ();
0x00402af8 lw gp, 0x28(sp) | gp = *(var_28h);
| label_35:
0x00402afc j 0x402b40 | goto label_38;
0x00402b00 addiu s1, zero, -1 | s1 = -1;
| }
0x00402b04 lw t9, -0x7dc0(gp) | t9 = sym.imp.listen;
0x00402b08 move a0, s3 | a0 = s3;
0x00402b0c addiu a1, zero, 0x20 | a1 = 0x20;
0x00402b10 jalr t9 | t9 ();
0x00402b14 move s1, v0 | s1 = v0;
0x00402b18 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == s4) {
0x00402b1c bne v0, s4, 0x402b3c |
0x00402b20 lw t9, -0x7d10(gp) | t9 = sym.imp.perror;
0x00402b24 lui a0, 0x41 | a0 = "listen";
| /* str.listen */
0x00402b28 addiu a0, a0, 0x73f8 |
0x00402b2c jalr t9 | t9 ();
0x00402b30 lw gp, 0x28(sp) | gp = *(var_28h);
| label_36:
0x00402b34 j 0x402b44 | goto label_39;
0x00402b38 sw s1, 0x2d8(s0) | *((s0 + 182)) = s1;
| }
0x00402b3c move s1, s3 | s1 = s3;
| label_38:
0x00402b40 sw s1, 0x2d8(s0) | *((s0 + 182)) = s1;
| label_39:
0x00402b44 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (s1 <= 0) {
0x00402b48 bgtz s1, 0x402b5c |
0x00402b4c lui a1, 0x41 | a1 = 0x410000;
0x00402b50 move a0, zero | a0 = 0;
0x00402b54 j 0x402538 | goto label_4;
| /* str.bt_conn_listenfd_fail__maybe_another_miio_client_is_already_running._n */
0x00402b58 addiu a1, a1, 0x7494 | a1 += 0x7494;
| }
0x00402b5c lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402b60 lw a2, 0x2cc(s0) | a2 = *((s0 + 179));
0x00402b64 sll v0, v0, 3 | v0 <<= 3;
0x00402b68 addu v0, v0, s0 | v0 += s0;
0x00402b6c addiu s1, zero, 1 | s1 = 1;
0x00402b70 lui a1, 0x41 | a1 = 0x410000;
0x00402b74 sw a2, 4(v0) | *((v0 + 1)) = a2;
0x00402b78 sh s1, 8(v0) | *((v0 + 4)) = s1;
0x00402b7c addiu a0, zero, 2 | a0 = 2;
| /* str.OT_smart_conn_sockfd:__d_n */
0x00402b80 addiu a1, a1, 0x74dc | a1 += 0x74dc;
0x00402b84 jalr t9 | t9 ();
0x00402b88 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402b8c lw gp, 0x28(sp) | gp = *(var_28h);
0x00402b90 addiu v0, v0, 1 | v0++;
0x00402b94 lw a2, 0x2d0(s0) | a2 = *((s0 + 180));
0x00402b98 sw v0, 0x194(s0) | *((s0 + 101)) = v0;
0x00402b9c sll v0, v0, 3 | v0 <<= 3;
0x00402ba0 addu v0, v0, s0 | v0 += s0;
0x00402ba4 lui a1, 0x41 | a1 = 0x410000;
0x00402ba8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402bac sw a2, 4(v0) | *((v0 + 1)) = a2;
0x00402bb0 sh s1, 8(v0) | *((v0 + 4)) = s1;
0x00402bb4 addiu a0, zero, 2 | a0 = 2;
| /* str.OT_agent_listen_fd:__d_n */
0x00402bb8 addiu a1, a1, 0x74f8 | a1 += 0x74f8;
0x00402bbc jalr t9 | t9 ();
0x00402bc0 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402bc4 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402bc8 addiu v0, v0, 1 | v0++;
0x00402bcc lw a2, 0x2d8(s0) | a2 = *((s0 + 182));
0x00402bd0 sw v0, 0x194(s0) | *((s0 + 101)) = v0;
0x00402bd4 sll v0, v0, 3 | v0 <<= 3;
0x00402bd8 addu v0, v0, s0 | v0 += s0;
0x00402bdc lui a1, 0x41 | a1 = 0x410000;
0x00402be0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402be4 sw a2, 4(v0) | *((v0 + 1)) = a2;
0x00402be8 sh s1, 8(v0) | *((v0 + 4)) = s1;
0x00402bec addiu a0, zero, 2 | a0 = 2;
| /* str.BT_conn_listen_fd:__d_n */
0x00402bf0 addiu a1, a1, 0x7510 | a1 += 0x7510;
0x00402bf4 jalr t9 | t9 ();
0x00402bf8 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402bfc lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402c00 lw t9, -0x7f2c(gp) | t9 = sym.timer_setup;
0x00402c04 addiu v0, v0, 1 | v0++;
0x00402c08 sw v0, 0x194(s0) | *((s0 + 101)) = v0;
0x00402c0c jalr t9 | t9 ();
0x00402c10 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402c14 sw v0, 0x1f0(s0) | *((s0 + 124)) = v0;
| if (v0 <= 0) {
0x00402c18 bgtz v0, 0x402c34 |
0x00402c1c lui a0, 0x41 | a0 = 0x410000;
0x00402c20 lui a1, 0x41 | a1 = 0x410000;
| /* str.miio.timerfd___0 */
0x00402c24 addiu a0, a0, 0x7528 | a0 += 0x7528;
| /* str.miio_client.c */
0x00402c28 addiu a1, a1, 0x5028 | a1 += 0x5028;
0x00402c2c j 0x402d34 | goto label_40;
0x00402c30 addiu a2, zero, 0xfbe | a2 = 0xfbe;
| }
0x00402c34 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00402c38 move a0, v0 | a0 = v0;
0x00402c3c addiu a1, zero, 0x1388 | a1 = 0x1388;
0x00402c40 addiu a2, zero, 0x1388 | a2 = 0x1388;
0x00402c44 jalr t9 | t9 ();
0x00402c48 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402c4c lw gp, 0x28(sp) | gp = *(var_28h);
0x00402c50 lw a2, 0x1f0(s0) | a2 = *((s0 + 124));
0x00402c54 sll v0, v0, 3 | v0 <<= 3;
0x00402c58 addu v0, v0, s0 | v0 += s0;
0x00402c5c lui a1, 0x41 | a1 = 0x410000;
0x00402c60 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402c64 sw a2, 4(v0) | *((v0 + 1)) = a2;
0x00402c68 sh s1, 8(v0) | *((v0 + 4)) = s1;
0x00402c6c addiu a0, zero, 2 | a0 = 2;
| /* str.Timer_fd:__d__interval:__d_ms_n */
0x00402c70 addiu a1, a1, 0x753c | a1 += 0x753c;
0x00402c74 addiu a3, zero, 0x1388 | a3 = 0x1388;
0x00402c78 jalr t9 | t9 ();
0x00402c7c lw gp, 0x28(sp) | gp = *(var_28h);
0x00402c80 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402c84 lw t9, -0x7f2c(gp) | t9 = sym.timer_setup;
0x00402c88 addiu v0, v0, 1 | v0++;
0x00402c8c sw v0, 0x194(s0) | *((s0 + 101)) = v0;
0x00402c90 jalr t9 | t9 ();
0x00402c94 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402c98 sw v0, 0x1f4(s0) | *((s0 + 125)) = v0;
| if (v0 <= 0) {
0x00402c9c bgtz v0, 0x402cb8 |
0x00402ca0 lui a0, 0x41 | a0 = 0x410000;
0x00402ca4 lui a1, 0x41 | a1 = 0x410000;
| /* str.miio.sync_timerfd___0 */
0x00402ca8 addiu a0, a0, 0x755c | a0 += 0x755c;
| /* str.miio_client.c */
0x00402cac addiu a1, a1, 0x5028 | a1 += 0x5028;
0x00402cb0 j 0x402d34 | goto label_40;
0x00402cb4 addiu a2, zero, 0xfc7 | a2 = 0xfc7;
| }
0x00402cb8 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00402cbc move a0, v0 | a0 = v0;
0x00402cc0 move a1, zero | a1 = 0;
0x00402cc4 move a2, zero | a2 = 0;
0x00402cc8 jalr t9 | t9 ();
0x00402ccc lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402cd0 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402cd4 lw a2, 0x1f4(s0) | a2 = *((s0 + 125));
0x00402cd8 sll v0, v0, 3 | v0 <<= 3;
0x00402cdc addu v0, v0, s0 | v0 += s0;
0x00402ce0 lui a1, 0x41 | a1 = 0x410000;
0x00402ce4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402ce8 sw a2, 4(v0) | *((v0 + 1)) = a2;
0x00402cec sh s1, 8(v0) | *((v0 + 4)) = s1;
0x00402cf0 addiu a0, zero, 2 | a0 = 2;
| /* str.Sync_timer_fd:__d__interval:_0_ms_n */
0x00402cf4 addiu a1, a1, 0x7574 | a1 += 0x7574;
0x00402cf8 jalr t9 | t9 ();
0x00402cfc lw gp, 0x28(sp) | gp = *(var_28h);
0x00402d00 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402d04 lw t9, -0x7f2c(gp) | t9 = sym.timer_setup;
0x00402d08 addiu v0, v0, 1 | v0++;
0x00402d0c sw v0, 0x194(s0) | *((s0 + 101)) = v0;
0x00402d10 jalr t9 | t9 ();
0x00402d14 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402d18 sw v0, 0x1fc(s0) | *((s0 + 127)) = v0;
| if (v0 <= 0) {
0x00402d1c bgtz v0, 0x402d44 |
0x00402d20 lui a0, 0x41 | a0 = 0x410000;
0x00402d24 lui a1, 0x41 | a1 = 0x410000;
| /* str.miio.ack_timerfd___0 */
0x00402d28 addiu a0, a0, 0x7598 | a0 += 0x7598;
| /* str.miio_client.c */
0x00402d2c addiu a1, a1, 0x5028 | a1 += 0x5028;
0x00402d30 addiu a2, zero, 0xfd0 | a2 = 0xfd0;
| label_40:
0x00402d34 lui a3, 0x41 | a3 = 0x410000;
0x00402d38 lw t9, -0x7e4c(gp) | t9 = sym.imp.__assert;
| /* str.main */
0x00402d3c addiu a3, a3, 0x7e50 | a3 += 0x7e50;
0x00402d40 jalr t9 | t9 ();
| }
0x00402d44 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00402d48 move a0, v0 | a0 = v0;
0x00402d4c move a1, zero | a1 = 0;
0x00402d50 move a2, zero | a2 = 0;
0x00402d54 jalr t9 | t9 ();
0x00402d58 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402d5c lw gp, 0x28(sp) | gp = *(var_28h);
0x00402d60 lw a2, 0x1fc(s0) | a2 = *((s0 + 127));
0x00402d64 sll v0, v0, 3 | v0 <<= 3;
0x00402d68 addu v0, v0, s0 | v0 += s0;
0x00402d6c lui a1, 0x41 | a1 = 0x410000;
0x00402d70 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402d74 sh s1, 8(v0) | *((v0 + 4)) = s1;
0x00402d78 sw a2, 4(v0) | *((v0 + 1)) = a2;
0x00402d7c addiu a0, zero, 2 | a0 = 2;
| /* str.ACK_timer_fd:__d__timeout:_0_ms_n */
0x00402d80 addiu a1, a1, 0x75b0 | a1 += 0x75b0;
0x00402d84 jalr t9 | t9 ();
0x00402d88 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402d8c lw gp, 0x28(sp) | gp = *(var_28h);
0x00402d90 addiu v0, v0, 1 | v0++;
0x00402d94 sw v0, 0x194(s0) | *((s0 + 101)) = v0;
0x00402d98 slti v0, v0, 0x32 | v0 = (v0 < 0x32) ? 1 : 0;
0x00402d9c move s1, zero | s1 = 0;
| if (v0 == 0) {
0x00402da0 bnez v0, 0x402dcc |
0x00402da4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402da8 lui a1, 0x41 | a1 = 0x410000;
0x00402dac lui a2, 0x41 | a2 = 0x410000;
0x00402db0 move a0, zero | a0 = 0;
| /* str._s___d:_too_many_sockets_to_track_n */
0x00402db4 addiu a1, a1, 0x5dec | a1 += 0x5dec;
| /* str.miio_client.c */
0x00402db8 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x00402dbc addiu a3, zero, 0xfe7 | a3 = 0xfe7;
0x00402dc0 jalr t9 | t9 ();
0x00402dc4 j 0x403f20 | goto label_41;
0x00402dc8 addiu v0, zero, -1 | v0 = -1;
| }
0x00402dcc lui s3, 0x41 | s3 = 0x410000;
0x00402dd0 move s4, s0 | s4 = s0;
| /* str.pollfds__d_:__d_n */
0x00402dd4 addiu s3, s3, 0x5ca0 | s3 += 0x5ca0;
| do {
0x00402dd8 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402ddc slt v0, s1, v0 | v0 = (s1 < v0) ? 1 : 0;
0x00402de0 sll v0, s1, 3 | v0 = s1 << 3;
| if (v0 == 0) {
0x00402de4 beqz v0, 0x402e10 | goto label_42;
| }
0x00402de8 addu v0, s4, v0 | v0 = s4 + v0;
0x00402dec lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402df0 lw a3, 4(v0) | a3 = *((v0 + 1));
0x00402df4 move a2, s1 | a2 = s1;
0x00402df8 addiu a0, zero, 2 | a0 = 2;
0x00402dfc move a1, s3 | a1 = s3;
0x00402e00 jalr t9 | t9 ();
0x00402e04 addiu s1, s1, 1 | s1++;
0x00402e08 j 0x402dd8 |
| } while (1);
0x00402e0c lw gp, 0x28(sp) | gp = *(var_28h);
| label_42:
0x00402e10 lui s7, 0x43 | s7 = 0x430000;
| if (s2 != 0) {
0x00402e14 beqz s2, 0x402e4c |
0x00402e18 lw t9, -0x7e40(gp) | t9 = sym.imp.daemon;
0x00402e1c move a0, zero | a0 = 0;
0x00402e20 addiu a1, zero, 1 | a1 = 1;
0x00402e24 jalr t9 | t9 ();
0x00402e28 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00402e2c bgez v0, 0x402e48 |
0x00402e30 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402e34 lui a1, 0x41 | a1 = 0x410000;
0x00402e38 addiu a0, zero, 1 | a0 = 1;
| /* str.daemonize_fail:__m_n */
0x00402e3c addiu a1, a1, 0x75d4 | a1 += 0x75d4;
0x00402e40 jalr t9 | t9 ();
0x00402e44 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00402e48 lui s7, 0x43 | s7 = 0x430000;
| }
| /* obj.miio */
0x00402e4c addiu s2, s7, -0x6dd0 | s2 = s7 + -0x6dd0;
0x00402e50 move s1, s2 | s1 = s2;
0x00402e54 move s5, s2 | s5 = s2;
0x00402e58 lbu v0, 0x20a(s0) | v0 = *((s0 + 522));
| do {
| label_5:
0x00402e5c lw t9, -0x7df0(gp) | t9 = sym.imp.poll;
| if (v0 != 0) {
0x00402e60 bnez v0, 0x403eb0 | goto label_43;
| }
0x00402e64 lui v0, 0x43 | v0 = 0x430000;
0x00402e68 lw a1, 0x194(s0) | a1 = *((s0 + 101));
0x00402e6c addiu a0, v0, -0x6dcc | a0 = v0 + -0x6dcc;
0x00402e70 addiu a2, zero, 0x64 | a2 = 0x64;
0x00402e74 jalr t9 | t9 ();
0x00402e78 move s3, v0 | s3 = v0;
0x00402e7c lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00402e80 bgez v0, 0x402e9c |
0x00402e84 lw t9, -0x7d10(gp) | t9 = sym.imp.perror;
0x00402e88 lui a0, 0x41 | a0 = "poll";
| /* str.poll */
0x00402e8c addiu a0, a0, 0x75e8 |
0x00402e90 jalr t9 | t9 ();
0x00402e94 j 0x403eb0 | goto label_43;
0x00402e98 nop |
| }
0x00402e9c beql v0, zero, 0x402e5c |
| } while (v0 == 0);
0x00402ea0 lbu v0, 0x20a(s0) | v0 = *((s0 + 522));
0x00402ea4 move s4, s0 | s4 = s0;
0x00402ea8 sw zero, 0xbc(sp) | *(var_bch) = 0;
| label_11:
0x00402eac lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402eb0 lw v1, 0xbc(sp) | v1 = *(var_bch);
0x00402eb4 slt v0, v1, v0 | v0 = (v1 < v0) ? 1 : 0;
| if (v0 == 0) {
0x00402eb8 beql v0, zero, 0x402e5c | goto label_5;
| }
0x00402ebc lbu v0, 0x20a(s0) | v0 = *((s0 + 522));
| if (s3 == 0) {
0x00402ec0 beql s3, zero, 0x402e5c | goto label_5;
| }
0x00402ec4 lbu v0, 0x20a(s0) | v0 = *((s0 + 522));
0x00402ec8 lh v1, 0xa(s4) | v1 = *((s4 + 5));
0x00402ecc andi v0, v1, 0xffff | v0 = v1 & 0xffff;
0x00402ed0 andi a0, v0, 0x38 | a0 = v0 & 0x38;
| if (a0 == 0) {
0x00402ed4 beql a0, zero, 0x402f5c | goto label_44;
| }
0x00402ed8 andi v1, v0, 1 | v1 = v0 & 1;
0x00402edc sw v1, 0x10(sp) | *(var_10h) = v1;
0x00402ee0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00402ee4 lui a1, 0x41 | a1 = 0x410000;
0x00402ee8 lw a2, 0xbc(sp) | a2 = *(var_bch);
0x00402eec lw a3, 4(s4) | a3 = *((s4 + 1));
0x00402ef0 addiu a0, zero, 1 | a0 = 1;
| /* str.POLLNVAL__POLLHUP__POLLERR_fd:_pollfds__d_:__d__revents:_0x_08x_n */
0x00402ef4 addiu a1, a1, 0x75f0 | a1 += 0x75f0;
0x00402ef8 jalr t9 | t9 ();
0x00402efc lw a0, 4(s4) | a0 = *((s4 + 1));
0x00402f00 lw v0, 0x2c0(s0) | v0 = *((s0 + 176));
0x00402f04 lw gp, 0x28(sp) | gp = *(var_28h);
| if (a0 == v0) {
0x00402f08 beq a0, v0, 0x40387c | goto label_45;
| }
0x00402f0c lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x00402f10 jalr t9 | t9 ();
0x00402f14 nop |
0x00402f18 lw gp, 0x28(sp) | gp = *(var_28h);
0x00402f1c lw v1, 0xbc(sp) | v1 = *(var_bch);
0x00402f20 move a0, zero | a0 = 0;
| do {
0x00402f24 lw v0, 0x194(s0) | v0 = *((s0 + 101));
0x00402f28 slt a1, v1, v0 | a1 = (v1 < v0) ? 1 : 0;
0x00402f2c addiu a0, a0, 8 | a0 += 8;
| if (a1 == 0) {
0x00402f30 beqz a1, 0x402f50 | goto label_46;
| }
0x00402f34 addu v0, s4, a0 | v0 = s4 + a0;
0x00402f38 lw a1, 4(v0) | a1 = *((v0 + 1));
0x00402f3c addiu v1, v1, 1 | v1++;
0x00402f40 sw a1, -4(v0) | *((v0 - 1)) = a1;
0x00402f44 lw a1, 8(v0) | a1 = *((v0 + 2));
0x00402f48 j 0x402f24 |
| } while (1);
0x00402f4c sw a1, (v0) | *(v0) = a1;
| label_46:
0x00402f50 addiu v0, v0, -1 | v0 += -1;
0x00402f54 j 0x403e98 | goto label_47;
0x00402f58 sw v0, 0x194(s0) | *((s0 + 101)) = v0;
| label_44:
0x00402f5c andi v0, v0, 4 | v0 &= 4;
| if (v1 == 0) {
0x00402f60 beqz v1, 0x403bcc | goto label_48;
| }
0x00402f64 lw s6, 4(s4) | s6 = *((s4 + 1));
0x00402f68 lw v0, 0x1f0(s0) | v0 = *((s0 + 124));
0x00402f6c lw v0, 0x1f4(s0) | v0 = *((s0 + 125));
| if (s6 != v0) {
0x00402f70 bnel s6, v0, 0x4037ac |
0x00402f74 move v1, zero | v1 = 0;
0x00402f78 lw t9, -0x7d98(gp) | t9 = sym.imp.read;
0x00402f7c move v0, zero | v0 = 0;
0x00402f80 sw v1, 0xb4(sp) | *(var_b4h) = v1;
0x00402f84 sw v0, 0xb0(sp) | *(var_b0h) = v0;
0x00402f88 move a0, s6 | a0 = s6;
0x00402f8c addiu a1, sp, 0xb0 | a1 = sp + 0xb0;
0x00402f90 addiu a2, zero, 8 | a2 = 8;
0x00402f94 jalr t9 | t9 ();
0x00402f98 lw v0, -0x6dd0(s7) | v0 = *((s7 - 7028));
0x00402f9c sltiu v1, v0, 0xa | v1 = (v0 < 0xa) ? 1 : 0;
0x00402fa0 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v1 == 0) {
0x00402fa4 beqz v1, 0x403e98 | goto label_47;
| }
0x00402fa8 sll v1, v0, 2 | v1 = v0 << 2;
0x00402fac lui v0, 0x41 | v0 = 0x417a84;
0x00402fb0 addiu v0, v0, 0x7a84 |
0x00402fb4 addu v0, v0, v1 | v0 += v1;
0x00402fb8 lw v0, (v0) | v0 = *(v0);
0x00402fbc jr v0 | v0 ();
0x00402fc0 nop |
| }
0x004037ac lw v0, 0x1fc(s0) | v0 = *((s0 + 127));
| if (s6 != v0) {
0x004037b0 bnel s6, v0, 0x4038b0 |
0x004037b4 move v1, zero | v1 = 0;
0x004037b8 lw t9, -0x7d98(gp) | t9 = sym.imp.read;
0x004037bc move v0, zero | v0 = 0;
0x004037c0 sw v1, 0x34(sp) | *(var_34h) = v1;
0x004037c4 sw v0, 0x30(sp) | *(var_30h) = v0;
0x004037c8 move a0, s6 | a0 = s6;
0x004037cc addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x004037d0 addiu a2, zero, 8 | a2 = 8;
0x004037d4 jalr t9 | t9 ();
0x004037d8 lw v0, -0x6dd0(s7) | v0 = *((s7 - 7028));
0x004037dc addiu v1, zero, 7 | v1 = 7;
0x004037e0 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 != v1) {
0x004037e4 beq v0, v1, 0x4037fc |
0x004037e8 addiu v1, zero, 8 | v1 = 8;
| if (v0 == v1) {
0x004037ec beq v0, v1, 0x4038a0 | goto label_49;
| }
0x004037f0 nop |
0x004037f4 j 0x403e9c | goto label_50;
0x004037f8 addiu s3, s3, -1 | s3 += -1;
| }
0x004037fc lw t9, -0x7fcc(gp) | t9 = sym.timestamp;
0x00403800 jalr t9 | t9 ();
0x00403804 nop |
0x00403808 lw v1, 0x210(s0) | v1 = *((s0 + 132));
0x0040380c subu v0, v0, v1 | __asm ("subu v0, v0, v1");
0x00403810 sltiu v0, v0, 0xa | v0 = (v0 < 0xa) ? 1 : 0;
0x00403814 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == 0) {
0x00403818 bnez v0, 0x40388c |
0x0040381c lw v0, 0x218(s0) | v0 = *((s0 + 134));
0x00403820 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403824 addiu v0, v0, 1 | v0++;
0x00403828 lui a1, 0x41 | a1 = 0x410000;
0x0040382c lui fp, 0x41 | fp = 0x410000;
0x00403830 sw v0, 0x218(s0) | *((s0 + 134)) = v0;
0x00403834 addiu a0, zero, 3 | a0 = 3;
0x00403838 sw v0, 0x10(sp) | *(var_10h) = v0;
| /* str._s__d:_server_noack:__d_n */
0x0040383c addiu a1, a1, 0x77b8 | a1 += 0x77b8;
| /* str.sync_timer_handler */
0x00403840 addiu a2, fp, 0x7d28 | a2 = fp + 0x7d28;
0x00403844 addiu a3, zero, 0xe00 | a3 = 0xe00;
0x00403848 jalr t9 | t9 ();
0x0040384c lw v0, 0x218(s0) | v0 = *((s0 + 134));
0x00403850 slti v0, v0, 3 | v0 = (v0 < 3) ? 1 : 0;
0x00403854 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 != 0) {
0x00403858 bnez v0, 0x40388c | goto label_51;
| }
0x0040385c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403860 lui a1, 0x41 | a1 = 0x410000;
0x00403864 sw zero, 0x218(s0) | *((s0 + 134)) = 0;
0x00403868 addiu a0, zero, 3 | a0 = 3;
| /* str._s__d:_otc_close_and_retry_n */
0x0040386c addiu a1, a1, 0x77d4 | a1 += 0x77d4;
| /* str.sync_timer_handler */
0x00403870 addiu a2, fp, 0x7d28 | a2 = fp + 0x7d28;
0x00403874 addiu a3, zero, 0xe03 | a3 = 0xe03;
0x00403878 jalr t9 | t9 ();
| label_45:
0x0040387c jal 0x40989c | fcn_0040989c ();
0x00403880 nop |
0x00403884 j 0x403e98 | goto label_47;
0x00403888 lw gp, 0x28(sp) | gp = *(var_28h);
| }
| label_51:
0x0040388c lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00403890 lw a0, 0x1f4(s2) | a0 = *((s2 + 125));
0x00403894 addiu a1, zero, 0x1388 | a1 = 0x1388;
0x00403898 move a2, zero | a2 = 0;
0x0040389c jalr t9 | t9 ();
| label_49:
0x004038a0 jal 0x40709c | fcn_0040709c ();
0x004038a4 nop |
0x004038a8 j 0x403e98 | goto label_47;
0x004038ac lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x004038b0 lw v0, 0x2cc(s0) | v0 = *((s0 + 179));
| if (s6 != v0) {
0x004038b4 bnel s6, v0, 0x4038c8 |
0x004038b8 move a0, s6 | a0 = s6;
0x004038bc jal 0x40a590 | fcn_0040a590 ();
0x004038c0 j 0x403e98 | goto label_47;
0x004038c4 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x004038c8 lw v0, 0x2c0(s0) | v0 = *((s0 + 176));
| if (s6 != v0) {
0x004038cc bnel s6, v0, 0x4038e0 |
0x004038d0 move a0, s6 | a0 = s6;
0x004038d4 jal 0x406208 | fcn_00406208 ();
0x004038d8 j 0x403e98 | goto label_47;
0x004038dc lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x004038e0 lw v0, 0x2d0(s0) | v0 = *((s0 + 180));
| if (s6 != v0) {
0x004038e4 bnel s6, v0, 0x4038f8 |
0x004038e8 move a0, s6 | a0 = s6;
0x004038ec jal 0x409bf8 | fcn_00409bf8 ();
0x004038f0 j 0x403e98 | goto label_47;
0x004038f4 lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x004038f8 lw v0, 0x2d8(s2) | v0 = *((s2 + 182));
| if (s6 == v0) {
0x004038fc bnel s6, v0, 0x403a54 | goto label_52;
| }
0x00403900 addiu v1, sp, 0xb0 | v1 = sp + 0xb0;
0x00403904 addiu v0, zero, 0x80 | v0 = 0x80;
0x00403908 sw v1, 0xb8(sp) | *(var_b8h) = v1;
0x0040390c addiu v1, sp, 0x30 | v1 = sp + 0x30;
0x00403910 sw v0, 0xb0(sp) | *(var_b0h) = v0;
0x00403914 sw v1, 0xc0(sp) | *(var_c0h) = v1;
| do {
0x00403918 lw t9, -0x7d54(gp) | t9 = sym.imp.accept;
0x0040391c move a0, s6 | a0 = s6;
0x00403920 addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x00403924 addiu a2, sp, 0xb0 | a2 = sp + 0xb0;
0x00403928 jalr t9 | t9 ();
0x0040392c lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00403930 bgez v0, 0x403984 |
0x00403934 lw t9, -0x7e2c(gp) | t9 = sym.imp.__errno_location;
0x00403938 jalr t9 | t9 ();
0x0040393c nop |
0x00403940 lw a0, (v0) | a0 = *(v0);
0x00403944 addiu v0, zero, 0xb | v0 = 0xb;
0x00403948 lw gp, 0x28(sp) | gp = *(var_28h);
| if (a0 == v0) {
0x0040394c beq a0, v0, 0x403e98 | goto label_47;
| }
0x00403950 lw t9, -0x7d10(gp) | t9 = sym.imp.perror;
0x00403954 lui a0, 0x41 | a0 = "accept";
| /* str.accept */
0x00403958 addiu a0, a0, 0x77f0 |
0x0040395c jalr t9 | t9 ();
0x00403960 lui a1, 0x41 | a1 = 0x410000;
0x00403964 lui a2, 0x41 | a2 = 0x410000;
0x00403968 lw gp, 0x28(sp) | gp = *(var_28h);
0x0040396c sw s6, 0x10(sp) | *(var_10h) = s6;
0x00403970 move a0, zero | a0 = 0;
| /* str._s___d:_accept_error__listenfd:__d._n */
0x00403974 addiu a1, a1, 0x77f8 | a1 += 0x77f8;
| /* str.miio_client.c */
0x00403978 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x0040397c j 0x403afc | goto label_53;
0x00403980 addiu a3, zero, 0x956 | a3 = 0x956;
| }
0x00403984 lw a0, 0x194(s2) | a0 = *((s2 + 101));
0x00403988 slti a1, a0, 0x32 | a1 = (a0 < 0x32) ? 1 : 0;
0x0040398c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (a1 == 0) {
0x00403990 bnez a1, 0x4039c0 |
0x00403994 lui a1, 0x41 | a1 = 0x410000;
0x00403998 lui a2, 0x41 | a2 = 0x410000;
0x0040399c move a0, zero | a0 = 0;
| /* str._s___d:_too_many_sockets_to_track_n */
0x004039a0 addiu a1, a1, 0x5dec | a1 += 0x5dec;
| /* str.miio_client.c */
0x004039a4 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x004039a8 addiu a3, zero, 0x95d | a3 = 0x95d;
0x004039ac jalr t9 | t9 ();
0x004039b0 addiu v0, zero, 1 | v0 = 1;
0x004039b4 lw gp, 0x28(sp) | gp = *(var_28h);
0x004039b8 j 0x403e98 | goto label_47;
0x004039bc sb v0, 0x20a(s5) | *((s5 + 522)) = v0;
| }
0x004039c0 sll a0, a0, 3 | a0 <<= 3;
0x004039c4 addu a0, a0, s1 | a0 += s1;
0x004039c8 addiu fp, zero, 1 | fp = 1;
0x004039cc lui a1, 0x41 | a1 = 0x410000;
0x004039d0 sw v0, 4(a0) | *((a0 + 1)) = v0;
0x004039d4 sh fp, 8(a0) | *((a0 + 4)) = fp;
| /* str.OT_agent_listen_accept_sockfd:__d_n */
0x004039d8 addiu a1, a1, 0x7820 | a1 += 0x7820;
0x004039dc addiu a0, zero, 2 | a0 = 2;
0x004039e0 move a2, v0 | a2 = v0;
0x004039e4 sw v0, 0xc4(sp) | *(var_c4h) = v0;
0x004039e8 jalr t9 | t9 ();
0x004039ec lw a0, 0x194(s1) | a0 = *((s1 + 101));
0x004039f0 lw gp, 0x28(sp) | gp = *(var_28h);
0x004039f4 addiu a0, a0, 1 | a0++;
0x004039f8 sw a0, 0x194(s1) | *((s1 + 101)) = a0;
0x004039fc lw a0, 0x1e8(s1) | a0 = *((s1 + 122));
0x00403a00 slti a1, a0, 0x14 | a1 = (a0 < 0x14) ? 1 : 0;
0x00403a04 lw v0, 0xc4(sp) | v0 = *(var_c4h);
| if (a1 == 0) {
0x00403a08 bnez a1, 0x403a38 |
0x00403a0c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403a10 lui a1, 0x41 | a1 = 0x410000;
0x00403a14 lui a2, 0x41 | a2 = 0x410000;
0x00403a18 move a0, zero | a0 = 0;
| /* str._s___d:_too_many_clients_to_track_n */
0x00403a1c addiu a1, a1, 0x7844 | a1 += 0x7844;
| /* str.miio_client.c */
0x00403a20 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x00403a24 addiu a3, zero, 0x969 | a3 = 0x969;
0x00403a28 jalr t9 | t9 ();
0x00403a2c lw gp, 0x28(sp) | gp = *(var_28h);
0x00403a30 j 0x403e98 | goto label_47;
0x00403a34 sb fp, 0x20a(s5) | *((s5 + 522)) = fp;
| }
0x00403a38 addiu a1, a0, 1 | a1 = a0 + 1;
0x00403a3c addiu a0, a0, 0x66 | a0 += 0x66;
0x00403a40 sll a0, a0, 2 | a0 <<= 2;
0x00403a44 addu a0, a0, s1 | a0 += s1;
0x00403a48 sw a1, 0x1e8(s1) | *((s1 + 122)) = a1;
0x00403a4c j 0x403918 |
| } while (1);
0x00403a50 sw v0, (a0) | *(a0) = v0;
| label_52:
0x00403a54 lw v0, 0x2dc(s1) | v0 = *((s1 + 183));
| if (s6 != v0) {
0x00403a58 bnel s6, v0, 0x403b90 |
0x00403a5c addiu v0, zero, 0x80 | v0 = 0x80;
0x00403a60 sw v0, 0xb0(sp) | *(var_b0h) = v0;
0x00403a64 lw v0, 0x2dc(s1) | v0 = *((s1 + 183));
0x00403a68 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 > 0) {
0x00403a6c blez v0, 0x403a90 |
0x00403a70 lui a1, 0x41 | a1 = 0x410000;
0x00403a74 lui a2, 0x41 | a2 = 0x410000;
0x00403a78 addiu a0, zero, 1 | a0 = 1;
| /* str._s__:_already_have_one_bt_client__ignore..._n */
0x00403a7c addiu a1, a1, 0x7868 | a1 += 0x7868;
| /* str.bt_conn_listen_handler */
0x00403a80 addiu a2, a2, 0x7c3c | a2 += 0x7c3c;
0x00403a84 jalr t9 | t9 ();
0x00403a88 j 0x403e98 | goto label_47;
0x00403a8c lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00403a90 lw t9, -0x7d54(gp) | t9 = sym.imp.accept;
0x00403a94 move a0, s6 | a0 = s6;
0x00403a98 addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x00403a9c addiu a2, sp, 0xb0 | a2 = sp + 0xb0;
0x00403aa0 jalr t9 | t9 ();
0x00403aa4 move fp, v0 | fp = v0;
0x00403aa8 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 < 0) {
0x00403aac bgez v0, 0x403b10 |
0x00403ab0 lw t9, -0x7e2c(gp) | t9 = sym.imp.__errno_location;
0x00403ab4 jalr t9 | t9 ();
0x00403ab8 nop |
0x00403abc lw a0, (v0) | a0 = *(v0);
0x00403ac0 addiu v0, zero, 0xb | v0 = 0xb;
0x00403ac4 lw gp, 0x28(sp) | gp = *(var_28h);
| if (a0 == v0) {
0x00403ac8 beq a0, v0, 0x403e98 | goto label_47;
| }
0x00403acc lw t9, -0x7d10(gp) | t9 = sym.imp.perror;
0x00403ad0 lui a0, 0x41 | a0 = "accept";
| /* str.accept */
0x00403ad4 addiu a0, a0, 0x77f0 |
0x00403ad8 jalr t9 | t9 ();
0x00403adc lui a1, 0x41 | a1 = 0x410000;
0x00403ae0 lui a2, 0x41 | a2 = 0x410000;
0x00403ae4 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403ae8 sw s6, 0x10(sp) | *(var_10h) = s6;
0x00403aec move a0, zero | a0 = 0;
| /* str._s___d:_accept_error__listenfd:__d._n */
0x00403af0 addiu a1, a1, 0x77f8 | a1 += 0x77f8;
| /* str.miio_client.c */
0x00403af4 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x00403af8 addiu a3, zero, 0x986 | a3 = 0x986;
| label_53:
0x00403afc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403b00 jalr t9 | t9 ();
0x00403b04 nop |
0x00403b08 j 0x403e98 | goto label_47;
0x00403b0c lw gp, 0x28(sp) | gp = *(var_28h);
| }
0x00403b10 lw v1, 0x194(s1) | v1 = *((s1 + 101));
0x00403b14 slti v0, v1, 0x32 | v0 = (v1 < 0x32) ? 1 : 0;
0x00403b18 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| if (v0 == 0) {
0x00403b1c bnez v0, 0x403b50 |
0x00403b20 lui a1, 0x41 | a1 = 0x410000;
0x00403b24 lui a2, 0x41 | a2 = 0x410000;
0x00403b28 move a0, zero | a0 = 0;
| /* str._s___d:_too_many_sockets_to_track_n */
0x00403b2c addiu a1, a1, 0x5dec | a1 += 0x5dec;
| /* str.miio_client.c */
0x00403b30 addiu a2, a2, 0x5028 | a2 += 0x5028;
0x00403b34 addiu a3, zero, 0x98d | a3 = 0x98d;
0x00403b38 jalr t9 | t9 ();
0x00403b3c nop |
0x00403b40 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403b44 addiu v0, zero, 1 | v0 = 1;
0x00403b48 j 0x403e98 | goto label_47;
0x00403b4c sb v0, 0x20a(s1) | *((s1 + 522)) = v0;
| }
0x00403b50 sll v1, v1, 3 | v1 <<= 3;
0x00403b54 addu v1, v1, s1 | v1 += s1;
0x00403b58 addiu v0, zero, 1 | v0 = 1;
0x00403b5c lui a1, 0x41 | a1 = 0x410000;
0x00403b60 sh v0, 8(v1) | *((v1 + 4)) = v0;
0x00403b64 sw fp, 4(v1) | *((v1 + 1)) = fp;
0x00403b68 addiu a0, zero, 2 | a0 = 2;
| /* str.BT_conn_listen_accept_sockfd:__d_n */
0x00403b6c addiu a1, a1, 0x7898 | a1 += 0x7898;
0x00403b70 move a2, fp | a2 = fp;
0x00403b74 jalr t9 | t9 ();
0x00403b78 lw v0, 0x194(s1) | v0 = *((s1 + 101));
0x00403b7c lw gp, 0x28(sp) | gp = *(var_28h);
0x00403b80 addiu v0, v0, 1 | v0++;
0x00403b84 sw v0, 0x194(s1) | *((s1 + 101)) = v0;
0x00403b88 j 0x403e98 | goto label_47;
0x00403b8c sw fp, 0x2dc(s1) | *((s1 + 183)) = fp;
| }
0x00403b90 move v0, zero | v0 = 0;
| if (s6 == v0) {
0x00403b94 beq s6, v0, 0x403f0c | goto label_54;
| }
0x00403b98 lw a1, 0x1e8(s1) | a1 = *((s1 + 122));
0x00403b9c addiu a2, zero, -1 | a2 = -1;
0x00403ba0 slt a0, v0, a1 | a0 = (v0 < a1) ? 1 : 0;
| do {
0x00403ba4 sll a0, v0, 2 | a0 = v0 << 2;
| if (a0 == 0) {
0x00403ba8 beqz a0, 0x403e98 | goto label_47;
| }
0x00403bac addu a0, s2, a0 | a0 = s2 + a0;
0x00403bb0 lw a0, 0x198(a0) | a0 = *((a0 + 102));
| if (a0 == a2) {
0x00403bb4 beql a0, a2, 0x403e9c | goto label_50;
| }
0x00403bb8 addiu s3, s3, -1 | s3 += -1;
0x00403bbc addiu v0, v0, 1 | v0++;
| if (a0 == s6) {
0x00403bc0 beq a0, s6, 0x403f0c | goto label_54;
| }
0x00403bc4 j 0x403ba4 |
| } while (1);
0x00403bc8 slt a0, v0, a1 | a0 = (v0 < a1) ? 1 : 0;
| label_48:
0x00403bcc lw v0, 0xbc(sp) | v0 = *(var_bch);
| if (v0 == 0) {
0x00403bd0 beqz v0, 0x403ea0 | goto label_55;
| }
0x00403bd4 lw fp, 4(s4) | fp = *((s4 + 1));
0x00403bd8 lw v0, 0x2c0(s0) | v0 = *((s0 + 176));
0x00403bdc addiu s3, s3, -1 | s3 += -1;
| if (fp == v0) {
0x00403be0 bnel fp, v0, 0x403e9c | goto label_50;
| }
0x00403be4 lw t9, -0x7f6c(gp) | t9 = sym.get_micro_second;
0x00403be8 jalr t9 | t9 ();
0x00403bec nop |
0x00403bf0 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403bf4 move a0, v0 | a0 = v0;
0x00403bf8 lw t9, -0x7f68(gp) | t9 = sym.__udivdi3;
0x00403bfc move a1, v1 | a1 = v1;
0x00403c00 addiu a2, zero, 0x3e8 | a2 = 0x3e8;
0x00403c04 move a3, zero | a3 = 0;
0x00403c08 jalr t9 | t9 ();
0x00403c0c lw s6, 0x3b0(s0) | s6 = *((s0 + 236));
0x00403c10 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403c14 move t1, v0 | t1 = v0;
| if (s6 == 0) {
0x00403c18 bnez s6, 0x403c30 |
0x00403c1c lw s6, 0x3ac(s2) | s6 = *((s2 + 235));
| label_6:
0x00403c20 sw zero, 0xb8(sp) | *(var_b8h) = 0;
| if (s6 == 0) {
0x00403c24 beqz s6, 0x403d84 | goto label_56;
| }
0x00403c28 j 0x403d08 | goto label_57;
0x00403c2c lw v0, 8(s6) | v0 = *((s6 + 2));
| }
0x00403c30 lui v0, 0x41 | v0 = 0x410000;
0x00403c34 lui t2, 0x41 | t2 = 0x410000;
| /* str._s:_d__ack_timeout:__llu__curr_time:__llu__retry_to_send_size:__d_n */
0x00403c38 addiu t4, v0, 0x78bc | t4 = v0 + 0x78bc;
| /* str.cloud_send_handler */
0x00403c3c addiu t2, t2, 0x7aac | t2 += 0x7aac;
| do {
0x00403c40 lw v0, 0x14(s6) | v0 = *((s6 + 5));
0x00403c44 lw t3, 0x18(s6) | t3 = *((s6 + 6));
0x00403c48 sltu a1, v1, v0 | a1 = (v1 < v0) ? 1 : 0;
0x00403c4c lw a0, 0x10(s6) | a0 = *((s6 + 4));
| if (a1 == 0) {
0x00403c50 bnez a1, 0x403cd8 |
0x00403c54 sltu a1, t1, a0 | a1 = (t1 < a0) ? 1 : 0;
| if (v0 == v1) {
0x00403c58 bne v0, v1, 0x403c64 |
| if (a1 != 0) {
0x00403c5c bnez a1, 0x403cd8 | goto label_58;
| }
0x00403c60 nop |
| }
0x00403c64 sw t1, 0x18(sp) | *(var_18h) = t1;
0x00403c68 sw v1, 0x1c(sp) | *(var_1ch) = v1;
0x00403c6c sw a0, 0x10(sp) | *(var_10h) = a0;
0x00403c70 sw v0, 0x14(sp) | *(var_14h) = v0;
0x00403c74 lw v0, 8(s6) | v0 = *((s6 + 2));
0x00403c78 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403c7c move a1, t4 | a1 = t4;
0x00403c80 move a2, t2 | a2 = t2;
0x00403c84 sw v1, 0xd4(sp) | *(var_d4h) = v1;
0x00403c88 sw t1, 0xc8(sp) | *(var_c8h) = t1;
0x00403c8c sw t2, 0xd0(sp) | *(var_d0h) = t2;
0x00403c90 sw t3, 0xc4(sp) | *(var_c4h) = t3;
0x00403c94 sw t4, 0xcc(sp) | *(var_cch) = t4;
0x00403c98 sw v0, 0x20(sp) | *(var_20h) = v0;
0x00403c9c addiu a0, zero, 3 | a0 = 3;
0x00403ca0 addiu a3, zero, 0x7d8 | a3 = 0x7d8;
0x00403ca4 jalr t9 | t9 ();
0x00403ca8 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403cac lw a1, 4(s6) | a1 = *((s6 + 1));
0x00403cb0 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x00403cb4 lw a2, 8(s6) | a2 = *((s6 + 2));
0x00403cb8 move a0, fp | a0 = fp;
0x00403cbc jalr t9 | t9 ();
0x00403cc0 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403cc4 lw t4, 0xcc(sp) | t4 = *(var_cch);
0x00403cc8 lw t3, 0xc4(sp) | t3 = *(var_c4h);
0x00403ccc lw t2, 0xd0(sp) | t2 = *(var_d0h);
0x00403cd0 lw t1, 0xc8(sp) | t1 = *(var_c8h);
0x00403cd4 lw v1, 0xd4(sp) | v1 = *(var_d4h);
| }
| label_58:
0x00403cd8 move s6, t3 | s6 = t3;
0x00403cdc bnez t3, 0x403c40 |
| } while (t3 != 0);
0x00403ce0 j 0x403c20 | goto label_6;
0x00403ce4 lw s6, 0x3ac(s2) | s6 = *((s2 + 235));
| do {
0x00403ce8 addiu v1, zero, 1 | v1 = 1;
0x00403cec sw v0, 0x18(s6) | *((s6 + 6)) = v0;
0x00403cf0 sw v1, 0xb8(sp) | *(var_b8h) = v1;
0x00403cf4 sw s6, 0x3b0(s5) | *((s5 + 236)) = s6;
| label_7:
0x00403cf8 lw s6, 0x3ac(s1) | s6 = *((s1 + 235));
| if (s6 == 0) {
0x00403cfc beql s6, zero, 0x403d88 | goto label_59;
| }
0x00403d00 lw v1, 0x194(s1) | v1 = *((s1 + 101));
0x00403d04 lw v0, 8(s6) | v0 = *((s6 + 2));
| label_57:
0x00403d08 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403d0c lui a1, 0x41 | a1 = 0x410000;
0x00403d10 lui a2, 0x41 | a2 = 0x410000;
0x00403d14 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00403d18 addiu a0, zero, 4 | a0 = 4;
| /* str._s:_d__to_send_size:__d_n */
0x00403d1c addiu a1, a1, 0x7900 | a1 += 0x7900;
| /* str.cloud_send_handler */
0x00403d20 addiu a2, a2, 0x7aac | a2 += 0x7aac;
0x00403d24 addiu a3, zero, 0x7e9 | a3 = 0x7e9;
0x00403d28 jalr t9 | t9 ();
0x00403d2c lw gp, 0x28(sp) | gp = *(var_28h);
0x00403d30 lw a1, 4(s6) | a1 = *((s6 + 1));
0x00403d34 lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x00403d38 lw a2, 8(s6) | a2 = *((s6 + 2));
0x00403d3c move a0, fp | a0 = fp;
0x00403d40 jalr t9 | t9 ();
0x00403d44 lw v0, 0x18(s6) | v0 = *((s6 + 6));
0x00403d48 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403d4c sw v0, 0x3ac(s1) | *((s1 + 235)) = v0;
0x00403d50 lw v0, 0xc(s6) | v0 = *((s6 + 3));
0x00403d54 addiu v1, zero, -1 | v1 = -1;
0x00403d58 lw v0, 0x3b0(s5) | v0 = *((s5 + 236));
0x00403d5c bnel v0, v1, 0x403ce8 |
| } while (v0 == v1);
0x00403d60 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00403d64 lw a0, 4(s6) | a0 = *((s6 + 1));
0x00403d68 jalr t9 | t9 ();
0x00403d6c lw gp, 0x28(sp) | gp = *(var_28h);
0x00403d70 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00403d74 move a0, s6 | a0 = s6;
0x00403d78 jalr t9 | t9 ();
0x00403d7c j 0x403cf8 | goto label_7;
0x00403d80 lw gp, 0x28(sp) | gp = *(var_28h);
| label_56:
0x00403d84 lw v1, 0x194(s1) | v1 = *((s1 + 101));
| label_59:
0x00403d88 lw a2, 0x2c0(s1) | a2 = *((s1 + 176));
0x00403d8c move a3, zero | a3 = 0;
| if (v1 != 0) {
0x00403d90 bnez v1, 0x403da8 | goto label_60;
| }
| label_9:
0x00403d94 lw v1, 0xb8(sp) | v1 = *(var_b8h);
| if (v1 == 0) {
| label_8:
0x00403d98 beql v1, zero, 0x403e9c | goto label_50;
| }
0x00403d9c addiu s3, s3, -1 | s3 += -1;
0x00403da0 j 0x403e3c | goto label_61;
0x00403da4 lw t9, -0x7d9c(gp) | t9 = sym.imp.timerfd_gettime;
| do {
| label_60:
0x00403da8 slt v0, a3, v1 | v0 = (a3 < v1) ? 1 : 0;
0x00403dac sll v0, a3, 3 | v0 = a3 << 3;
| if (v0 == 0) {
0x00403db0 beqz v0, 0x403dd0 | goto label_62;
| }
0x00403db4 addu v0, s1, v0 | v0 = s1 + v0;
0x00403db8 lw a0, 4(v0) | a0 = *((v0 + 1));
0x00403dbc addiu a3, a3, 1 | a3++;
0x00403dc0 bnel a0, a2, 0x403da8 |
| } while (a0 == a2);
0x00403dc4 lhu a0, 8(v0) | a0 = *((v0 + 4));
0x00403dc8 andi a0, a0, 0xfffb | a0 &= 0xfffb;
0x00403dcc sh a0, 8(v0) | *((v0 + 4)) = a0;
| label_62:
0x00403dd0 lw v1, 0xb8(sp) | v1 = *(var_b8h);
| if (a3 != v1) {
0x00403dd4 bne a3, v1, 0x403d98 | goto label_8;
| }
0x00403dd8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403ddc lui a1, 0x41 | a1 = 0x410000;
0x00403de0 addiu a0, zero, 1 | a0 = 1;
| /* str.can_not_find_poll_fd__d__to_remove_event._count_pollfds:__d_n */
0x00403de4 addiu a1, a1, 0x791c | a1 += 0x791c;
0x00403de8 jalr t9 | t9 ();
0x00403dec lui v1, 0x41 | v1 = 0x410000;
0x00403df0 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403df4 move fp, zero | fp = 0;
| /* str.pollfds__d_:__d_n */
0x00403df8 addiu v1, v1, 0x5ca0 | v1 += 0x5ca0;
| label_10:
0x00403dfc lw v0, 0x194(s1) | v0 = *((s1 + 101));
0x00403e00 slt v0, fp, v0 | v0 = (fp < v0) ? 1 : 0;
0x00403e04 sll v0, fp, 3 | v0 = fp << 3;
| if (v0 == 0) {
0x00403e08 beqz v0, 0x403d94 | goto label_9;
| }
0x00403e0c addu v0, s5, v0 | v0 = s5 + v0;
0x00403e10 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403e14 lw a3, 4(v0) | a3 = *((v0 + 1));
0x00403e18 move a1, v1 | a1 = v1;
0x00403e1c move a2, fp | a2 = fp;
0x00403e20 sw v1, 0xd4(sp) | *(var_d4h) = v1;
0x00403e24 addiu a0, zero, 1 | a0 = 1;
0x00403e28 jalr t9 | t9 ();
0x00403e2c addiu fp, fp, 1 | fp++;
0x00403e30 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403e34 j 0x403dfc | goto label_10;
0x00403e38 lw v1, 0xd4(sp) | v1 = *(var_d4h);
| label_61:
0x00403e3c lw a0, 0x1fc(s5) | a0 = *((s5 + 127));
0x00403e40 addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x00403e44 jalr t9 | t9 ();
0x00403e48 lw v0, 0x38(sp) | v0 = *(var_38h);
0x00403e4c lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 != 0) {
0x00403e50 bnez v0, 0x403e98 | goto label_47;
| }
0x00403e54 lw v0, 0x3c(sp) | v0 = *(var_3ch);
0x00403e58 addiu s3, s3, -1 | s3 += -1;
| if (v0 == 0) {
0x00403e5c bnel v0, zero, 0x403e9c | goto label_50;
| }
0x00403e60 lw t9, -0x7f5c(gp) | t9 = sym.timer_start;
0x00403e64 lw a0, 0x1fc(s5) | a0 = *((s5 + 127));
0x00403e68 addiu a1, zero, 0xbb8 | a1 = 0xbb8;
0x00403e6c move a2, zero | a2 = 0;
0x00403e70 jalr t9 | t9 ();
0x00403e74 lw gp, 0x28(sp) | gp = *(var_28h);
0x00403e78 lui a1, 0x41 | a1 = 0x410000;
0x00403e7c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00403e80 lw a2, 0x1fc(s5) | a2 = *((s5 + 127));
0x00403e84 addiu a0, zero, 3 | a0 = 3;
| /* str.ACK_timer_fd:__d__timeout:__d_ms_n */
0x00403e88 addiu a1, a1, 0x795c | a1 += 0x795c;
0x00403e8c addiu a3, zero, 0xbb8 | a3 = 0xbb8;
0x00403e90 jalr t9 | t9 ();
0x00403e94 lw gp, 0x28(sp) | gp = *(var_28h);
| do {
| label_47:
0x00403e98 addiu s3, s3, -1 | s3 += -1;
| label_50:
0x00403e9c lw v0, 0xbc(sp) | v0 = *(var_bch);
| label_55:
0x00403ea0 addiu s4, s4, 8 | s4 += 8;
0x00403ea4 addiu v0, v0, 1 | v0++;
0x00403ea8 j 0x402eac | goto label_11;
0x00403eac sw v0, 0xbc(sp) | *(var_bch) = v0;
| label_43:
0x00403eb0 jal 0x404d18 | fcn_00404d18 ();
0x00403eb4 nop |
0x00403eb8 lui a0, 0x43 | a0 = 0x4294a0;
0x00403ebc addiu a0, a0, -0x6b60 |
0x00403ec0 jal 0x407160 | sym_free_server_list ();
0x00403ec4 lui a0, 0x43 | a0 = 0x4294a4;
0x00403ec8 addiu a0, a0, -0x6b5c |
0x00403ecc jal 0x407160 | sym_free_server_list ();
0x00403ed0 lui a0, 0x43 | a0 = 0x4294a8;
0x00403ed4 addiu a0, a0, -0x6b58 |
0x00403ed8 jal 0x407160 | sym_free_server_list ();
0x00403edc lui a0, 0x43 | a0 = 0x4294bc;
0x00403ee0 addiu a0, a0, -0x6b44 |
0x00403ee4 jal 0x407160 | sym_free_server_list ();
0x00403ee8 lw a0, 0x2cc(s0) | a0 = *((s0 + 179));
0x00403eec lw gp, 0x28(sp) | gp = *(var_28h);
0x00403ef0 move v0, zero | v0 = 0;
| if (a0 <= 0) {
0x00403ef4 blez a0, 0x403f20 | goto label_41;
| }
0x00403ef8 lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x00403efc jalr t9 | t9 ();
0x00403f00 nop |
0x00403f04 j 0x403f20 | goto label_41;
0x00403f08 move v0, zero | v0 = 0;
| label_54:
0x00403f0c move a0, s6 | a0 = s6;
0x00403f10 move a1, s3 | a1 = s3;
0x00403f14 jal 0x408e18 | fcn_00408e18 ();
0x00403f18 j 0x403e98 |
| } while (1);
0x00403f1c lw gp, 0x28(sp) | gp = *(var_28h);
| label_41:
0x00403f20 lw ra, 0xfc(sp) | ra = *(var_fch);
0x00403f24 lw fp, 0xf8(sp) | fp = *(var_f8h);
0x00403f28 lw s7, 0xf4(sp) | s7 = *(var_f4h);
0x00403f2c lw s6, 0xf0(sp) | s6 = *(var_f0h);
0x00403f30 lw s5, 0xec(sp) | s5 = *(var_ech);
0x00403f34 lw s4, 0xe8(sp) | s4 = *(var_e8h);
0x00403f38 lw s3, 0xe4(sp) | s3 = *(var_e4h);
0x00403f3c lw s2, 0xe0(sp) | s2 = *(var_e0h);
0x00403f40 lw s1, 0xdc(sp) | s1 = *(var_dch);
0x00403f44 lw s0, 0xd8(sp) | s0 = *(var_d8h);
0x00403f48 addiu sp, sp, 0x100 |
0x00403f4c 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 @ 0x40e7a4 */
| #include <stdint.h>
|
; (fcn) sym.bt_conn_fd_close () | void bt_conn_fd_close () {
0x0040e7a4 lui gp, 0x43 |
0x0040e7a8 addiu sp, sp, -0x28 |
0x0040e7ac addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040e7b0 move v0, zero | v0 = 0;
0x0040e7b4 sw s1, 0x20(sp) | *(var_20h) = s1;
0x0040e7b8 sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x0040e7bc sw ra, 0x24(sp) | *(var_24h) = ra;
0x0040e7c0 move s0, a0 | s0 = a0;
0x0040e7c4 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040e7c8 move s1, a1 | s1 = a1;
0x0040e7cc move a0, zero | a0 = 0;
| label_0:
0x0040e7d0 lw v1, 0x194(s0) | v1 = *((s0 + 101));
| do {
0x0040e7d4 slt a1, v0, v1 | a1 = (v0 < v1) ? 1 : 0;
0x0040e7d8 sll a1, v0, 3 | a1 = v0 << 3;
| if (a1 == 0) {
0x0040e7dc beqz a1, 0x40e82c | goto label_1;
| }
0x0040e7e0 addu a2, s0, a1 | a2 = s0 + a1;
0x0040e7e4 lw a2, 4(a2) | a2 = *((a2 + 1));
0x0040e7e8 addiu v0, v0, 1 | v0++;
0x0040e7ec bnel a2, s1, 0x40e7d4 |
| } while (a2 == s1);
0x0040e7f0 subu v0, v1, v0 | __asm ("subu v0, v1, v0");
0x0040e7f4 sll v0, v0, 3 | v0 <<= 3;
0x0040e7f8 move t0, zero | t0 = 0;
| do {
0x0040e7fc addu a3, t0, a1 | a3 = t0 + a1;
0x0040e800 addu a3, s0, a3 | a3 = s0 + a3;
0x0040e804 lw a0, 0xc(a3) | a0 = *((a3 + 3));
0x0040e808 addiu t0, t0, 8 | t0 += 8;
0x0040e80c sw a0, 4(a3) | *((a3 + 1)) = a0;
0x0040e810 lw a0, 0x10(a3) | a0 = *((a3 + 4));
0x0040e814 sw a0, 8(a3) | *((a3 + 2)) = a0;
0x0040e818 bne t0, v0, 0x40e7fc |
| } while (t0 != v0);
0x0040e81c move v0, v1 | v0 = v1;
0x0040e820 addiu a0, zero, 1 | a0 = 1;
0x0040e824 j 0x40e7d0 | goto label_0;
0x0040e828 addiu v0, v0, 1 | v0++;
| label_1:
0x0040e82c addiu v1, v1, -1 | v1 += -1;
| if (a0 != 0) {
0x0040e830 beqz a0, 0x40e83c |
0x0040e834 j 0x40e854 | goto label_2;
0x0040e838 sw v1, 0x194(s0) | *((s0 + 101)) = v1;
| }
0x0040e83c lui a1, 0x42 | a1 = 0x420000;
0x0040e840 addiu a0, zero, 1 | a0 = 1;
| /* str.client_fd___d__not_in_pollfds._n */
0x0040e844 addiu a1, a1, -0x7578 | a1 += -0x7578;
0x0040e848 move a2, s1 | a2 = s1;
0x0040e84c jal 0x40dfb8 | sym_log_printf ()
0x0040e850 lw gp, 0x10(sp) | gp = *(var_10h);
| label_2:
0x0040e854 lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x0040e858 move a0, s1 | a0 = s1;
0x0040e85c jalr t9 | t9 ();
0x0040e860 lw ra, 0x24(sp) | ra = *(var_24h);
0x0040e864 addiu v0, zero, -1 | v0 = -1;
0x0040e868 sw v0, 0x2dc(s0) | *((s0 + 183)) = v0;
0x0040e86c lw s1, 0x20(sp) | s1 = *(var_20h);
0x0040e870 lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x0040e874 addiu sp, sp, 0x28 |
0x0040e878 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 @ 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 @ 0x40e488 */
| #include <stdint.h>
|
; (fcn) sym.general_send_one () | void general_send_one () {
0x0040e488 lui gp, 0x43 |
0x0040e48c addiu sp, sp, -0x38 |
0x0040e490 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040e494 move v0, zero | v0 = 0;
0x0040e498 sw s1, 0x20(sp) | *(var_20h) = s1;
0x0040e49c sw ra, 0x34(sp) | *(var_34h) = ra;
0x0040e4a0 sw s5, 0x30(sp) | *(var_30h) = s5;
0x0040e4a4 sw s4, 0x2c(sp) | *(var_2ch) = s4;
0x0040e4a8 sw s3, 0x28(sp) | *(var_28h) = s3;
0x0040e4ac sw s2, 0x24(sp) | *(var_24h) = s2;
0x0040e4b0 sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x0040e4b4 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040e4b8 move s1, a2 | s1 = a2;
| if (a2 == 0) {
0x0040e4bc beqz a2, 0x40e550 | goto label_0;
| }
0x0040e4c0 lui s3, 0x42 | s3 = 0x420000;
0x0040e4c4 move s4, a0 | s4 = a0;
0x0040e4c8 move s5, a1 | s5 = a1;
0x0040e4cc move s2, zero | s2 = 0;
| /* str.Partial_written_n */
0x0040e4d0 addiu s3, s3, -0x758c | s3 += -0x758c;
| do {
0x0040e4d4 lw t9, -0x7d44(gp) | t9 = sym.imp.send;
| if (s1 <= 0) {
0x0040e4d8 blez s1, 0x40e54c | goto label_1;
| }
0x0040e4dc move a0, s4 | a0 = s4;
0x0040e4e0 addu a1, s5, s2 | a1 = s5 + s2;
0x0040e4e4 move a2, s1 | a2 = s1;
0x0040e4e8 addiu a3, zero, 0x40 | a3 = 0x40;
0x0040e4ec jalr t9 | t9 ();
0x0040e4f0 move s0, v0 | s0 = v0;
0x0040e4f4 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x0040e4f8 bgez v0, 0x40e524 |
0x0040e4fc lui a1, 0x42 | a1 = 0x420000;
0x0040e500 lui a2, 0x42 | a2 = 0x420000;
0x0040e504 lui a3, 0x42 | a3 = 0x420000;
0x0040e508 move a0, zero | a0 = 0;
| /* str._s__s:_send_error:__m_n */
0x0040e50c addiu a1, a1, -0x75b0 | a1 += -0x75b0;
| /* str.miio_util.c */
0x0040e510 addiu a2, a2, -0x7598 | a2 += -0x7598;
| /* str.general_send_one */
0x0040e514 addiu a3, a3, -0x74c4 | a3 += -0x74c4;
0x0040e518 jal 0x40dfb8 | sym_log_printf ()
0x0040e51c j 0x40e550 | goto label_0;
0x0040e520 move v0, s0 | v0 = s0;
| }
0x0040e524 slt v0, v0, s1 | v0 = (v0 < s1) ? 1 : 0;
| if (v0 != 0) {
0x0040e528 beql v0, zero, 0x40e544 |
0x0040e52c addu s2, s2, s0 | s2 += s0;
0x0040e530 addiu a0, zero, 1 | a0 = 1;
0x0040e534 move a1, s3 | a1 = s3;
0x0040e538 jal 0x40dfb8 | sym_log_printf ()
0x0040e53c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040e540 addu s2, s2, s0 | s2 += s0;
| }
0x0040e544 j 0x40e4d4 |
| } while (1);
0x0040e548 subu s1, s1, s0 | __asm ("subu s1, s1, s0");
| label_1:
0x0040e54c move v0, s0 | v0 = s0;
| label_0:
0x0040e550 lw ra, 0x34(sp) | ra = *(var_34h);
0x0040e554 lw s5, 0x30(sp) | s5 = *(var_30h);
0x0040e558 lw s4, 0x2c(sp) | s4 = *(var_2ch);
0x0040e55c lw s3, 0x28(sp) | s3 = *(var_28h);
0x0040e560 lw s2, 0x24(sp) | s2 = *(var_24h);
0x0040e564 lw s1, 0x20(sp) | s1 = *(var_20h);
0x0040e568 lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x0040e56c addiu sp, sp, 0x38 |
0x0040e570 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 @ 0x40e21c */
| #include <stdint.h>
|
; (fcn) sym.get_uptime () | void get_uptime () {
0x0040e21c lui gp, 0x43 |
0x0040e220 addiu gp, gp, 0x1620 |
0x0040e224 addiu sp, sp, -0x60 |
0x0040e228 lw t9, -0x7d1c(gp) | t9 = sym.imp.sysinfo;
0x0040e22c addiu a0, sp, 0x18 | a0 = sp + 0x18;
0x0040e230 sw ra, 0x5c(sp) | *(var_5ch) = ra;
0x0040e234 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040e238 sb zero, 0x18(sp) | *(var_18h) = 0;
0x0040e23c jalr t9 | t9 ();
0x0040e240 lw v1, 0x18(sp) | v1 = *(var_18h);
| if (v0 < 0) {
0x0040e244 bgez v0, 0x40e25c |
0x0040e248 lui a1, 0x42 | a1 = 0x420000;
0x0040e24c addiu a0, zero, 1 | a0 = 1;
| /* str.get_uptime_fail___m */
0x0040e250 addiu a1, a1, -0x75e4 | a1 += -0x75e4;
0x0040e254 jal 0x40dfb8 | sym_log_printf ()
0x0040e258 move v1, zero | v1 = 0;
| }
0x0040e25c lw ra, 0x5c(sp) | ra = *(var_5ch);
0x0040e260 move v0, v1 | v0 = v1;
0x0040e264 addiu sp, sp, 0x60 |
0x0040e268 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 @ 0x40e11c */
| #include <stdint.h>
|
; (fcn) sym.hex2str () | void hex2str () {
0x0040e11c srl v0, a3, 0x1f | v0 = a3 >> 0x1f;
0x0040e120 addu v0, v0, a3 | v0 += a3;
0x0040e124 lui gp, 0x43 |
0x0040e128 sra v0, v0, 1 | v0 >>= 1;
0x0040e12c addiu sp, sp, -0x40 |
0x0040e130 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040e134 slt v0, a1, v0 | v0 = (a1 < v0) ? 1 : 0;
0x0040e138 sw s3, 0x30(sp) | *(var_30h) = s3;
0x0040e13c sw s2, 0x2c(sp) | *(var_2ch) = s2;
0x0040e140 sw s1, 0x28(sp) | *(var_28h) = s1;
0x0040e144 sw s0, 0x24(sp) | *(var_24h) = s0;
0x0040e148 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x0040e14c sw s5, 0x38(sp) | *(var_38h) = s5;
0x0040e150 sw s4, 0x34(sp) | *(var_34h) = s4;
0x0040e154 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040e158 move s2, a0 | s2 = a0;
0x0040e15c move s0, a1 | s0 = a1;
0x0040e160 move s3, a2 | s3 = a2;
0x0040e164 move s1, a3 | s1 = a3;
| if (v0 != 0) {
0x0040e168 beqz v0, 0x40e184 |
0x0040e16c lui a1, 0x42 | a1 = 0x420000;
0x0040e170 addiu a0, zero, 1 | a0 = 1;
| /* str.buflen__d__might_not_be_enough_for_the_hexlen__d__convertion._n */
0x0040e174 addiu a1, a1, -0x7624 | a1 += -0x7624;
0x0040e178 move a2, s0 | a2 = s0;
0x0040e17c jal 0x40dfb8 | sym_log_printf ()
0x0040e180 lw gp, 0x10(sp) | gp = *(var_10h);
| }
0x0040e184 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040e188 move a0, s2 | a0 = s2;
0x0040e18c move a1, zero | a1 = 0;
0x0040e190 move a2, s0 | a2 = s0;
0x0040e194 jalr t9 | t9 ();
0x0040e198 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040e19c move s4, zero | s4 = 0;
0x0040e1a0 addiu s5, sp, 0x18 | s5 = sp + 0x18;
| do {
0x0040e1a4 slt v0, s4, s0 | v0 = (s4 < s0) ? 1 : 0;
0x0040e1a8 sll v0, s4, 1 | v0 = s4 << 1;
| if (v0 == 0) {
0x0040e1ac beqz v0, 0x40e1f8 | goto label_0;
| }
0x0040e1b0 slt v1, v0, s1 | v1 = (v0 < s1) ? 1 : 0;
0x0040e1b4 addu v0, s3, v0 | v0 = s3 + v0;
| if (v1 == 0) {
0x0040e1b8 beqz v1, 0x40e1f8 | goto label_0;
| }
0x0040e1bc lbu v1, (v0) | v1 = *(v0);
0x0040e1c0 lbu v0, 1(v0) | v0 = *((v0 + 1));
0x0040e1c4 lw t9, -0x7d28(gp) | t9 = sym.imp.strtoul;
0x0040e1c8 sb v1, 0x18(sp) | *(var_18h) = v1;
0x0040e1cc sb v0, 0x19(sp) | *(var_19h) = v0;
0x0040e1d0 sb zero, 0x1a(sp) | *(var_1ah) = 0;
0x0040e1d4 move a0, s5 | a0 = s5;
0x0040e1d8 move a1, zero | a1 = 0;
0x0040e1dc addiu a2, zero, 0x10 | a2 = 0x10;
0x0040e1e0 jalr t9 | t9 ();
0x0040e1e4 addu v1, s2, s4 | v1 = s2 + s4;
0x0040e1e8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040e1ec sb v0, (v1) | *(v1) = v0;
0x0040e1f0 j 0x40e1a4 |
| } while (1);
0x0040e1f4 addiu s4, s4, 1 | s4++;
| label_0:
0x0040e1f8 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x0040e1fc lw s5, 0x38(sp) | s5 = *(var_38h);
0x0040e200 lw s4, 0x34(sp) | s4 = *(var_34h);
0x0040e204 lw s3, 0x30(sp) | s3 = *(var_30h);
0x0040e208 lw s2, 0x2c(sp) | s2 = *(var_2ch);
0x0040e20c lw s1, 0x28(sp) | s1 = *(var_28h);
0x0040e210 lw s0, 0x24(sp) | s0 = *(var_24h);
0x0040e214 addiu sp, sp, 0x40 |
0x0040e218 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 @ 0x40d5e0 */
| #include <stdint.h>
|
; (fcn) sym.json_verify () | void json_verify () {
0x0040d5e0 lui gp, 0x43 |
0x0040d5e4 addiu gp, gp, 0x1620 |
0x0040d5e8 addiu sp, sp, -0x20 |
0x0040d5ec lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d5f0 sw s0, 0x18(sp) | *(var_18h) = s0;
0x0040d5f4 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d5f8 sw ra, 0x1c(sp) | *(var_1ch) = ra;
0x0040d5fc move s0, a0 | s0 = a0;
0x0040d600 jalr t9 | t9 ();
0x0040d604 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d608 bnez v0, 0x40d644 |
0x0040d60c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d610 lui a1, 0x42 | a1 = 0x420000;
0x0040d614 lui a2, 0x42 | a2 = 0x420000;
0x0040d618 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_Not_in_json_format:__s_n */
0x0040d61c addiu a1, a1, -0x7740 | a1 += -0x7740;
| /* str.json_verify */
0x0040d620 addiu a2, a2, -0x76dc | a2 += -0x76dc;
0x0040d624 move a3, s0 | a3 = s0;
0x0040d628 jalr t9 | t9 ();
0x0040d62c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d630 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d634 move a0, zero | a0 = 0;
0x0040d638 jalr t9 | t9 ();
0x0040d63c j 0x40d654 | goto label_0;
0x0040d640 addiu v0, zero, -1 | v0 = -1;
| }
0x0040d644 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d648 move a0, v0 | a0 = v0;
0x0040d64c jalr t9 | t9 ();
0x0040d650 move v0, zero | v0 = 0;
| label_0:
0x0040d654 lw ra, 0x1c(sp) | ra = *(var_1ch);
0x0040d658 lw s0, 0x18(sp) | s0 = *(var_18h);
0x0040d65c addiu sp, sp, 0x20 |
0x0040d660 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 @ 0x40d664 */
| #include <stdint.h>
|
; (fcn) sym.json_verify_method () | void json_verify_method () {
0x0040d664 lui gp, 0x43 |
0x0040d668 addiu gp, gp, 0x1620 |
0x0040d66c addiu sp, sp, -0x38 |
0x0040d670 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d674 sw s1, 0x30(sp) | *(var_30h) = s1;
0x0040d678 sw s0, 0x2c(sp) | *(var_2ch) = s0;
0x0040d67c sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d680 sw a1, 0x20(sp) | *(var_20h) = a1;
0x0040d684 sw ra, 0x34(sp) | *(var_34h) = ra;
0x0040d688 move s1, a0 | s1 = a0;
0x0040d68c jalr t9 | t9 ();
0x0040d690 move s0, v0 | s0 = v0;
0x0040d694 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d698 lw a1, 0x20(sp) | a1 = *(var_20h);
| if (v0 == 0) {
0x0040d69c bnez v0, 0x40d6d0 |
0x0040d6a0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d6a4 lui a1, 0x42 | a1 = 0x420000;
0x0040d6a8 lui a2, 0x42 | a2 = 0x420000;
0x0040d6ac addiu a0, zero, 1 | a0 = 1;
| /* str._s:_Not_in_json_format:__s_n */
0x0040d6b0 addiu a1, a1, -0x7740 | a1 += -0x7740;
| /* str.json_verify_method */
0x0040d6b4 addiu a2, a2, -0x76f0 | a2 += -0x76f0;
0x0040d6b8 move a3, s1 | a3 = s1;
0x0040d6bc jalr t9 | t9 ();
0x0040d6c0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d6c4 move a0, zero | a0 = 0;
0x0040d6c8 j 0x40d6f0 | goto label_0;
0x0040d6cc lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| }
0x0040d6d0 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d6d4 move a0, v0 | a0 = v0;
0x0040d6d8 addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d6dc jalr t9 | t9 ();
0x0040d6e0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d6e4 move a0, s0 | a0 = s0;
0x0040d6e8 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| if (v0 == 0) {
0x0040d6ec bnez v0, 0x40d700 |
| label_0:
0x0040d6f0 jalr t9 | t9 ();
0x0040d6f4 nop |
0x0040d6f8 j 0x40d70c | goto label_1;
0x0040d6fc addiu v0, zero, -1 | v0 = -1;
| }
0x0040d700 jalr t9 | t9 ();
0x0040d704 nop |
0x0040d708 move v0, zero | v0 = 0;
| label_1:
0x0040d70c lw ra, 0x34(sp) | ra = *(var_34h);
0x0040d710 lw s1, 0x30(sp) | s1 = *(var_30h);
0x0040d714 lw s0, 0x2c(sp) | s0 = *(var_2ch);
0x0040d718 addiu sp, sp, 0x38 |
0x0040d71c 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 @ 0x40d720 */
| #include <stdint.h>
|
; (fcn) sym.json_verify_method_value () | void json_verify_method_value () {
0x0040d720 lui gp, 0x43 |
0x0040d724 addiu gp, gp, 0x1620 |
0x0040d728 addiu sp, sp, -0x40 |
0x0040d72c lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d730 sw s3, 0x38(sp) | *(var_38h) = s3;
0x0040d734 sw s2, 0x34(sp) | *(var_34h) = s2;
0x0040d738 sw s1, 0x30(sp) | *(var_30h) = s1;
0x0040d73c sw s0, 0x2c(sp) | *(var_2ch) = s0;
0x0040d740 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d744 sw a1, 0x20(sp) | *(var_20h) = a1;
0x0040d748 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x0040d74c move s3, a0 | s3 = a0;
0x0040d750 move s0, a2 | s0 = a2;
0x0040d754 move s2, a3 | s2 = a3;
0x0040d758 jalr t9 | t9 ();
0x0040d75c move s1, v0 | s1 = v0;
0x0040d760 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d764 lw a1, 0x20(sp) | a1 = *(var_20h);
| if (v0 == 0) {
0x0040d768 bnez v0, 0x40d798 |
0x0040d76c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d770 lui a1, 0x42 | a1 = 0x420000;
0x0040d774 lui a2, 0x42 | a2 = 0x420000;
0x0040d778 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_Not_in_json_format:__s_n */
0x0040d77c addiu a1, a1, -0x7740 | a1 += -0x7740;
| /* str.json_verify_method_value */
0x0040d780 addiu a2, a2, -0x770c | a2 += -0x770c;
0x0040d784 move a3, s3 | a3 = s3;
0x0040d788 jalr t9 | t9 ();
0x0040d78c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d790 j 0x40d880 | goto label_0;
0x0040d794 move a0, zero | a0 = 0;
| }
0x0040d798 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d79c move a0, v0 | a0 = v0;
0x0040d7a0 addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d7a4 jalr t9 | t9 ();
0x0040d7a8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040d7ac beqz v0, 0x40d87c |
0x0040d7b0 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040d7b4 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d7b8 move a1, s2 | a1 = s2;
0x0040d7bc jalr t9 | t9 ();
0x0040d7c0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d7c4 beqz v0, 0x40d87c | goto label_1;
| }
0x0040d7c8 addiu v0, zero, 3 | v0 = 3;
0x0040d7cc addiu v0, zero, 6 | v0 = 6;
| if (s2 != v0) {
0x0040d7d0 beq s2, v0, 0x40d84c |
0x0040d7d4 move a0, s1 | a0 = s1;
| if (s2 != v0) {
0x0040d7d8 bne s2, v0, 0x40d880 | goto label_0;
| }
0x0040d7dc lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040d7e0 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d7e4 jalr t9 | t9 ();
0x0040d7e8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d7ec move a0, v0 | a0 = v0;
0x0040d7f0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040d7f4 move s3, v0 | s3 = v0;
0x0040d7f8 jalr t9 | t9 ();
0x0040d7fc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d800 move a0, s0 | a0 = s0;
0x0040d804 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040d808 move s2, v0 | s2 = v0;
0x0040d80c jalr t9 | t9 ();
0x0040d810 lw gp, 0x10(sp) | gp = *(var_10h);
| if (s2 != v0) {
0x0040d814 bne s2, v0, 0x40d87c | goto label_1;
| }
0x0040d818 lw t9, -0x7da0(gp) | t9 = sym.imp.strncmp;
0x0040d81c move a1, s0 | a1 = s0;
0x0040d820 move a0, s3 | a0 = s3;
0x0040d824 move a2, s2 | a2 = s2;
0x0040d828 jalr t9 | t9 ();
0x0040d82c move s0, v0 | s0 = v0;
0x0040d830 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040d834 bnez v0, 0x40d87c | goto label_1;
| }
0x0040d838 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d83c move a0, s1 | a0 = s1;
0x0040d840 jalr t9 | t9 ();
0x0040d844 j 0x40d890 | goto label_2;
0x0040d848 lw ra, 0x3c(sp) | ra = *(var_3ch);
| }
0x0040d84c lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040d850 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d854 jalr t9 | t9 ();
0x0040d858 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d85c lw v1, (s0) | v1 = *(s0);
0x0040d860 move a0, s1 | a0 = s1;
0x0040d864 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| if (v0 != v1) {
0x0040d868 bne v0, v1, 0x40d884 | goto label_3;
| }
0x0040d86c move s0, zero | s0 = 0;
0x0040d870 jalr t9 | t9 ();
0x0040d874 j 0x40d890 | goto label_2;
0x0040d878 lw ra, 0x3c(sp) | ra = *(var_3ch);
| }
| label_1:
0x0040d87c move a0, s1 | a0 = s1;
| label_0:
0x0040d880 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| label_3:
0x0040d884 addiu s0, zero, -1 | s0 = -1;
0x0040d888 jalr t9 | t9 ();
0x0040d88c lw ra, 0x3c(sp) | ra = *(var_3ch);
| label_2:
0x0040d890 move v0, s0 | v0 = s0;
0x0040d894 lw s3, 0x38(sp) | s3 = *(var_38h);
0x0040d898 lw s2, 0x34(sp) | s2 = *(var_34h);
0x0040d89c lw s1, 0x30(sp) | s1 = *(var_30h);
0x0040d8a0 lw s0, 0x2c(sp) | s0 = *(var_2ch);
0x0040d8a4 addiu sp, sp, 0x40 |
0x0040d8a8 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 @ 0x40d8ac */
| #include <stdint.h>
|
; (fcn) sym.json_verify_get_int () | void json_verify_get_int () {
0x0040d8ac lui gp, 0x43 |
0x0040d8b0 addiu gp, gp, 0x1620 |
0x0040d8b4 addiu sp, sp, -0x38 |
0x0040d8b8 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d8bc sw s2, 0x30(sp) | *(var_30h) = s2;
0x0040d8c0 sw s1, 0x2c(sp) | *(var_2ch) = s1;
0x0040d8c4 sw s0, 0x28(sp) | *(var_28h) = s0;
0x0040d8c8 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d8cc sw a1, 0x20(sp) | *(var_20h) = a1;
0x0040d8d0 sw ra, 0x34(sp) | *(var_34h) = ra;
0x0040d8d4 move s2, a0 | s2 = a0;
0x0040d8d8 move s1, a2 | s1 = a2;
0x0040d8dc jalr t9 | t9 ();
0x0040d8e0 move s0, v0 | s0 = v0;
0x0040d8e4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d8e8 lw a1, 0x20(sp) | a1 = *(var_20h);
| if (v0 == 0) {
0x0040d8ec bnez v0, 0x40d91c |
0x0040d8f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d8f4 lui a1, 0x42 | a1 = 0x420000;
0x0040d8f8 lui a2, 0x42 | a2 = 0x420000;
0x0040d8fc addiu a0, zero, 1 | a0 = 1;
| /* str._s:_Not_in_json_format:__s_n */
0x0040d900 addiu a1, a1, -0x7740 | a1 += -0x7740;
| /* str.json_verify_get_int */
0x0040d904 addiu a2, a2, -0x7720 | a2 += -0x7720;
0x0040d908 move a3, s2 | a3 = s2;
0x0040d90c jalr t9 | t9 ();
0x0040d910 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d914 j 0x40d938 | goto label_0;
0x0040d918 move a0, zero | a0 = 0;
| }
0x0040d91c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d920 move a0, v0 | a0 = v0;
0x0040d924 addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d928 jalr t9 | t9 ();
0x0040d92c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d930 bnez v0, 0x40d94c |
| while (v0 == 0) {
0x0040d934 move a0, s0 | a0 = s0;
| label_0:
0x0040d938 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d93c jalr t9 | t9 ();
0x0040d940 nop |
0x0040d944 j 0x40d988 | goto label_1;
0x0040d948 addiu v0, zero, -1 | v0 = -1;
0x0040d94c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040d950 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d954 addiu a1, zero, 3 | a1 = 3;
0x0040d958 jalr t9 | t9 ();
0x0040d95c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d960 beqz v0, 0x40d934 |
| }
0x0040d964 lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040d968 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d96c jalr t9 | t9 ();
0x0040d970 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d974 sw v0, (s1) | *(s1) = v0;
0x0040d978 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d97c move a0, s0 | a0 = s0;
0x0040d980 jalr t9 | t9 ();
0x0040d984 move v0, zero | v0 = 0;
| label_1:
0x0040d988 lw ra, 0x34(sp) | ra = *(var_34h);
0x0040d98c lw s2, 0x30(sp) | s2 = *(var_30h);
0x0040d990 lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x0040d994 lw s0, 0x28(sp) | s0 = *(var_28h);
0x0040d998 addiu sp, sp, 0x38 |
0x0040d99c 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 @ 0x40d8ac */
| #include <stdint.h>
|
; (fcn) sym.json_verify_get_int () | void json_verify_get_int () {
0x0040d8ac lui gp, 0x43 |
0x0040d8b0 addiu gp, gp, 0x1620 |
0x0040d8b4 addiu sp, sp, -0x38 |
0x0040d8b8 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d8bc sw s2, 0x30(sp) | *(var_30h) = s2;
0x0040d8c0 sw s1, 0x2c(sp) | *(var_2ch) = s1;
0x0040d8c4 sw s0, 0x28(sp) | *(var_28h) = s0;
0x0040d8c8 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d8cc sw a1, 0x20(sp) | *(var_20h) = a1;
0x0040d8d0 sw ra, 0x34(sp) | *(var_34h) = ra;
0x0040d8d4 move s2, a0 | s2 = a0;
0x0040d8d8 move s1, a2 | s1 = a2;
0x0040d8dc jalr t9 | t9 ();
0x0040d8e0 move s0, v0 | s0 = v0;
0x0040d8e4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d8e8 lw a1, 0x20(sp) | a1 = *(var_20h);
| if (v0 == 0) {
0x0040d8ec bnez v0, 0x40d91c |
0x0040d8f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d8f4 lui a1, 0x42 | a1 = 0x420000;
0x0040d8f8 lui a2, 0x42 | a2 = 0x420000;
0x0040d8fc addiu a0, zero, 1 | a0 = 1;
| /* str._s:_Not_in_json_format:__s_n */
0x0040d900 addiu a1, a1, -0x7740 | a1 += -0x7740;
| /* str.json_verify_get_int */
0x0040d904 addiu a2, a2, -0x7720 | a2 += -0x7720;
0x0040d908 move a3, s2 | a3 = s2;
0x0040d90c jalr t9 | t9 ();
0x0040d910 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d914 j 0x40d938 | goto label_0;
0x0040d918 move a0, zero | a0 = 0;
| }
0x0040d91c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d920 move a0, v0 | a0 = v0;
0x0040d924 addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d928 jalr t9 | t9 ();
0x0040d92c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d930 bnez v0, 0x40d94c |
| while (v0 == 0) {
0x0040d934 move a0, s0 | a0 = s0;
| label_0:
0x0040d938 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d93c jalr t9 | t9 ();
0x0040d940 nop |
0x0040d944 j 0x40d988 | goto label_1;
0x0040d948 addiu v0, zero, -1 | v0 = -1;
0x0040d94c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040d950 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d954 addiu a1, zero, 3 | a1 = 3;
0x0040d958 jalr t9 | t9 ();
0x0040d95c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d960 beqz v0, 0x40d934 |
| }
0x0040d964 lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040d968 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d96c jalr t9 | t9 ();
0x0040d970 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d974 sw v0, (s1) | *(s1) = v0;
0x0040d978 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d97c move a0, s0 | a0 = s0;
0x0040d980 jalr t9 | t9 ();
0x0040d984 move v0, zero | v0 = 0;
| label_1:
0x0040d988 lw ra, 0x34(sp) | ra = *(var_34h);
0x0040d98c lw s2, 0x30(sp) | s2 = *(var_30h);
0x0040d990 lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x0040d994 lw s0, 0x28(sp) | s0 = *(var_28h);
0x0040d998 addiu sp, sp, 0x38 |
0x0040d99c 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 @ 0x40d664 */
| #include <stdint.h>
|
; (fcn) sym.json_verify_method () | void json_verify_method () {
0x0040d664 lui gp, 0x43 |
0x0040d668 addiu gp, gp, 0x1620 |
0x0040d66c addiu sp, sp, -0x38 |
0x0040d670 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d674 sw s1, 0x30(sp) | *(var_30h) = s1;
0x0040d678 sw s0, 0x2c(sp) | *(var_2ch) = s0;
0x0040d67c sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d680 sw a1, 0x20(sp) | *(var_20h) = a1;
0x0040d684 sw ra, 0x34(sp) | *(var_34h) = ra;
0x0040d688 move s1, a0 | s1 = a0;
0x0040d68c jalr t9 | t9 ();
0x0040d690 move s0, v0 | s0 = v0;
0x0040d694 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d698 lw a1, 0x20(sp) | a1 = *(var_20h);
| if (v0 == 0) {
0x0040d69c bnez v0, 0x40d6d0 |
0x0040d6a0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d6a4 lui a1, 0x42 | a1 = 0x420000;
0x0040d6a8 lui a2, 0x42 | a2 = 0x420000;
0x0040d6ac addiu a0, zero, 1 | a0 = 1;
| /* str._s:_Not_in_json_format:__s_n */
0x0040d6b0 addiu a1, a1, -0x7740 | a1 += -0x7740;
| /* str.json_verify_method */
0x0040d6b4 addiu a2, a2, -0x76f0 | a2 += -0x76f0;
0x0040d6b8 move a3, s1 | a3 = s1;
0x0040d6bc jalr t9 | t9 ();
0x0040d6c0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d6c4 move a0, zero | a0 = 0;
0x0040d6c8 j 0x40d6f0 | goto label_0;
0x0040d6cc lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| }
0x0040d6d0 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d6d4 move a0, v0 | a0 = v0;
0x0040d6d8 addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d6dc jalr t9 | t9 ();
0x0040d6e0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d6e4 move a0, s0 | a0 = s0;
0x0040d6e8 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| if (v0 == 0) {
0x0040d6ec bnez v0, 0x40d700 |
| label_0:
0x0040d6f0 jalr t9 | t9 ();
0x0040d6f4 nop |
0x0040d6f8 j 0x40d70c | goto label_1;
0x0040d6fc addiu v0, zero, -1 | v0 = -1;
| }
0x0040d700 jalr t9 | t9 ();
0x0040d704 nop |
0x0040d708 move v0, zero | v0 = 0;
| label_1:
0x0040d70c lw ra, 0x34(sp) | ra = *(var_34h);
0x0040d710 lw s1, 0x30(sp) | s1 = *(var_30h);
0x0040d714 lw s0, 0x2c(sp) | s0 = *(var_2ch);
0x0040d718 addiu sp, sp, 0x38 |
0x0040d71c 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 @ 0x40d720 */
| #include <stdint.h>
|
; (fcn) sym.json_verify_method_value () | void json_verify_method_value () {
0x0040d720 lui gp, 0x43 |
0x0040d724 addiu gp, gp, 0x1620 |
0x0040d728 addiu sp, sp, -0x40 |
0x0040d72c lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d730 sw s3, 0x38(sp) | *(var_38h) = s3;
0x0040d734 sw s2, 0x34(sp) | *(var_34h) = s2;
0x0040d738 sw s1, 0x30(sp) | *(var_30h) = s1;
0x0040d73c sw s0, 0x2c(sp) | *(var_2ch) = s0;
0x0040d740 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d744 sw a1, 0x20(sp) | *(var_20h) = a1;
0x0040d748 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x0040d74c move s3, a0 | s3 = a0;
0x0040d750 move s0, a2 | s0 = a2;
0x0040d754 move s2, a3 | s2 = a3;
0x0040d758 jalr t9 | t9 ();
0x0040d75c move s1, v0 | s1 = v0;
0x0040d760 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d764 lw a1, 0x20(sp) | a1 = *(var_20h);
| if (v0 == 0) {
0x0040d768 bnez v0, 0x40d798 |
0x0040d76c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d770 lui a1, 0x42 | a1 = 0x420000;
0x0040d774 lui a2, 0x42 | a2 = 0x420000;
0x0040d778 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_Not_in_json_format:__s_n */
0x0040d77c addiu a1, a1, -0x7740 | a1 += -0x7740;
| /* str.json_verify_method_value */
0x0040d780 addiu a2, a2, -0x770c | a2 += -0x770c;
0x0040d784 move a3, s3 | a3 = s3;
0x0040d788 jalr t9 | t9 ();
0x0040d78c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d790 j 0x40d880 | goto label_0;
0x0040d794 move a0, zero | a0 = 0;
| }
0x0040d798 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d79c move a0, v0 | a0 = v0;
0x0040d7a0 addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d7a4 jalr t9 | t9 ();
0x0040d7a8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040d7ac beqz v0, 0x40d87c |
0x0040d7b0 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040d7b4 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d7b8 move a1, s2 | a1 = s2;
0x0040d7bc jalr t9 | t9 ();
0x0040d7c0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d7c4 beqz v0, 0x40d87c | goto label_1;
| }
0x0040d7c8 addiu v0, zero, 3 | v0 = 3;
0x0040d7cc addiu v0, zero, 6 | v0 = 6;
| if (s2 != v0) {
0x0040d7d0 beq s2, v0, 0x40d84c |
0x0040d7d4 move a0, s1 | a0 = s1;
| if (s2 != v0) {
0x0040d7d8 bne s2, v0, 0x40d880 | goto label_0;
| }
0x0040d7dc lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040d7e0 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d7e4 jalr t9 | t9 ();
0x0040d7e8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d7ec move a0, v0 | a0 = v0;
0x0040d7f0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040d7f4 move s3, v0 | s3 = v0;
0x0040d7f8 jalr t9 | t9 ();
0x0040d7fc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d800 move a0, s0 | a0 = s0;
0x0040d804 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040d808 move s2, v0 | s2 = v0;
0x0040d80c jalr t9 | t9 ();
0x0040d810 lw gp, 0x10(sp) | gp = *(var_10h);
| if (s2 != v0) {
0x0040d814 bne s2, v0, 0x40d87c | goto label_1;
| }
0x0040d818 lw t9, -0x7da0(gp) | t9 = sym.imp.strncmp;
0x0040d81c move a1, s0 | a1 = s0;
0x0040d820 move a0, s3 | a0 = s3;
0x0040d824 move a2, s2 | a2 = s2;
0x0040d828 jalr t9 | t9 ();
0x0040d82c move s0, v0 | s0 = v0;
0x0040d830 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040d834 bnez v0, 0x40d87c | goto label_1;
| }
0x0040d838 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d83c move a0, s1 | a0 = s1;
0x0040d840 jalr t9 | t9 ();
0x0040d844 j 0x40d890 | goto label_2;
0x0040d848 lw ra, 0x3c(sp) | ra = *(var_3ch);
| }
0x0040d84c lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040d850 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d854 jalr t9 | t9 ();
0x0040d858 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d85c lw v1, (s0) | v1 = *(s0);
0x0040d860 move a0, s1 | a0 = s1;
0x0040d864 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| if (v0 != v1) {
0x0040d868 bne v0, v1, 0x40d884 | goto label_3;
| }
0x0040d86c move s0, zero | s0 = 0;
0x0040d870 jalr t9 | t9 ();
0x0040d874 j 0x40d890 | goto label_2;
0x0040d878 lw ra, 0x3c(sp) | ra = *(var_3ch);
| }
| label_1:
0x0040d87c move a0, s1 | a0 = s1;
| label_0:
0x0040d880 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| label_3:
0x0040d884 addiu s0, zero, -1 | s0 = -1;
0x0040d888 jalr t9 | t9 ();
0x0040d88c lw ra, 0x3c(sp) | ra = *(var_3ch);
| label_2:
0x0040d890 move v0, s0 | v0 = s0;
0x0040d894 lw s3, 0x38(sp) | s3 = *(var_38h);
0x0040d898 lw s2, 0x34(sp) | s2 = *(var_34h);
0x0040d89c lw s1, 0x30(sp) | s1 = *(var_30h);
0x0040d8a0 lw s0, 0x2c(sp) | s0 = *(var_2ch);
0x0040d8a4 addiu sp, sp, 0x40 |
0x0040d8a8 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 @ 0x40d720 */
| #include <stdint.h>
|
; (fcn) sym.json_verify_method_value () | void json_verify_method_value () {
0x0040d720 lui gp, 0x43 |
0x0040d724 addiu gp, gp, 0x1620 |
0x0040d728 addiu sp, sp, -0x40 |
0x0040d72c lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040d730 sw s3, 0x38(sp) | *(var_38h) = s3;
0x0040d734 sw s2, 0x34(sp) | *(var_34h) = s2;
0x0040d738 sw s1, 0x30(sp) | *(var_30h) = s1;
0x0040d73c sw s0, 0x2c(sp) | *(var_2ch) = s0;
0x0040d740 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d744 sw a1, 0x20(sp) | *(var_20h) = a1;
0x0040d748 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x0040d74c move s3, a0 | s3 = a0;
0x0040d750 move s0, a2 | s0 = a2;
0x0040d754 move s2, a3 | s2 = a3;
0x0040d758 jalr t9 | t9 ();
0x0040d75c move s1, v0 | s1 = v0;
0x0040d760 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d764 lw a1, 0x20(sp) | a1 = *(var_20h);
| if (v0 == 0) {
0x0040d768 bnez v0, 0x40d798 |
0x0040d76c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d770 lui a1, 0x42 | a1 = 0x420000;
0x0040d774 lui a2, 0x42 | a2 = 0x420000;
0x0040d778 addiu a0, zero, 1 | a0 = 1;
| /* str._s:_Not_in_json_format:__s_n */
0x0040d77c addiu a1, a1, -0x7740 | a1 += -0x7740;
| /* str.json_verify_method_value */
0x0040d780 addiu a2, a2, -0x770c | a2 += -0x770c;
0x0040d784 move a3, s3 | a3 = s3;
0x0040d788 jalr t9 | t9 ();
0x0040d78c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d790 j 0x40d880 | goto label_0;
0x0040d794 move a0, zero | a0 = 0;
| }
0x0040d798 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d79c move a0, v0 | a0 = v0;
0x0040d7a0 addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d7a4 jalr t9 | t9 ();
0x0040d7a8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040d7ac beqz v0, 0x40d87c |
0x0040d7b0 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040d7b4 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d7b8 move a1, s2 | a1 = s2;
0x0040d7bc jalr t9 | t9 ();
0x0040d7c0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d7c4 beqz v0, 0x40d87c | goto label_1;
| }
0x0040d7c8 addiu v0, zero, 3 | v0 = 3;
0x0040d7cc addiu v0, zero, 6 | v0 = 6;
| if (s2 != v0) {
0x0040d7d0 beq s2, v0, 0x40d84c |
0x0040d7d4 move a0, s1 | a0 = s1;
| if (s2 != v0) {
0x0040d7d8 bne s2, v0, 0x40d880 | goto label_0;
| }
0x0040d7dc lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040d7e0 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d7e4 jalr t9 | t9 ();
0x0040d7e8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d7ec move a0, v0 | a0 = v0;
0x0040d7f0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040d7f4 move s3, v0 | s3 = v0;
0x0040d7f8 jalr t9 | t9 ();
0x0040d7fc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d800 move a0, s0 | a0 = s0;
0x0040d804 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040d808 move s2, v0 | s2 = v0;
0x0040d80c jalr t9 | t9 ();
0x0040d810 lw gp, 0x10(sp) | gp = *(var_10h);
| if (s2 != v0) {
0x0040d814 bne s2, v0, 0x40d87c | goto label_1;
| }
0x0040d818 lw t9, -0x7da0(gp) | t9 = sym.imp.strncmp;
0x0040d81c move a1, s0 | a1 = s0;
0x0040d820 move a0, s3 | a0 = s3;
0x0040d824 move a2, s2 | a2 = s2;
0x0040d828 jalr t9 | t9 ();
0x0040d82c move s0, v0 | s0 = v0;
0x0040d830 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040d834 bnez v0, 0x40d87c | goto label_1;
| }
0x0040d838 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d83c move a0, s1 | a0 = s1;
0x0040d840 jalr t9 | t9 ();
0x0040d844 j 0x40d890 | goto label_2;
0x0040d848 lw ra, 0x3c(sp) | ra = *(var_3ch);
| }
0x0040d84c lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040d850 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040d854 jalr t9 | t9 ();
0x0040d858 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d85c lw v1, (s0) | v1 = *(s0);
0x0040d860 move a0, s1 | a0 = s1;
0x0040d864 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| if (v0 != v1) {
0x0040d868 bne v0, v1, 0x40d884 | goto label_3;
| }
0x0040d86c move s0, zero | s0 = 0;
0x0040d870 jalr t9 | t9 ();
0x0040d874 j 0x40d890 | goto label_2;
0x0040d878 lw ra, 0x3c(sp) | ra = *(var_3ch);
| }
| label_1:
0x0040d87c move a0, s1 | a0 = s1;
| label_0:
0x0040d880 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| label_3:
0x0040d884 addiu s0, zero, -1 | s0 = -1;
0x0040d888 jalr t9 | t9 ();
0x0040d88c lw ra, 0x3c(sp) | ra = *(var_3ch);
| label_2:
0x0040d890 move v0, s0 | v0 = s0;
0x0040d894 lw s3, 0x38(sp) | s3 = *(var_38h);
0x0040d898 lw s2, 0x34(sp) | s2 = *(var_34h);
0x0040d89c lw s1, 0x30(sp) | s1 = *(var_30h);
0x0040d8a0 lw s0, 0x2c(sp) | s0 = *(var_2ch);
0x0040d8a4 addiu sp, sp, 0x40 |
0x0040d8a8 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 @ 0x40bd70 */
| #include <stdint.h>
|
; (fcn) sym.method_miio_config_router () | void method_miio_config_router () {
0x0040bd70 lui gp, 0x43 |
0x0040bd74 addiu gp, gp, 0x1620 |
0x0040bd78 addiu sp, sp, -0x140 |
0x0040bd7c lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040bd80 sw ra, 0x13c(sp) | *(var_13ch) = ra;
0x0040bd84 sw s7, 0x134(sp) | *(var_134h) = s7;
0x0040bd88 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0040bd8c sw a0, 0x140(sp) | *(arg_140h) = a0;
0x0040bd90 sw a1, 0x144(sp) | *(arg_144h) = a1;
0x0040bd94 sw a2, 0x148(sp) | *(arg_148h) = a2;
0x0040bd98 sw fp, 0x138(sp) | *(var_138h) = fp;
0x0040bd9c sw s6, 0x130(sp) | *(var_130h) = s6;
0x0040bda0 sw s5, 0x12c(sp) | *(var_12ch) = s5;
0x0040bda4 sw s4, 0x128(sp) | *(var_128h) = s4;
0x0040bda8 sw s3, 0x124(sp) | *(var_124h) = s3;
0x0040bdac sw s2, 0x120(sp) | *(var_120h) = s2;
0x0040bdb0 sw s1, 0x11c(sp) | *(var_11ch) = s1;
0x0040bdb4 sw s0, 0x118(sp) | *(var_118h) = s0;
0x0040bdb8 jalr t9 | t9 ();
0x0040bdbc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bdc0 lui a1, 0x41 | a1 = 0x410000;
0x0040bdc4 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040bdc8 move a0, v0 | a0 = v0;
| /* str.params */
0x0040bdcc addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040bdd0 addiu a2, sp, 0x104 | a2 = sp + 0x104;
0x0040bdd4 move s7, v0 | s7 = v0;
0x0040bdd8 jalr t9 | t9 ();
0x0040bddc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040bde0 bnez v0, 0x40bdf8 |
0x0040bde4 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040bde8 move a0, s7 | a0 = s7;
0x0040bdec jalr t9 | t9 ();
0x0040bdf0 j 0x40c560 | goto label_0;
0x0040bdf4 addiu v0, zero, -1 | v0 = -1;
| }
0x0040bdf8 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040bdfc addiu s5, sp, 0xa0 | s5 = sp + 0xa0;
0x0040be00 move a0, s5 | a0 = s5;
0x0040be04 move a1, zero | a1 = 0;
0x0040be08 addiu a2, zero, 0x40 | a2 = 0x40;
0x0040be0c jalr t9 | t9 ();
0x0040be10 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040be14 addiu v0, sp, 0x60 | v0 = sp + 0x60;
0x0040be18 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040be1c move a0, v0 | a0 = v0;
0x0040be20 move a1, zero | a1 = 0;
0x0040be24 addiu a2, zero, 0x40 | a2 = 0x40;
0x0040be28 sw v0, 0x10c(sp) | *(var_10ch) = v0;
0x0040be2c jalr t9 | t9 ();
0x0040be30 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040be34 addiu v1, sp, 0x20 | v1 = sp + 0x20;
0x0040be38 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040be3c move a0, v1 | a0 = v1;
0x0040be40 sw v1, 0x108(sp) | *(var_108h) = v1;
0x0040be44 move a1, zero | a1 = 0;
0x0040be48 addiu a2, zero, 0x40 | a2 = 0x40;
0x0040be4c jalr t9 | t9 ();
0x0040be50 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040be54 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040be58 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040be5c addiu s4, sp, 0x100 | s4 = sp + 0x100;
0x0040be60 lui a1, 0x42 | a1 = "ssid";
| /* str.ssid */
0x0040be64 addiu a1, a1, -0x7d50 |
0x0040be68 move a2, s4 | a2 = s4;
0x0040be6c jalr t9 | t9 ();
0x0040be70 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040be74 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040be78 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040be7c addiu a1, zero, 6 | a1 = 6;
0x0040be80 jalr t9 | t9 ();
0x0040be84 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040be88 bnez v0, 0x40be9c |
0x0040be8c lui a1, 0x42 | a1 = 0x420000;
0x0040be90 move a0, zero | a0 = 0;
0x0040be94 j 0x40bfe8 | goto label_1;
| /* str.ssid_is_not_a_string_n */
0x0040be98 addiu a1, a1, -0x7d48 | a1 += -0x7d48;
| }
0x0040be9c lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040bea0 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040bea4 jalr t9 | t9 ();
0x0040bea8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040beac move a0, v0 | a0 = v0;
0x0040beb0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040beb4 move s0, v0 | s0 = v0;
0x0040beb8 jalr t9 | t9 ();
0x0040bebc sltiu v1, v0, 0x40 | v1 = (v0 < 0x40) ? 1 : 0;
0x0040bec0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bec4 move a2, v0 | a2 = v0;
| if (v1 == 0) {
0x0040bec8 bnez v1, 0x40bee8 |
0x0040becc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bed0 lui a1, 0x42 | a1 = 0x420000;
0x0040bed4 addiu a0, zero, 1 | a0 = 1;
| /* str.ssid_too_long._n */
0x0040bed8 addiu a1, a1, -0x7d30 | a1 += -0x7d30;
0x0040bedc jalr t9 | t9 ();
0x0040bee0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bee4 addiu a2, zero, 0x3f | a2 = 0x3f;
| }
0x0040bee8 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040beec move a0, s5 | a0 = s5;
0x0040bef0 move a1, s0 | a1 = s0;
0x0040bef4 jalr t9 | t9 ();
0x0040bef8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040befc lui a1, 0x42 | a1 = 0x420000;
0x0040bf00 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bf04 addiu a0, zero, 3 | a0 = 3;
| /* str.ssid_s_n */
0x0040bf08 addiu a1, a1, -0x7d20 | a1 += -0x7d20;
0x0040bf0c move a2, s5 | a2 = s5;
0x0040bf10 jalr t9 | t9 ();
0x0040bf14 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bf18 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040bf1c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040bf20 lui a1, 0x41 | a1 = 0x417ee8;
| /* esilref: 'uid' */
0x0040bf24 addiu a1, a1, 0x7ee8 |
0x0040bf28 move a2, s4 | a2 = s4;
0x0040bf2c jalr t9 | t9 ();
0x0040bf30 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040bf34 beqz v0, 0x40bf90 |
0x0040bf38 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040bf3c lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040bf40 addiu a1, zero, 3 | a1 = 3;
0x0040bf44 jalr t9 | t9 ();
0x0040bf48 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040bf4c beqz v0, 0x40bf90 | goto label_2;
| }
0x0040bf50 lw t9, -0x7d34(gp) | t9 = sym.imp.json_object_get_int64;
0x0040bf54 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040bf58 jalr t9 | t9 ();
0x0040bf5c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bf60 lui a1, 0x42 | a1 = 0x420000;
0x0040bf64 lw a0, -0x7f28(gp) | a0 = *(gp);
0x0040bf68 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bf6c sw v0, 0x2e8(a0) | *((a0 + 186)) = v0;
0x0040bf70 sw v1, 0x2ec(a0) | *((a0 + 187)) = v1;
| /* str.uid_llu_n */
0x0040bf74 addiu a1, a1, -0x7d14 | a1 += -0x7d14;
0x0040bf78 addiu a0, zero, 3 | a0 = 3;
0x0040bf7c move a2, v0 | a2 = v0;
0x0040bf80 move a3, v1 | a3 = v1;
0x0040bf84 jalr t9 | t9 ();
0x0040bf88 j 0x40bfa8 | goto label_3;
0x0040bf8c lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_2:
0x0040bf90 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bf94 lui a1, 0x42 | a1 = 0x420000;
0x0040bf98 addiu a0, zero, 1 | a0 = 1;
| /* str.uid_not_found__or_uid_not_int._n */
0x0040bf9c addiu a1, a1, -0x7d08 | a1 += -0x7d08;
0x0040bfa0 jalr t9 | t9 ();
0x0040bfa4 lw gp, 0x18(sp) | gp = *(var_18h);
| label_3:
0x0040bfa8 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040bfac lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040bfb0 lui a1, 0x42 | a1 = "passwd";
| /* str.passwd */
0x0040bfb4 addiu a1, a1, -0x7ce8 |
0x0040bfb8 move a2, s4 | a2 = s4;
0x0040bfbc jalr t9 | t9 ();
0x0040bfc0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bfc4 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040bfc8 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040bfcc addiu a1, zero, 6 | a1 = 6;
0x0040bfd0 jalr t9 | t9 ();
0x0040bfd4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040bfd8 bnez v0, 0x40c000 | goto label_4;
| }
0x0040bfdc lui a1, 0x42 | a1 = 0x420000;
0x0040bfe0 addiu a0, zero, 3 | a0 = 3;
| /* str.passwd_is_not_a_string_n */
0x0040bfe4 addiu a1, a1, -0x7ce0 | a1 += -0x7ce0;
| label_1:
0x0040bfe8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bfec jalr t9 | t9 ();
0x0040bff0 nop |
0x0040bff4 lw gp, 0x18(sp) | gp = *(var_18h);
| do {
0x0040bff8 j 0x40c550 | goto label_5;
0x0040bffc addiu s0, zero, -1 | s0 = -1;
| label_4:
0x0040c000 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040c004 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c008 jalr t9 | t9 ();
0x0040c00c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c010 move a0, v0 | a0 = v0;
0x0040c014 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c018 move s0, v0 | s0 = v0;
0x0040c01c jalr t9 | t9 ();
0x0040c020 sltiu v1, v0, 0x40 | v1 = (v0 < 0x40) ? 1 : 0;
0x0040c024 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c028 move a2, v0 | a2 = v0;
| if (v1 == 0) {
0x0040c02c bnez v1, 0x40c04c |
0x0040c030 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c034 lui a1, 0x42 | a1 = 0x420000;
0x0040c038 addiu a0, zero, 1 | a0 = 1;
| /* str.passwd_too_long._n */
0x0040c03c addiu a1, a1, -0x7cc8 | a1 += -0x7cc8;
0x0040c040 jalr t9 | t9 ();
0x0040c044 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c048 addiu a2, zero, 0x3f | a2 = 0x3f;
| }
0x0040c04c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c050 addiu a0, sp, 0x60 | a0 = sp + 0x60;
0x0040c054 move a1, s0 | a1 = s0;
0x0040c058 jalr t9 | t9 ();
0x0040c05c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c060 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040c064 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c068 lui a1, 0x42 | a1 = "bind_key";
| /* str.bind_key */
0x0040c06c addiu a1, a1, -0x7cb4 |
0x0040c070 move a2, s4 | a2 = s4;
0x0040c074 jalr t9 | t9 ();
0x0040c078 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c07c lw s2, -0x7f28(gp) | s2 = *(gp);
| if (v0 == 0) {
0x0040c080 beqz v0, 0x40c11c | goto label_6;
| }
0x0040c084 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c088 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c08c addiu a1, zero, 6 | a1 = 6;
0x0040c090 jalr t9 | t9 ();
0x0040c094 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c098 beqz v0, 0x40c11c | goto label_6;
| }
0x0040c09c lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040c0a0 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c0a4 jalr t9 | t9 ();
0x0040c0a8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c0ac move a0, v0 | a0 = v0;
0x0040c0b0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c0b4 move s1, v0 | s1 = v0;
0x0040c0b8 jalr t9 | t9 ();
0x0040c0bc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c0c0 addiu s3, v0, 1 | s3 = v0 + 1;
0x0040c0c4 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040c0c8 move a0, s3 | a0 = s3;
0x0040c0cc move s0, v0 | s0 = v0;
0x0040c0d0 jalr t9 | t9 ();
0x0040c0d4 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c0d8 sw v0, 0x39c(s2) | *((s2 + 231)) = v0;
| if (v0 != 0) {
0x0040c0dc bnez v0, 0x40c100 | goto label_7;
| }
0x0040c0e0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c0e4 lui a1, 0x42 | a1 = 0x420000;
0x0040c0e8 move a0, zero | a0 = 0;
| /* str.malloc_length__d__error:__m_n */
0x0040c0ec addiu a1, a1, -0x7ca8 | a1 += -0x7ca8;
0x0040c0f0 move a2, s3 | a2 = s3;
0x0040c0f4 jalr t9 | t9 ();
0x0040c0f8 j 0x40bff8 |
| } while (1);
0x0040c0fc lw gp, 0x18(sp) | gp = *(var_18h);
| label_7:
0x0040c100 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c104 move a0, v0 | a0 = v0;
0x0040c108 move a1, s1 | a1 = s1;
0x0040c10c move a2, s0 | a2 = s0;
0x0040c110 jalr t9 | t9 ();
0x0040c114 j 0x40c134 | goto label_8;
0x0040c118 lw gp, 0x18(sp) | gp = *(var_18h);
| label_6:
0x0040c11c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c120 lui a1, 0x42 | a1 = 0x420000;
0x0040c124 addiu a0, zero, 3 | a0 = 3;
| /* str.bind_key_is_not_a_string_n */
0x0040c128 addiu a1, a1, -0x7c88 | a1 += -0x7c88;
0x0040c12c jalr t9 | t9 ();
0x0040c130 lw gp, 0x18(sp) | gp = *(var_18h);
| label_8:
0x0040c134 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040c138 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c13c lui a1, 0x42 | a1 = "country_domain";
| /* str.country_domain */
0x0040c140 addiu a1, a1, -0x7c6c |
0x0040c144 move a2, s4 | a2 = s4;
0x0040c148 jalr t9 | t9 ();
0x0040c14c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c150 move s6, v0 | s6 = v0;
0x0040c154 lw v0, -0x7f28(gp) | v0 = *(gp);
0x0040c158 addiu s1, s2, 0x224 | s1 = s2 + 0x224;
0x0040c15c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040c160 sw zero, 0x21c(s2) | *((s2 + 135)) = 0;
0x0040c164 move a0, s1 | a0 = s1;
0x0040c168 move a1, zero | a1 = 0;
0x0040c16c addiu a2, zero, 0x20 | a2 = 0x20;
0x0040c170 sw zero, 0x220(v0) | *((v0 + 136)) = 0;
0x0040c174 jalr t9 | t9 ();
0x0040c178 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c17c addiu s0, s2, 0x244 | s0 = s2 + 0x244;
0x0040c180 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040c184 move a0, s0 | a0 = s0;
0x0040c188 move a1, zero | a1 = 0;
0x0040c18c addiu a2, zero, 0x20 | a2 = 0x20;
0x0040c190 jalr t9 | t9 ();
0x0040c194 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c198 lui a1, 0x41 | a1 = 0x410000;
0x0040c19c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c1a0 move a0, s1 | a0 = s1;
| /* str.ott.io.mi.com */
0x0040c1a4 addiu a1, a1, 0x67a4 | a1 += 0x67a4;
0x0040c1a8 addiu a2, zero, 0xd | a2 = 0xd;
0x0040c1ac jalr t9 | t9 ();
0x0040c1b0 lui v1, 0x41 | v1 = 0x410000;
0x0040c1b4 lw v0, 0x67b4(v1) | v0 = *((v1 + 6637));
| /* str.ot.io.mi.com */
0x0040c1b8 addiu v1, v1, 0x67b4 | v1 += 0x67b4;
0x0040c1bc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c1c0 sw v0, 0x244(s2) | *((s2 + 145)) = v0;
0x0040c1c4 lw v0, 4(v1) | v0 = *((v1 + 1));
0x0040c1c8 addiu s3, sp, 0xe0 | s3 = sp + 0xe0;
0x0040c1cc sw v0, 4(s0) | *((s0 + 1)) = v0;
0x0040c1d0 lw v0, 8(v1) | v0 = *((v1 + 2));
0x0040c1d4 sw v0, 8(s0) | *((s0 + 2)) = v0;
| if (s6 != 0) {
0x0040c1d8 beqz s6, 0x40c38c |
0x0040c1dc lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c1e0 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c1e4 addiu a1, zero, 6 | a1 = 6;
0x0040c1e8 jalr t9 | t9 ();
0x0040c1ec lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c1f0 beqz v0, 0x40c38c | goto label_9;
| }
0x0040c1f4 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040c1f8 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c1fc jalr t9 | t9 ();
0x0040c200 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c204 move a0, v0 | a0 = v0;
0x0040c208 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c20c move s6, v0 | s6 = v0;
0x0040c210 jalr t9 | t9 ();
0x0040c214 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c218 move a0, s1 | a0 = s1;
0x0040c21c lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c220 move fp, v0 | fp = v0;
0x0040c224 jalr t9 | t9 ();
0x0040c228 move a3, v0 | a3 = v0;
0x0040c22c sltiu v0, fp, 8 | v0 = (fp < 8) ? 1 : 0;
0x0040c230 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c234 bnez v0, 0x40c25c |
0x0040c238 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c23c lui a1, 0x42 | a1 = 0x420000;
0x0040c240 addiu a0, zero, 1 | a0 = 1;
| /* str.country_domain_too_long:__d___8_n */
0x0040c244 addiu a1, a1, -0x7c5c | a1 += -0x7c5c;
0x0040c248 move a2, fp | a2 = fp;
0x0040c24c sw a3, 0x110(sp) | *(var_110h) = a3;
0x0040c250 jalr t9 | t9 ();
0x0040c254 j 0x40c28c | goto label_10;
0x0040c258 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c25c lw a0, -0x7f28(gp) | a0 = *(gp);
| if (fp > 0) {
0x0040c260 blez fp, 0x40c290 |
0x0040c264 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c268 addiu a0, a0, 0x21c | a0 += 0x21c;
0x0040c26c move a1, s6 | a1 = s6;
0x0040c270 move a2, fp | a2 = fp;
0x0040c274 sw a3, 0x110(sp) | *(var_110h) = a3;
0x0040c278 jalr t9 | t9 ();
0x0040c27c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c280 lw v0, -0x7f28(gp) | v0 = *(gp);
0x0040c284 addu v0, v0, fp | v0 += fp;
0x0040c288 sb zero, 0x21c(v0) | *((v0 + 540)) = 0;
| label_10:
0x0040c28c lw a3, 0x110(sp) | a3 = *(var_110h);
| }
0x0040c290 addu v0, fp, a3 | v0 = fp + a3;
0x0040c294 sltiu v0, v0, 0x20 | v0 = (v0 < 0x20) ? 1 : 0;
0x0040c298 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
| if (v0 == 0) {
0x0040c29c bnez v0, 0x40c2c0 |
0x0040c2a0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c2a4 lui a1, 0x42 | a1 = 0x420000;
0x0040c2a8 move a0, zero | a0 = 0;
| /* str.host_length_too_long:__d___d___32_n */
0x0040c2ac addiu a1, a1, -0x7c38 | a1 += -0x7c38;
0x0040c2b0 move a2, fp | a2 = fp;
0x0040c2b4 jalr t9 | t9 ();
0x0040c2b8 j 0x40c3a4 | goto label_11;
0x0040c2bc lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c2c0 lui fp, 0x41 | fp = 0x410000;
0x0040c2c4 move a3, s6 | a3 = s6;
0x0040c2c8 addiu a1, zero, 0x20 | a1 = 0x20;
| /* str._s._s */
0x0040c2cc addiu a2, fp, 0x679c | a2 = fp + 0x679c;
0x0040c2d0 move a0, s3 | a0 = s3;
0x0040c2d4 sw s1, 0x10(sp) | *(var_10h) = s1;
0x0040c2d8 jalr t9 | t9 ();
0x0040c2dc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c2e0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c2e4 move a0, s3 | a0 = s3;
0x0040c2e8 jalr t9 | t9 ();
0x0040c2ec lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c2f0 move a0, s1 | a0 = s1;
0x0040c2f4 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c2f8 move a1, s3 | a1 = s3;
0x0040c2fc move a2, v0 | a2 = v0;
0x0040c300 jalr t9 | t9 ();
0x0040c304 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c308 lui a1, 0x42 | a1 = 0x420000;
0x0040c30c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c310 addiu a0, zero, 2 | a0 = 2;
| /* str.Add_country_domain_to_tcp_host:__s_n */
0x0040c314 addiu a1, a1, -0x7c10 | a1 += -0x7c10;
0x0040c318 move a2, s1 | a2 = s1;
0x0040c31c jalr t9 | t9 ();
0x0040c320 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c324 move a3, s6 | a3 = s6;
0x0040c328 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
0x0040c32c addiu a1, zero, 0x20 | a1 = 0x20;
| /* str._s._s */
0x0040c330 addiu a2, fp, 0x679c | a2 = fp + 0x679c;
0x0040c334 move a0, s3 | a0 = s3;
0x0040c338 sw s0, 0x10(sp) | *(var_10h) = s0;
0x0040c33c jalr t9 | t9 ();
0x0040c340 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c344 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c348 move a0, s3 | a0 = s3;
0x0040c34c jalr t9 | t9 ();
0x0040c350 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c354 move a0, s0 | a0 = s0;
0x0040c358 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c35c move a1, s3 | a1 = s3;
0x0040c360 move a2, v0 | a2 = v0;
0x0040c364 jalr t9 | t9 ();
0x0040c368 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c36c lui a1, 0x42 | a1 = 0x420000;
0x0040c370 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c374 addiu a0, zero, 2 | a0 = 2;
| /* str.Add_country_domain_to_udp_host:__s_n */
0x0040c378 addiu a1, a1, -0x7bec | a1 += -0x7bec;
0x0040c37c move a2, s0 | a2 = s0;
0x0040c380 jalr t9 | t9 ();
0x0040c384 j 0x40c3a4 | goto label_11;
0x0040c388 lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_9:
0x0040c38c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c390 lui a1, 0x42 | a1 = 0x420000;
0x0040c394 addiu a0, zero, 3 | a0 = 3;
| /* str.country_domain_is_not_a_string_n */
0x0040c398 addiu a1, a1, -0x7bc8 | a1 += -0x7bc8;
0x0040c39c jalr t9 | t9 ();
0x0040c3a0 lw gp, 0x18(sp) | gp = *(var_18h);
| label_11:
0x0040c3a4 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040c3a8 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c3ac lui a1, 0x41 | a1 = 0x415bf8;
| /* esilref: 'tz' */
0x0040c3b0 addiu a1, a1, 0x5bf8 |
0x0040c3b4 move a2, s4 | a2 = s4;
0x0040c3b8 jalr t9 | t9 ();
0x0040c3bc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040c3c0 beqz v0, 0x40c484 |
0x0040c3c4 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c3c8 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c3cc addiu a1, zero, 6 | a1 = 6;
0x0040c3d0 jalr t9 | t9 ();
0x0040c3d4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c3d8 beqz v0, 0x40c484 | goto label_12;
| }
0x0040c3dc lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040c3e0 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c3e4 jalr t9 | t9 ();
0x0040c3e8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c3ec move a0, v0 | a0 = v0;
0x0040c3f0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c3f4 move s0, v0 | s0 = v0;
0x0040c3f8 jalr t9 | t9 ();
0x0040c3fc move s1, v0 | s1 = v0;
0x0040c400 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c404 bnez v0, 0x40c424 |
0x0040c408 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c40c lui a1, 0x42 | a1 = 0x420000;
0x0040c410 addiu a0, zero, 1 | a0 = 1;
| /* str.tz_is_NULL._n */
0x0040c414 addiu a1, a1, -0x7ba8 | a1 += -0x7ba8;
0x0040c418 jalr t9 | t9 ();
0x0040c41c j 0x40c44c | goto label_13;
0x0040c420 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c424 sltiu v0, v0, 0x40 | v0 = (v0 < 0x40) ? 1 : 0;
0x0040c428 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| if (v0 == 0) {
0x0040c42c bnez v0, 0x40c450 |
0x0040c430 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c434 lui a1, 0x42 | a1 = 0x420000;
0x0040c438 addiu a0, zero, 1 | a0 = 1;
| /* str.tz_too_long._n */
0x0040c43c addiu a1, a1, -0x7b98 | a1 += -0x7b98;
0x0040c440 jalr t9 | t9 ();
0x0040c444 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c448 addiu s1, zero, 0x3f | s1 = 0x3f;
| label_13:
0x0040c44c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| }
0x0040c450 addiu a0, sp, 0x20 | a0 = sp + 0x20;
0x0040c454 move a1, s0 | a1 = s0;
0x0040c458 move a2, s1 | a2 = s1;
0x0040c45c jalr t9 | t9 ();
0x0040c460 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c464 lui a1, 0x42 | a1 = 0x420000;
0x0040c468 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c46c addiu a0, zero, 3 | a0 = 3;
| /* str.tz_s_n */
0x0040c470 addiu a1, a1, -0x7b88 | a1 += -0x7b88;
0x0040c474 addiu a2, sp, 0x20 | a2 = sp + 0x20;
0x0040c478 jalr t9 | t9 ();
0x0040c47c j 0x40c49c | goto label_14;
0x0040c480 lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_12:
0x0040c484 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c488 lui a1, 0x42 | a1 = 0x420000;
0x0040c48c move a0, zero | a0 = 0;
| /* str.tz_is_not_a_string_n */
0x0040c490 addiu a1, a1, -0x7b80 | a1 += -0x7b80;
0x0040c494 jalr t9 | t9 ();
0x0040c498 lw gp, 0x18(sp) | gp = *(var_18h);
| label_14:
0x0040c49c lw a0, -0x7f28(gp) | a0 = *(gp);
0x0040c4a0 lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
0x0040c4a4 lui a1, 0x42 | a1 = "{\"method\": \"local.status\", \"params\": \"wifi_connecting\"}";
| /* str._method_:__local.status____params_:__wifi_connecting_ */
0x0040c4a8 addiu a1, a1, -0x7b6c |
0x0040c4ac jalr t9 | t9 ();
0x0040c4b0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c4b4 lw a0, 0x140(sp) | a0 = *(arg_140h);
0x0040c4b8 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040c4bc lui a1, 0x41 | a1 = 0x41527c;
| /* esilref: 'id' */
0x0040c4c0 addiu a1, a1, 0x527c |
0x0040c4c4 move a2, s3 | a2 = s3;
0x0040c4c8 jalr t9 | t9 ();
0x0040c4cc move s0, v0 | s0 = v0;
0x0040c4d0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x0040c4d4 bltz v0, 0x40c52c |
0x0040c4d8 lw v1, 0x148(sp) | v1 = *(arg_148h);
0x0040c4dc sltiu v0, v1, 0x24 | v0 = (v1 < 0x24) ? 1 : 0;
| if (v0 != 0) {
0x0040c4e0 beql v0, zero, 0x40c510 |
0x0040c4e4 lui a1, 0x42 | a1 = 0x420000;
0x0040c4e8 lui a1, 0x41 | a1 = 0x410000;
0x0040c4ec lui a2, 0x41 | a2 = 0x410000;
0x0040c4f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c4f4 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040c4f8 addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040c4fc addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040c500 addiu a3, zero, 0x104 | a3 = 0x104;
0x0040c504 jalr t9 | t9 ();
0x0040c508 j 0x40c524 | goto label_15;
0x0040c50c nop |
| }
0x0040c510 lw a0, 0x144(sp) | a0 = *(arg_144h);
0x0040c514 lw a2, 0xe0(sp) | a2 = *(var_e0h);
0x0040c518 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
| /* str._id_:_d__result_:__OK__ */
0x0040c51c addiu a1, a1, -0x7b34 | a1 += -0x7b34;
0x0040c520 jalr t9 | t9 ();
| label_15:
0x0040c524 j 0x40c534 | goto label_16;
0x0040c528 lw a2, 0x2e8(s2) | a2 = *((s2 + 186));
| }
0x0040c52c move s0, zero | s0 = 0;
0x0040c530 lw a2, 0x2e8(s2) | a2 = *((s2 + 186));
| label_16:
0x0040c534 lw a3, 0x2ec(s2) | a3 = *((s2 + 187));
0x0040c538 addiu v0, sp, 0x20 | v0 = sp + 0x20;
0x0040c53c sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040c540 move a0, s5 | a0 = s5;
0x0040c544 addiu a1, sp, 0x60 | a1 = sp + 0x60;
0x0040c548 jal 0x40bbbc | fcn_0040bbbc ();
0x0040c54c lw gp, 0x18(sp) | gp = *(var_18h);
| label_5:
0x0040c550 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040c554 move a0, s7 | a0 = s7;
0x0040c558 jalr t9 | t9 ();
0x0040c55c move v0, s0 | v0 = s0;
| label_0:
0x0040c560 lw ra, 0x13c(sp) | ra = *(var_13ch);
0x0040c564 lw fp, 0x138(sp) | fp = *(var_138h);
0x0040c568 lw s7, 0x134(sp) | s7 = *(var_134h);
0x0040c56c lw s6, 0x130(sp) | s6 = *(var_130h);
0x0040c570 lw s5, 0x12c(sp) | s5 = *(var_12ch);
0x0040c574 lw s4, 0x128(sp) | s4 = *(var_128h);
0x0040c578 lw s3, 0x124(sp) | s3 = *(var_124h);
0x0040c57c lw s2, 0x120(sp) | s2 = *(var_120h);
0x0040c580 lw s1, 0x11c(sp) | s1 = *(var_11ch);
0x0040c584 lw s0, 0x118(sp) | s0 = *(var_118h);
0x0040c588 addiu sp, sp, 0x140 |
0x0040c58c 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 @ 0x40c6e0 */
| #include <stdint.h>
|
; (fcn) sym.method_miio_config () | void method_miio_config () {
0x0040c6e0 lui gp, 0x43 |
0x0040c6e4 addiu gp, gp, 0x1620 |
0x0040c6e8 addiu sp, sp, -0x1048 |
0x0040c6ec lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040c6f0 sw ra, 0x1044(sp) | *(var_1044h) = ra;
0x0040c6f4 sw s5, 0x1040(sp) | *(var_1040h) = s5;
0x0040c6f8 sw s4, 0x103c(sp) | *(var_103ch) = s4;
0x0040c6fc sw s3, 0x1038(sp) | *(var_1038h) = s3;
0x0040c700 sw s1, 0x1030(sp) | *(var_1030h) = s1;
0x0040c704 sw s0, 0x102c(sp) | *(var_102ch) = s0;
0x0040c708 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0040c70c sw s2, 0x1034(sp) | *(var_1034h) = s2;
0x0040c710 move s5, a0 | s5 = a0;
0x0040c714 move s4, a1 | s4 = a1;
0x0040c718 move s3, a2 | s3 = a2;
0x0040c71c jalr t9 | t9 ();
0x0040c720 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c724 addiu s0, sp, 0x1020 | s0 = sp + 0x1020;
0x0040c728 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c72c lui a1, 0x41 | a1 = 0x410000;
0x0040c730 move a0, v0 | a0 = v0;
| /* str.params */
0x0040c734 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040c738 move a2, s0 | a2 = s0;
0x0040c73c move s1, v0 | s1 = v0;
0x0040c740 jalr t9 | t9 ();
0x0040c744 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040c748 beqz v0, 0x40c86c |
0x0040c74c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c750 lw a0, 0x1020(sp) | a0 = *(var_1020h);
0x0040c754 lui a1, 0x42 | a1 = "enauth";
| /* str.enauth */
0x0040c758 addiu a1, a1, -0x7a64 |
0x0040c75c move a2, s0 | a2 = s0;
0x0040c760 jalr t9 | t9 ();
0x0040c764 addiu s2, sp, 0x20 | s2 = sp + 0x20;
0x0040c768 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c76c beqz v0, 0x40c890 | goto label_0;
| }
0x0040c770 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c774 lw a0, 0x1020(sp) | a0 = *(var_1020h);
0x0040c778 addiu a1, zero, 3 | a1 = 3;
0x0040c77c jalr t9 | t9 ();
0x0040c780 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c784 bnez v0, 0x40c7a4 |
0x0040c788 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c78c lui a1, 0x42 | a1 = 0x420000;
0x0040c790 addiu a0, zero, 1 | a0 = 1;
| /* str.enauth_param_is_not_int_n */
0x0040c794 addiu a1, a1, -0x7a5c | a1 += -0x7a5c;
0x0040c798 jalr t9 | t9 ();
0x0040c79c j 0x40c890 | goto label_0;
0x0040c7a0 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c7a4 lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040c7a8 lw a0, 0x1020(sp) | a0 = *(var_1020h);
0x0040c7ac jalr t9 | t9 ();
0x0040c7b0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c7b4 lui a1, 0x42 | a1 = 0x420000;
0x0040c7b8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c7bc sltu a2, zero, v0 | a2 = (0 < v0) ? 1 : 0;
0x0040c7c0 addiu a0, zero, 3 | a0 = 3;
| /* str.miIO.config__enauth:__d_n */
0x0040c7c4 addiu a1, a1, -0x7a40 | a1 += -0x7a40;
0x0040c7c8 jalr t9 | t9 ();
0x0040c7cc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c7d0 lui a2, 0x41 | a2 = 0x410000;
0x0040c7d4 lw v0, -0x7f28(gp) | v0 = *(gp);
0x0040c7d8 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
0x0040c7dc sb zero, 0x20b(v0) | *((v0 + 523)) = 0;
0x0040c7e0 lw a3, 0x268(v0) | a3 = *((v0 + 154));
0x0040c7e4 lui v0, 0x41 | v0 = "otd_donot_trust_peer";
| /* str.otd_donot_trust_peer */
0x0040c7e8 addiu v0, v0, 0x5fc4 |
0x0040c7ec sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040c7f0 move a0, s2 | a0 = s2;
0x0040c7f4 addiu a1, zero, 0x1000 | a1 = 0x1000;
| /* str._s_s */
0x0040c7f8 addiu a2, a2, 0x5fbc | a2 += 0x5fbc;
0x0040c7fc jalr t9 | t9 ();
0x0040c800 move s0, v0 | s0 = v0;
0x0040c804 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x0040c808 bgez v0, 0x40c820 |
0x0040c80c lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040c810 move a0, s1 | a0 = s1;
0x0040c814 jalr t9 | t9 ();
0x0040c818 j 0x40c90c | goto label_1;
0x0040c81c move v0, s0 | v0 = s0;
| }
0x0040c820 slti v0, v0, 0x1000 | v0 = (v0 < 0x1000) ? 1 : 0;
0x0040c824 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| if (v0 == 0) {
0x0040c828 beqz v0, 0x40c870 | goto label_2;
| }
0x0040c82c lw t9, -0x7e78(gp) | t9 = sym.imp.fopen64;
0x0040c830 addu s0, s2, s0 | s0 = s2 + s0;
0x0040c834 lui a1, 0x42 | a1 = 0x420000;
0x0040c838 sb zero, (s0) | *(s0) = 0;
0x0040c83c move a0, s2 | a0 = s2;
| /* esilref: 'w+' */
0x0040c840 addiu a1, a1, -0x7a24 | a1 += -0x7a24;
0x0040c844 jalr t9 | t9 ();
0x0040c848 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040c84c bnez v0, 0x40c880 | goto label_3;
| }
0x0040c850 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c854 lui a1, 0x42 | a1 = 0x420000;
0x0040c858 move a0, zero | a0 = 0;
| /* str.cant_create__s:__m_n */
0x0040c85c addiu a1, a1, -0x7a20 | a1 += -0x7a20;
0x0040c860 move a2, s2 | a2 = s2;
0x0040c864 jalr t9 | t9 ();
0x0040c868 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c86c lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
| label_2:
0x0040c870 move a0, s1 | a0 = s1;
0x0040c874 jalr t9 | t9 ();
0x0040c878 j 0x40c90c | goto label_1;
0x0040c87c addiu v0, zero, -1 | v0 = -1;
| label_3:
0x0040c880 lw t9, -0x7de8(gp) | t9 = sym.imp.fclose;
0x0040c884 move a0, v0 | a0 = v0;
0x0040c888 jalr t9 | t9 ();
0x0040c88c lw gp, 0x18(sp) | gp = *(var_18h);
| label_0:
0x0040c890 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040c894 lui a1, 0x41 | a1 = 0x410000;
0x0040c898 move a0, s5 | a0 = s5;
| /* esilref: 'id' */
0x0040c89c addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040c8a0 move a2, s2 | a2 = s2;
0x0040c8a4 jalr t9 | t9 ();
0x0040c8a8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x0040c8ac bltz v0, 0x40c8fc |
0x0040c8b0 sltiu s3, s3, 0x24 | s3 = (s3 < 0x24) ? 1 : 0;
0x0040c8b4 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
| if (s3 != 0) {
0x0040c8b8 beqz s3, 0x40c8e4 |
0x0040c8bc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c8c0 lui a1, 0x41 | a1 = 0x410000;
0x0040c8c4 lui a2, 0x41 | a2 = 0x410000;
0x0040c8c8 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040c8cc addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040c8d0 addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040c8d4 addiu a3, zero, 0x179 | a3 = 0x179;
0x0040c8d8 jalr t9 | t9 ();
0x0040c8dc j 0x40c8fc | goto label_4;
0x0040c8e0 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c8e4 lui a1, 0x42 | a1 = 0x420000;
0x0040c8e8 lw a2, 0x20(sp) | a2 = *(var_20h);
0x0040c8ec move a0, s4 | a0 = s4;
| /* str._id_:_d__result_:__OK__ */
0x0040c8f0 addiu a1, a1, -0x7b34 | a1 += -0x7b34;
0x0040c8f4 jalr t9 | t9 ();
0x0040c8f8 lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_4:
0x0040c8fc lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040c900 move a0, s1 | a0 = s1;
0x0040c904 jalr t9 | t9 ();
0x0040c908 move v0, zero | v0 = 0;
| label_1:
0x0040c90c lw ra, 0x1044(sp) | ra = *(var_1044h);
0x0040c910 lw s5, 0x1040(sp) | s5 = *(var_1040h);
0x0040c914 lw s4, 0x103c(sp) | s4 = *(var_103ch);
0x0040c918 lw s3, 0x1038(sp) | s3 = *(var_1038h);
0x0040c91c lw s2, 0x1034(sp) | s2 = *(var_1034h);
0x0040c920 lw s1, 0x1030(sp) | s1 = *(var_1030h);
0x0040c924 lw s0, 0x102c(sp) | s0 = *(var_102ch);
0x0040c928 addiu sp, sp, 0x1048 |
0x0040c92c 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 @ 0x40ccec */
| #include <stdint.h>
|
; (fcn) sym.method_miio_config_tz () | void method_miio_config_tz () {
0x0040ccec lui gp, 0x43 |
0x0040ccf0 lui v0, 0x42 | v0 = 0x420000;
0x0040ccf4 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040ccf8 lhu v0, -0x7840(v0) | v0 = *((v0 - 15392));
0x0040ccfc addiu sp, sp, -0x88 |
0x0040cd00 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040cd04 sw ra, 0x84(sp) | *(var_84h) = ra;
0x0040cd08 sw s4, 0x7c(sp) | *(var_7ch) = s4;
0x0040cd0c sw s2, 0x74(sp) | *(var_74h) = s2;
0x0040cd10 sw s1, 0x70(sp) | *(var_70h) = s1;
0x0040cd14 sw s0, 0x6c(sp) | *(var_6ch) = s0;
0x0040cd18 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040cd1c move s4, a0 | s4 = a0;
0x0040cd20 sw s5, 0x80(sp) | *(var_80h) = s5;
0x0040cd24 addiu a0, sp, 0x1a | a0 = sp + 0x1a;
0x0040cd28 sw s3, 0x78(sp) | *(var_78h) = s3;
0x0040cd2c move s2, a1 | s2 = a1;
0x0040cd30 move s1, a2 | s1 = a2;
0x0040cd34 move a1, zero | a1 = 0;
0x0040cd38 addiu a2, zero, 0x3e | a2 = 0x3e;
0x0040cd3c sh v0, 0x18(sp) | *(var_18h) = v0;
0x0040cd40 jalr t9 | t9 ();
0x0040cd44 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cd48 lui a1, 0x41 | a1 = 0x410000;
0x0040cd4c lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040cd50 sw zero, 0x58(sp) | *(var_58h) = 0;
0x0040cd54 move a0, s4 | a0 = s4;
| /* esilref: 'id' */
0x0040cd58 addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040cd5c addiu a2, sp, 0x58 | a2 = sp + 0x58;
0x0040cd60 jalr t9 | t9 ();
0x0040cd64 move s0, v0 | s0 = v0;
0x0040cd68 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x0040cd6c bgez v0, 0x40cd8c |
0x0040cd70 lui a1, 0x41 | a1 = 0x410000;
0x0040cd74 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cd78 move a0, zero | a0 = 0;
| /* str.json_verify_get_int_fail_n */
0x0040cd7c addiu a1, a1, 0x5aa4 | a1 += 0x5aa4;
0x0040cd80 jalr t9 | t9 ();
0x0040cd84 j 0x40d064 | goto label_0;
0x0040cd88 move v0, s0 | v0 = s0;
| }
0x0040cd8c sltiu s1, s1, 0x2a | s1 = (s1 < 0x2a) ? 1 : 0;
0x0040cd90 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
| if (s1 != 0) {
0x0040cd94 beqz s1, 0x40cdc0 |
0x0040cd98 lui a1, 0x41 | a1 = 0x410000;
0x0040cd9c lui a2, 0x41 | a2 = 0x410000;
0x0040cda0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cda4 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040cda8 addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040cdac addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040cdb0 addiu a3, zero, 0x1d8 | a3 = 0x1d8;
0x0040cdb4 jalr t9 | t9 ();
0x0040cdb8 j 0x40cf5c | goto label_1;
0x0040cdbc nop |
| }
0x0040cdc0 lw a2, 0x58(sp) | a2 = *(var_58h);
0x0040cdc4 lui s3, 0x42 | s3 = 0x420000;
0x0040cdc8 lui a3, 0x42 | a3 = 0x420000;
| /* str._id_:_d__result_:___s__ */
0x0040cdcc addiu a1, s3, -0x79c4 | a1 = s3 + -0x79c4;
| /* str.ERROR */
0x0040cdd0 addiu a3, a3, -0x79a8 | a3 += -0x79a8;
0x0040cdd4 move a0, s2 | a0 = s2;
0x0040cdd8 jalr t9 | t9 ();
0x0040cddc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cde0 addu v0, s2, v0 | v0 = s2 + v0;
0x0040cde4 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040cde8 move a0, s4 | a0 = s4;
0x0040cdec sb zero, (v0) | *(v0) = 0;
0x0040cdf0 jalr t9 | t9 ();
0x0040cdf4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cdf8 lui a1, 0x41 | a1 = 0x410000;
0x0040cdfc lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040ce00 move a0, v0 | a0 = v0;
| /* str.params */
0x0040ce04 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040ce08 addiu a2, sp, 0x60 | a2 = sp + 0x60;
0x0040ce0c move s1, v0 | s1 = v0;
0x0040ce10 jalr t9 | t9 ();
0x0040ce14 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040ce18 beqz v0, 0x40cf50 |
0x0040ce1c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040ce20 lw a0, 0x60(sp) | a0 = *(var_60h);
0x0040ce24 lui a1, 0x41 | a1 = 0x415bf8;
| /* esilref: 'tz' */
0x0040ce28 addiu a1, a1, 0x5bf8 |
0x0040ce2c addiu a2, sp, 0x5c | a2 = sp + 0x5c;
0x0040ce30 jalr t9 | t9 ();
0x0040ce34 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040ce38 lw a0, 0x5c(sp) | a0 = *(var_5ch);
0x0040ce3c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040ce40 addiu a1, zero, 6 | a1 = 6;
0x0040ce44 jalr t9 | t9 ();
0x0040ce48 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040ce4c beqz v0, 0x40cf38 |
0x0040ce50 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040ce54 lw a0, 0x5c(sp) | a0 = *(var_5ch);
0x0040ce58 jalr t9 | t9 ();
0x0040ce5c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040ce60 move a0, v0 | a0 = v0;
0x0040ce64 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040ce68 move s4, v0 | s4 = v0;
0x0040ce6c jalr t9 | t9 ();
0x0040ce70 move a2, v0 | a2 = v0;
0x0040ce74 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040ce78 bnez v0, 0x40ce98 |
0x0040ce7c lui a1, 0x42 | a1 = 0x420000;
0x0040ce80 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040ce84 move a0, zero | a0 = 0;
| /* str.tz_is_NULL._n */
0x0040ce88 addiu a1, a1, -0x7ba8 | a1 += -0x7ba8;
0x0040ce8c jalr t9 | t9 ();
0x0040ce90 j 0x40cf5c | goto label_1;
0x0040ce94 nop |
| }
0x0040ce98 sltiu v0, v0, 0x40 | v0 = (v0 < 0x40) ? 1 : 0;
0x0040ce9c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| if (v0 == 0) {
0x0040cea0 bnez v0, 0x40cec4 |
0x0040cea4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cea8 lui a1, 0x42 | a1 = 0x420000;
0x0040ceac addiu a0, zero, 1 | a0 = 1;
| /* str.tz_too_long._n */
0x0040ceb0 addiu a1, a1, -0x7b98 | a1 += -0x7b98;
0x0040ceb4 jalr t9 | t9 ();
0x0040ceb8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cebc addiu a2, zero, 0x3f | a2 = 0x3f;
0x0040cec0 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| }
0x0040cec4 addiu s0, sp, 0x18 | s0 = sp + 0x18;
0x0040cec8 move a0, s0 | a0 = s0;
0x0040cecc move a1, s4 | a1 = s4;
0x0040ced0 jalr t9 | t9 ();
0x0040ced4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040ced8 lui a1, 0x42 | a1 = 0x420000;
0x0040cedc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| /* str.tz_s_n */
0x0040cee0 addiu a1, a1, -0x7b88 | a1 += -0x7b88;
0x0040cee4 move a2, s0 | a2 = s0;
0x0040cee8 addiu a0, zero, 3 | a0 = 3;
0x0040ceec jalr t9 | t9 ();
0x0040cef0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cef4 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040cef8 move a0, s1 | a0 = s1;
0x0040cefc jalr t9 | t9 ();
0x0040cf00 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cf04 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040cf08 move a0, s0 | a0 = s0;
0x0040cf0c jalr t9 | t9 ();
0x0040cf10 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cf14 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040cf18 addiu a0, v0, 0x35 | a0 = v0 + 0x35;
0x0040cf1c jalr t9 | t9 ();
0x0040cf20 move s1, v0 | s1 = v0;
0x0040cf24 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cf28 addiu v0, zero, -1 | v0 = -1;
| if (s1 != 0) {
0x0040cf2c bnez s1, 0x40cf64 | goto label_2;
| }
0x0040cf30 j 0x40d068 | goto label_3;
0x0040cf34 lw ra, 0x84(sp) | ra = *(var_84h);
| }
0x0040cf38 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cf3c lui a1, 0x42 | a1 = 0x420000;
0x0040cf40 move a0, zero | a0 = 0;
| /* str.tz_is_not_a_string_n */
0x0040cf44 addiu a1, a1, -0x7b80 | a1 += -0x7b80;
0x0040cf48 jalr t9 | t9 ();
0x0040cf4c lw gp, 0x10(sp) | gp = *(var_10h);
| }
0x0040cf50 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040cf54 move a0, s1 | a0 = s1;
0x0040cf58 jalr t9 | t9 ();
| label_1:
0x0040cf5c j 0x40d064 | goto label_0;
0x0040cf60 addiu v0, zero, -1 | v0 = -1;
| label_2:
0x0040cf64 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040cf68 lui a1, 0x42 | a1 = 0x420000;
0x0040cf6c move a2, s0 | a2 = s0;
0x0040cf70 move a0, s1 | a0 = s1;
| /* str._method_:__internal.config_tz___params_:_tz_:__s_ */
0x0040cf74 addiu a1, a1, -0x79a0 | a1 += -0x79a0;
0x0040cf78 jalr t9 | t9 ();
0x0040cf7c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cf80 addu v0, s1, v0 | v0 = s1 + v0;
0x0040cf84 lw s4, -0x7f28(gp) | s4 = *(gp);
0x0040cf88 sb zero, (v0) | *(v0) = 0;
0x0040cf8c lw s0, 0x2d4(s4) | s0 = *((s4 + 181));
0x0040cf90 lui s5, 0x42 | s5 = 0x420000;
| if (s0 > 0) {
0x0040cf94 blez s0, 0x40d034 |
0x0040cf98 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040cf9c move a0, s1 | a0 = s1;
0x0040cfa0 jalr t9 | t9 ();
0x0040cfa4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cfa8 move a0, s0 | a0 = s0;
0x0040cfac lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x0040cfb0 move a1, s1 | a1 = s1;
0x0040cfb4 move a2, v0 | a2 = v0;
0x0040cfb8 jalr t9 | t9 ();
0x0040cfbc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cfc0 lui a1, 0x42 | a1 = 0x420000;
0x0040cfc4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cfc8 move s0, v0 | s0 = v0;
0x0040cfcc addiu a0, zero, 2 | a0 = 2;
| /* str._s__:ret_is__d_n */
0x0040cfd0 addiu a1, a1, -0x7968 | a1 += -0x7968;
| /* str.method_miio_config_tz */
0x0040cfd4 addiu a2, s5, -0x777c | a2 = s5 + -0x777c;
0x0040cfd8 move a3, v0 | a3 = v0;
0x0040cfdc jalr t9 | t9 ();
0x0040cfe0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (s0 < 0) {
0x0040cfe4 bgez s0, 0x40d004 |
0x0040cfe8 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x0040cfec lw a1, 0x2d4(s4) | a1 = *((s4 + 181));
0x0040cff0 move a0, s4 | a0 = s4;
0x0040cff4 jalr t9 | t9 ();
0x0040cff8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cffc j 0x40d054 | goto label_4;
0x0040d000 sw zero, 0x2d4(s4) | *((s4 + 181)) = 0;
| }
0x0040d004 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040d008 lw a2, 0x58(sp) | a2 = *(var_58h);
0x0040d00c lui a3, 0x42 | a3 = 0x420000;
0x0040d010 move a0, s2 | a0 = s2;
| /* str._id_:_d__result_:___s__ */
0x0040d014 addiu a1, s3, -0x79c4 | a1 = s3 + -0x79c4;
| /* esilref: 'OK' */
0x0040d018 addiu a3, a3, -0x7958 | a3 += -0x7958;
0x0040d01c jalr t9 | t9 ();
0x0040d020 addu s2, s2, v0 | s2 += v0;
0x0040d024 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d028 move s0, v0 | s0 = v0;
0x0040d02c j 0x40d054 | goto label_4;
0x0040d030 sb zero, (s2) | *(s2) = 0;
| }
0x0040d034 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d038 lui a1, 0x42 | a1 = 0x420000;
0x0040d03c addiu a0, zero, 1 | a0 = 1;
| /* str._s__:No_helper_script__n */
0x0040d040 addiu a1, a1, -0x7954 | a1 += -0x7954;
| /* str.method_miio_config_tz */
0x0040d044 addiu a2, s5, -0x777c | a2 = s5 + -0x777c;
0x0040d048 jalr t9 | t9 ();
0x0040d04c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d050 addiu s0, zero, -1 | s0 = -1;
| label_4:
0x0040d054 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x0040d058 move a0, s1 | a0 = s1;
0x0040d05c jalr t9 | t9 ();
0x0040d060 move v0, s0 | v0 = s0;
| label_0:
0x0040d064 lw ra, 0x84(sp) | ra = *(var_84h);
| label_3:
0x0040d068 lw s5, 0x80(sp) | s5 = *(var_80h);
0x0040d06c lw s4, 0x7c(sp) | s4 = *(var_7ch);
0x0040d070 lw s3, 0x78(sp) | s3 = *(var_78h);
0x0040d074 lw s2, 0x74(sp) | s2 = *(var_74h);
0x0040d078 lw s1, 0x70(sp) | s1 = *(var_70h);
0x0040d07c lw s0, 0x6c(sp) | s0 = *(var_6ch);
0x0040d080 addiu sp, sp, 0x88 |
0x0040d084 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 @ 0x40d088 */
| #include <stdint.h>
|
; (fcn) sym.method_miio_config_loglevel () | void method_miio_config_loglevel () {
0x0040d088 lui gp, 0x43 |
0x0040d08c addiu sp, sp, -0x40 |
0x0040d090 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040d094 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040d098 sw s4, 0x38(sp) | *(var_38h) = s4;
0x0040d09c lui a3, 0x42 | a3 = 0x420000;
0x0040d0a0 lui s4, 0x42 | s4 = 0x420000;
0x0040d0a4 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x0040d0a8 sw s3, 0x34(sp) | *(var_34h) = s3;
0x0040d0ac sw s2, 0x30(sp) | *(var_30h) = s2;
0x0040d0b0 sw s1, 0x2c(sp) | *(var_2ch) = s1;
0x0040d0b4 sw s0, 0x28(sp) | *(var_28h) = s0;
0x0040d0b8 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d0bc move s2, a0 | s2 = a0;
0x0040d0c0 move s1, a1 | s1 = a1;
0x0040d0c4 move a0, a1 | a0 = a1;
| /* str.ERROR */
0x0040d0c8 addiu a3, a3, -0x79a8 | a3 += -0x79a8;
| /* str._id_:_d__result_:___s__ */
0x0040d0cc addiu a1, s4, -0x79c4 | a1 = s4 + -0x79c4;
0x0040d0d0 move s3, a2 | s3 = a2;
0x0040d0d4 sw zero, 0x18(sp) | *(var_18h) = 0;
0x0040d0d8 move a2, zero | a2 = 0;
0x0040d0dc jalr t9 | t9 ();
0x0040d0e0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d0e4 addu v0, s1, v0 | v0 = s1 + v0;
0x0040d0e8 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040d0ec lui a1, 0x41 | a1 = 0x410000;
0x0040d0f0 sb zero, (v0) | *(v0) = 0;
0x0040d0f4 move a0, s2 | a0 = s2;
| /* esilref: 'id' */
0x0040d0f8 addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040d0fc addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d100 jalr t9 | t9 ();
0x0040d104 move s0, v0 | s0 = v0;
0x0040d108 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x0040d10c bgez v0, 0x40d12c |
0x0040d110 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d114 lui a1, 0x41 | a1 = 0x410000;
0x0040d118 move a0, zero | a0 = 0;
| /* str.json_verify_get_int_fail_n */
0x0040d11c addiu a1, a1, 0x5aa4 | a1 += 0x5aa4;
0x0040d120 jalr t9 | t9 ();
0x0040d124 j 0x40d250 | goto label_1;
0x0040d128 move v0, s0 | v0 = s0;
| }
0x0040d12c sltiu s3, s3, 0x2a | s3 = (s3 < 0x2a) ? 1 : 0;
0x0040d130 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
| if (s3 != 0) {
0x0040d134 beqz s3, 0x40d160 |
0x0040d138 lui a1, 0x41 | a1 = 0x410000;
0x0040d13c lui a2, 0x41 | a2 = 0x410000;
0x0040d140 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d144 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040d148 addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040d14c addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040d150 addiu a3, zero, 0x22c | a3 = 0x22c;
0x0040d154 jalr t9 | t9 ();
0x0040d158 j 0x40d19c | goto label_0;
0x0040d15c nop |
| }
0x0040d160 move a0, s2 | a0 = s2;
0x0040d164 jalr t9 | t9 ();
0x0040d168 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d16c lui a1, 0x41 | a1 = 0x410000;
0x0040d170 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d174 move a0, v0 | a0 = v0;
| /* str.params */
0x0040d178 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040d17c addiu a2, sp, 0x20 | a2 = sp + 0x20;
0x0040d180 move s0, v0 | s0 = v0;
0x0040d184 jalr t9 | t9 ();
0x0040d188 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d18c bnez v0, 0x40d1a4 |
| while (v0 == 0) {
0x0040d190 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d194 move a0, s0 | a0 = s0;
0x0040d198 jalr t9 | t9 ();
| label_0:
0x0040d19c j 0x40d250 | goto label_1;
0x0040d1a0 addiu v0, zero, -1 | v0 = -1;
0x0040d1a4 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d1a8 lw a0, 0x20(sp) | a0 = *(var_20h);
0x0040d1ac lui a1, 0x41 | a1 = 0x416d2c;
| /* esilref: 'loglevel' */
0x0040d1b0 addiu a1, a1, 0x6d2c |
0x0040d1b4 addiu a2, sp, 0x1c | a2 = sp + 0x1c;
0x0040d1b8 jalr t9 | t9 ();
0x0040d1bc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d1c0 beqz v0, 0x40d190 |
| }
0x0040d1c4 lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040d1c8 lw a0, 0x1c(sp) | a0 = *(var_1ch);
0x0040d1cc jalr t9 | t9 ();
0x0040d1d0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d1d4 move s3, v0 | s3 = v0;
0x0040d1d8 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d1dc move a0, s0 | a0 = s0;
0x0040d1e0 jalr t9 | t9 ();
0x0040d1e4 sltiu v0, s3, 5 | v0 = (s3 < 5) ? 1 : 0;
0x0040d1e8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d1ec bnez v0, 0x40d210 |
0x0040d1f0 lui a1, 0x42 | a1 = 0x420000;
0x0040d1f4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d1f8 move a0, zero | a0 = 0;
| /* str.json_verify_get_int_fail:d_n */
0x0040d1fc addiu a1, a1, -0x793c | a1 += -0x793c;
0x0040d200 move a2, s3 | a2 = s3;
0x0040d204 jalr t9 | t9 ();
0x0040d208 j 0x40d19c | goto label_0;
0x0040d20c nop |
| }
0x0040d210 lw v0, -0x7f34(gp) | v0 = *(gp);
0x0040d214 lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
0x0040d218 lw a0, -0x7f28(gp) | a0 = *(gp);
0x0040d21c sw s3, (v0) | *(v0) = s3;
0x0040d220 move a1, s2 | a1 = s2;
0x0040d224 jalr t9 | t9 ();
0x0040d228 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d22c lw a2, 0x18(sp) | a2 = *(var_18h);
0x0040d230 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040d234 lui a3, 0x42 | a3 = 0x420000;
0x0040d238 move a0, s1 | a0 = s1;
| /* str._id_:_d__result_:___s__ */
0x0040d23c addiu a1, s4, -0x79c4 | a1 = s4 + -0x79c4;
| /* esilref: 'OK' */
0x0040d240 addiu a3, a3, -0x7958 | a3 += -0x7958;
0x0040d244 jalr t9 | t9 ();
0x0040d248 addu s1, s1, v0 | s1 += v0;
0x0040d24c sb zero, (s1) | *(s1) = 0;
| label_1:
0x0040d250 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x0040d254 lw s4, 0x38(sp) | s4 = *(var_38h);
0x0040d258 lw s3, 0x34(sp) | s3 = *(var_34h);
0x0040d25c lw s2, 0x30(sp) | s2 = *(var_30h);
0x0040d260 lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x0040d264 lw s0, 0x28(sp) | s0 = *(var_28h);
0x0040d268 addiu sp, sp, 0x40 |
0x0040d26c 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 @ 0x40d088 */
| #include <stdint.h>
|
; (fcn) sym.method_miio_config_loglevel () | void method_miio_config_loglevel () {
0x0040d088 lui gp, 0x43 |
0x0040d08c addiu sp, sp, -0x40 |
0x0040d090 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040d094 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040d098 sw s4, 0x38(sp) | *(var_38h) = s4;
0x0040d09c lui a3, 0x42 | a3 = 0x420000;
0x0040d0a0 lui s4, 0x42 | s4 = 0x420000;
0x0040d0a4 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x0040d0a8 sw s3, 0x34(sp) | *(var_34h) = s3;
0x0040d0ac sw s2, 0x30(sp) | *(var_30h) = s2;
0x0040d0b0 sw s1, 0x2c(sp) | *(var_2ch) = s1;
0x0040d0b4 sw s0, 0x28(sp) | *(var_28h) = s0;
0x0040d0b8 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040d0bc move s2, a0 | s2 = a0;
0x0040d0c0 move s1, a1 | s1 = a1;
0x0040d0c4 move a0, a1 | a0 = a1;
| /* str.ERROR */
0x0040d0c8 addiu a3, a3, -0x79a8 | a3 += -0x79a8;
| /* str._id_:_d__result_:___s__ */
0x0040d0cc addiu a1, s4, -0x79c4 | a1 = s4 + -0x79c4;
0x0040d0d0 move s3, a2 | s3 = a2;
0x0040d0d4 sw zero, 0x18(sp) | *(var_18h) = 0;
0x0040d0d8 move a2, zero | a2 = 0;
0x0040d0dc jalr t9 | t9 ();
0x0040d0e0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d0e4 addu v0, s1, v0 | v0 = s1 + v0;
0x0040d0e8 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040d0ec lui a1, 0x41 | a1 = 0x410000;
0x0040d0f0 sb zero, (v0) | *(v0) = 0;
0x0040d0f4 move a0, s2 | a0 = s2;
| /* esilref: 'id' */
0x0040d0f8 addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040d0fc addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040d100 jalr t9 | t9 ();
0x0040d104 move s0, v0 | s0 = v0;
0x0040d108 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x0040d10c bgez v0, 0x40d12c |
0x0040d110 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d114 lui a1, 0x41 | a1 = 0x410000;
0x0040d118 move a0, zero | a0 = 0;
| /* str.json_verify_get_int_fail_n */
0x0040d11c addiu a1, a1, 0x5aa4 | a1 += 0x5aa4;
0x0040d120 jalr t9 | t9 ();
0x0040d124 j 0x40d250 | goto label_1;
0x0040d128 move v0, s0 | v0 = s0;
| }
0x0040d12c sltiu s3, s3, 0x2a | s3 = (s3 < 0x2a) ? 1 : 0;
0x0040d130 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
| if (s3 != 0) {
0x0040d134 beqz s3, 0x40d160 |
0x0040d138 lui a1, 0x41 | a1 = 0x410000;
0x0040d13c lui a2, 0x41 | a2 = 0x410000;
0x0040d140 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d144 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040d148 addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040d14c addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040d150 addiu a3, zero, 0x22c | a3 = 0x22c;
0x0040d154 jalr t9 | t9 ();
0x0040d158 j 0x40d19c | goto label_0;
0x0040d15c nop |
| }
0x0040d160 move a0, s2 | a0 = s2;
0x0040d164 jalr t9 | t9 ();
0x0040d168 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d16c lui a1, 0x41 | a1 = 0x410000;
0x0040d170 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d174 move a0, v0 | a0 = v0;
| /* str.params */
0x0040d178 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040d17c addiu a2, sp, 0x20 | a2 = sp + 0x20;
0x0040d180 move s0, v0 | s0 = v0;
0x0040d184 jalr t9 | t9 ();
0x0040d188 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d18c bnez v0, 0x40d1a4 |
| while (v0 == 0) {
0x0040d190 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d194 move a0, s0 | a0 = s0;
0x0040d198 jalr t9 | t9 ();
| label_0:
0x0040d19c j 0x40d250 | goto label_1;
0x0040d1a0 addiu v0, zero, -1 | v0 = -1;
0x0040d1a4 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040d1a8 lw a0, 0x20(sp) | a0 = *(var_20h);
0x0040d1ac lui a1, 0x41 | a1 = 0x416d2c;
| /* esilref: 'loglevel' */
0x0040d1b0 addiu a1, a1, 0x6d2c |
0x0040d1b4 addiu a2, sp, 0x1c | a2 = sp + 0x1c;
0x0040d1b8 jalr t9 | t9 ();
0x0040d1bc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d1c0 beqz v0, 0x40d190 |
| }
0x0040d1c4 lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040d1c8 lw a0, 0x1c(sp) | a0 = *(var_1ch);
0x0040d1cc jalr t9 | t9 ();
0x0040d1d0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d1d4 move s3, v0 | s3 = v0;
0x0040d1d8 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040d1dc move a0, s0 | a0 = s0;
0x0040d1e0 jalr t9 | t9 ();
0x0040d1e4 sltiu v0, s3, 5 | v0 = (s3 < 5) ? 1 : 0;
0x0040d1e8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040d1ec bnez v0, 0x40d210 |
0x0040d1f0 lui a1, 0x42 | a1 = 0x420000;
0x0040d1f4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d1f8 move a0, zero | a0 = 0;
| /* str.json_verify_get_int_fail:d_n */
0x0040d1fc addiu a1, a1, -0x793c | a1 += -0x793c;
0x0040d200 move a2, s3 | a2 = s3;
0x0040d204 jalr t9 | t9 ();
0x0040d208 j 0x40d19c | goto label_0;
0x0040d20c nop |
| }
0x0040d210 lw v0, -0x7f34(gp) | v0 = *(gp);
0x0040d214 lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
0x0040d218 lw a0, -0x7f28(gp) | a0 = *(gp);
0x0040d21c sw s3, (v0) | *(v0) = s3;
0x0040d220 move a1, s2 | a1 = s2;
0x0040d224 jalr t9 | t9 ();
0x0040d228 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d22c lw a2, 0x18(sp) | a2 = *(var_18h);
0x0040d230 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040d234 lui a3, 0x42 | a3 = 0x420000;
0x0040d238 move a0, s1 | a0 = s1;
| /* str._id_:_d__result_:___s__ */
0x0040d23c addiu a1, s4, -0x79c4 | a1 = s4 + -0x79c4;
| /* esilref: 'OK' */
0x0040d240 addiu a3, a3, -0x7958 | a3 += -0x7958;
0x0040d244 jalr t9 | t9 ();
0x0040d248 addu s1, s1, v0 | s1 += v0;
0x0040d24c sb zero, (s1) | *(s1) = 0;
| label_1:
0x0040d250 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x0040d254 lw s4, 0x38(sp) | s4 = *(var_38h);
0x0040d258 lw s3, 0x34(sp) | s3 = *(var_34h);
0x0040d25c lw s2, 0x30(sp) | s2 = *(var_30h);
0x0040d260 lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x0040d264 lw s0, 0x28(sp) | s0 = *(var_28h);
0x0040d268 addiu sp, sp, 0x40 |
0x0040d26c 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 @ 0x40bd70 */
| #include <stdint.h>
|
; (fcn) sym.method_miio_config_router () | void method_miio_config_router () {
0x0040bd70 lui gp, 0x43 |
0x0040bd74 addiu gp, gp, 0x1620 |
0x0040bd78 addiu sp, sp, -0x140 |
0x0040bd7c lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040bd80 sw ra, 0x13c(sp) | *(var_13ch) = ra;
0x0040bd84 sw s7, 0x134(sp) | *(var_134h) = s7;
0x0040bd88 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0040bd8c sw a0, 0x140(sp) | *(arg_140h) = a0;
0x0040bd90 sw a1, 0x144(sp) | *(arg_144h) = a1;
0x0040bd94 sw a2, 0x148(sp) | *(arg_148h) = a2;
0x0040bd98 sw fp, 0x138(sp) | *(var_138h) = fp;
0x0040bd9c sw s6, 0x130(sp) | *(var_130h) = s6;
0x0040bda0 sw s5, 0x12c(sp) | *(var_12ch) = s5;
0x0040bda4 sw s4, 0x128(sp) | *(var_128h) = s4;
0x0040bda8 sw s3, 0x124(sp) | *(var_124h) = s3;
0x0040bdac sw s2, 0x120(sp) | *(var_120h) = s2;
0x0040bdb0 sw s1, 0x11c(sp) | *(var_11ch) = s1;
0x0040bdb4 sw s0, 0x118(sp) | *(var_118h) = s0;
0x0040bdb8 jalr t9 | t9 ();
0x0040bdbc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bdc0 lui a1, 0x41 | a1 = 0x410000;
0x0040bdc4 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040bdc8 move a0, v0 | a0 = v0;
| /* str.params */
0x0040bdcc addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040bdd0 addiu a2, sp, 0x104 | a2 = sp + 0x104;
0x0040bdd4 move s7, v0 | s7 = v0;
0x0040bdd8 jalr t9 | t9 ();
0x0040bddc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040bde0 bnez v0, 0x40bdf8 |
0x0040bde4 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040bde8 move a0, s7 | a0 = s7;
0x0040bdec jalr t9 | t9 ();
0x0040bdf0 j 0x40c560 | goto label_0;
0x0040bdf4 addiu v0, zero, -1 | v0 = -1;
| }
0x0040bdf8 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040bdfc addiu s5, sp, 0xa0 | s5 = sp + 0xa0;
0x0040be00 move a0, s5 | a0 = s5;
0x0040be04 move a1, zero | a1 = 0;
0x0040be08 addiu a2, zero, 0x40 | a2 = 0x40;
0x0040be0c jalr t9 | t9 ();
0x0040be10 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040be14 addiu v0, sp, 0x60 | v0 = sp + 0x60;
0x0040be18 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040be1c move a0, v0 | a0 = v0;
0x0040be20 move a1, zero | a1 = 0;
0x0040be24 addiu a2, zero, 0x40 | a2 = 0x40;
0x0040be28 sw v0, 0x10c(sp) | *(var_10ch) = v0;
0x0040be2c jalr t9 | t9 ();
0x0040be30 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040be34 addiu v1, sp, 0x20 | v1 = sp + 0x20;
0x0040be38 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040be3c move a0, v1 | a0 = v1;
0x0040be40 sw v1, 0x108(sp) | *(var_108h) = v1;
0x0040be44 move a1, zero | a1 = 0;
0x0040be48 addiu a2, zero, 0x40 | a2 = 0x40;
0x0040be4c jalr t9 | t9 ();
0x0040be50 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040be54 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040be58 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040be5c addiu s4, sp, 0x100 | s4 = sp + 0x100;
0x0040be60 lui a1, 0x42 | a1 = "ssid";
| /* str.ssid */
0x0040be64 addiu a1, a1, -0x7d50 |
0x0040be68 move a2, s4 | a2 = s4;
0x0040be6c jalr t9 | t9 ();
0x0040be70 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040be74 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040be78 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040be7c addiu a1, zero, 6 | a1 = 6;
0x0040be80 jalr t9 | t9 ();
0x0040be84 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040be88 bnez v0, 0x40be9c |
0x0040be8c lui a1, 0x42 | a1 = 0x420000;
0x0040be90 move a0, zero | a0 = 0;
0x0040be94 j 0x40bfe8 | goto label_1;
| /* str.ssid_is_not_a_string_n */
0x0040be98 addiu a1, a1, -0x7d48 | a1 += -0x7d48;
| }
0x0040be9c lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040bea0 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040bea4 jalr t9 | t9 ();
0x0040bea8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040beac move a0, v0 | a0 = v0;
0x0040beb0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040beb4 move s0, v0 | s0 = v0;
0x0040beb8 jalr t9 | t9 ();
0x0040bebc sltiu v1, v0, 0x40 | v1 = (v0 < 0x40) ? 1 : 0;
0x0040bec0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bec4 move a2, v0 | a2 = v0;
| if (v1 == 0) {
0x0040bec8 bnez v1, 0x40bee8 |
0x0040becc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bed0 lui a1, 0x42 | a1 = 0x420000;
0x0040bed4 addiu a0, zero, 1 | a0 = 1;
| /* str.ssid_too_long._n */
0x0040bed8 addiu a1, a1, -0x7d30 | a1 += -0x7d30;
0x0040bedc jalr t9 | t9 ();
0x0040bee0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bee4 addiu a2, zero, 0x3f | a2 = 0x3f;
| }
0x0040bee8 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040beec move a0, s5 | a0 = s5;
0x0040bef0 move a1, s0 | a1 = s0;
0x0040bef4 jalr t9 | t9 ();
0x0040bef8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040befc lui a1, 0x42 | a1 = 0x420000;
0x0040bf00 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bf04 addiu a0, zero, 3 | a0 = 3;
| /* str.ssid_s_n */
0x0040bf08 addiu a1, a1, -0x7d20 | a1 += -0x7d20;
0x0040bf0c move a2, s5 | a2 = s5;
0x0040bf10 jalr t9 | t9 ();
0x0040bf14 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bf18 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040bf1c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040bf20 lui a1, 0x41 | a1 = 0x417ee8;
| /* esilref: 'uid' */
0x0040bf24 addiu a1, a1, 0x7ee8 |
0x0040bf28 move a2, s4 | a2 = s4;
0x0040bf2c jalr t9 | t9 ();
0x0040bf30 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040bf34 beqz v0, 0x40bf90 |
0x0040bf38 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040bf3c lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040bf40 addiu a1, zero, 3 | a1 = 3;
0x0040bf44 jalr t9 | t9 ();
0x0040bf48 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040bf4c beqz v0, 0x40bf90 | goto label_2;
| }
0x0040bf50 lw t9, -0x7d34(gp) | t9 = sym.imp.json_object_get_int64;
0x0040bf54 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040bf58 jalr t9 | t9 ();
0x0040bf5c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bf60 lui a1, 0x42 | a1 = 0x420000;
0x0040bf64 lw a0, -0x7f28(gp) | a0 = *(gp);
0x0040bf68 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bf6c sw v0, 0x2e8(a0) | *((a0 + 186)) = v0;
0x0040bf70 sw v1, 0x2ec(a0) | *((a0 + 187)) = v1;
| /* str.uid_llu_n */
0x0040bf74 addiu a1, a1, -0x7d14 | a1 += -0x7d14;
0x0040bf78 addiu a0, zero, 3 | a0 = 3;
0x0040bf7c move a2, v0 | a2 = v0;
0x0040bf80 move a3, v1 | a3 = v1;
0x0040bf84 jalr t9 | t9 ();
0x0040bf88 j 0x40bfa8 | goto label_3;
0x0040bf8c lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_2:
0x0040bf90 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bf94 lui a1, 0x42 | a1 = 0x420000;
0x0040bf98 addiu a0, zero, 1 | a0 = 1;
| /* str.uid_not_found__or_uid_not_int._n */
0x0040bf9c addiu a1, a1, -0x7d08 | a1 += -0x7d08;
0x0040bfa0 jalr t9 | t9 ();
0x0040bfa4 lw gp, 0x18(sp) | gp = *(var_18h);
| label_3:
0x0040bfa8 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040bfac lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040bfb0 lui a1, 0x42 | a1 = "passwd";
| /* str.passwd */
0x0040bfb4 addiu a1, a1, -0x7ce8 |
0x0040bfb8 move a2, s4 | a2 = s4;
0x0040bfbc jalr t9 | t9 ();
0x0040bfc0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040bfc4 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040bfc8 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040bfcc addiu a1, zero, 6 | a1 = 6;
0x0040bfd0 jalr t9 | t9 ();
0x0040bfd4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040bfd8 bnez v0, 0x40c000 | goto label_4;
| }
0x0040bfdc lui a1, 0x42 | a1 = 0x420000;
0x0040bfe0 addiu a0, zero, 3 | a0 = 3;
| /* str.passwd_is_not_a_string_n */
0x0040bfe4 addiu a1, a1, -0x7ce0 | a1 += -0x7ce0;
| label_1:
0x0040bfe8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040bfec jalr t9 | t9 ();
0x0040bff0 nop |
0x0040bff4 lw gp, 0x18(sp) | gp = *(var_18h);
| do {
0x0040bff8 j 0x40c550 | goto label_5;
0x0040bffc addiu s0, zero, -1 | s0 = -1;
| label_4:
0x0040c000 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040c004 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c008 jalr t9 | t9 ();
0x0040c00c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c010 move a0, v0 | a0 = v0;
0x0040c014 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c018 move s0, v0 | s0 = v0;
0x0040c01c jalr t9 | t9 ();
0x0040c020 sltiu v1, v0, 0x40 | v1 = (v0 < 0x40) ? 1 : 0;
0x0040c024 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c028 move a2, v0 | a2 = v0;
| if (v1 == 0) {
0x0040c02c bnez v1, 0x40c04c |
0x0040c030 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c034 lui a1, 0x42 | a1 = 0x420000;
0x0040c038 addiu a0, zero, 1 | a0 = 1;
| /* str.passwd_too_long._n */
0x0040c03c addiu a1, a1, -0x7cc8 | a1 += -0x7cc8;
0x0040c040 jalr t9 | t9 ();
0x0040c044 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c048 addiu a2, zero, 0x3f | a2 = 0x3f;
| }
0x0040c04c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c050 addiu a0, sp, 0x60 | a0 = sp + 0x60;
0x0040c054 move a1, s0 | a1 = s0;
0x0040c058 jalr t9 | t9 ();
0x0040c05c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c060 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040c064 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c068 lui a1, 0x42 | a1 = "bind_key";
| /* str.bind_key */
0x0040c06c addiu a1, a1, -0x7cb4 |
0x0040c070 move a2, s4 | a2 = s4;
0x0040c074 jalr t9 | t9 ();
0x0040c078 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c07c lw s2, -0x7f28(gp) | s2 = *(gp);
| if (v0 == 0) {
0x0040c080 beqz v0, 0x40c11c | goto label_6;
| }
0x0040c084 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c088 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c08c addiu a1, zero, 6 | a1 = 6;
0x0040c090 jalr t9 | t9 ();
0x0040c094 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c098 beqz v0, 0x40c11c | goto label_6;
| }
0x0040c09c lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040c0a0 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c0a4 jalr t9 | t9 ();
0x0040c0a8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c0ac move a0, v0 | a0 = v0;
0x0040c0b0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c0b4 move s1, v0 | s1 = v0;
0x0040c0b8 jalr t9 | t9 ();
0x0040c0bc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c0c0 addiu s3, v0, 1 | s3 = v0 + 1;
0x0040c0c4 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040c0c8 move a0, s3 | a0 = s3;
0x0040c0cc move s0, v0 | s0 = v0;
0x0040c0d0 jalr t9 | t9 ();
0x0040c0d4 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c0d8 sw v0, 0x39c(s2) | *((s2 + 231)) = v0;
| if (v0 != 0) {
0x0040c0dc bnez v0, 0x40c100 | goto label_7;
| }
0x0040c0e0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c0e4 lui a1, 0x42 | a1 = 0x420000;
0x0040c0e8 move a0, zero | a0 = 0;
| /* str.malloc_length__d__error:__m_n */
0x0040c0ec addiu a1, a1, -0x7ca8 | a1 += -0x7ca8;
0x0040c0f0 move a2, s3 | a2 = s3;
0x0040c0f4 jalr t9 | t9 ();
0x0040c0f8 j 0x40bff8 |
| } while (1);
0x0040c0fc lw gp, 0x18(sp) | gp = *(var_18h);
| label_7:
0x0040c100 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c104 move a0, v0 | a0 = v0;
0x0040c108 move a1, s1 | a1 = s1;
0x0040c10c move a2, s0 | a2 = s0;
0x0040c110 jalr t9 | t9 ();
0x0040c114 j 0x40c134 | goto label_8;
0x0040c118 lw gp, 0x18(sp) | gp = *(var_18h);
| label_6:
0x0040c11c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c120 lui a1, 0x42 | a1 = 0x420000;
0x0040c124 addiu a0, zero, 3 | a0 = 3;
| /* str.bind_key_is_not_a_string_n */
0x0040c128 addiu a1, a1, -0x7c88 | a1 += -0x7c88;
0x0040c12c jalr t9 | t9 ();
0x0040c130 lw gp, 0x18(sp) | gp = *(var_18h);
| label_8:
0x0040c134 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040c138 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c13c lui a1, 0x42 | a1 = "country_domain";
| /* str.country_domain */
0x0040c140 addiu a1, a1, -0x7c6c |
0x0040c144 move a2, s4 | a2 = s4;
0x0040c148 jalr t9 | t9 ();
0x0040c14c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c150 move s6, v0 | s6 = v0;
0x0040c154 lw v0, -0x7f28(gp) | v0 = *(gp);
0x0040c158 addiu s1, s2, 0x224 | s1 = s2 + 0x224;
0x0040c15c lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040c160 sw zero, 0x21c(s2) | *((s2 + 135)) = 0;
0x0040c164 move a0, s1 | a0 = s1;
0x0040c168 move a1, zero | a1 = 0;
0x0040c16c addiu a2, zero, 0x20 | a2 = 0x20;
0x0040c170 sw zero, 0x220(v0) | *((v0 + 136)) = 0;
0x0040c174 jalr t9 | t9 ();
0x0040c178 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c17c addiu s0, s2, 0x244 | s0 = s2 + 0x244;
0x0040c180 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040c184 move a0, s0 | a0 = s0;
0x0040c188 move a1, zero | a1 = 0;
0x0040c18c addiu a2, zero, 0x20 | a2 = 0x20;
0x0040c190 jalr t9 | t9 ();
0x0040c194 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c198 lui a1, 0x41 | a1 = 0x410000;
0x0040c19c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c1a0 move a0, s1 | a0 = s1;
| /* str.ott.io.mi.com */
0x0040c1a4 addiu a1, a1, 0x67a4 | a1 += 0x67a4;
0x0040c1a8 addiu a2, zero, 0xd | a2 = 0xd;
0x0040c1ac jalr t9 | t9 ();
0x0040c1b0 lui v1, 0x41 | v1 = 0x410000;
0x0040c1b4 lw v0, 0x67b4(v1) | v0 = *((v1 + 6637));
| /* str.ot.io.mi.com */
0x0040c1b8 addiu v1, v1, 0x67b4 | v1 += 0x67b4;
0x0040c1bc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c1c0 sw v0, 0x244(s2) | *((s2 + 145)) = v0;
0x0040c1c4 lw v0, 4(v1) | v0 = *((v1 + 1));
0x0040c1c8 addiu s3, sp, 0xe0 | s3 = sp + 0xe0;
0x0040c1cc sw v0, 4(s0) | *((s0 + 1)) = v0;
0x0040c1d0 lw v0, 8(v1) | v0 = *((v1 + 2));
0x0040c1d4 sw v0, 8(s0) | *((s0 + 2)) = v0;
| if (s6 != 0) {
0x0040c1d8 beqz s6, 0x40c38c |
0x0040c1dc lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c1e0 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c1e4 addiu a1, zero, 6 | a1 = 6;
0x0040c1e8 jalr t9 | t9 ();
0x0040c1ec lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c1f0 beqz v0, 0x40c38c | goto label_9;
| }
0x0040c1f4 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040c1f8 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c1fc jalr t9 | t9 ();
0x0040c200 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c204 move a0, v0 | a0 = v0;
0x0040c208 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c20c move s6, v0 | s6 = v0;
0x0040c210 jalr t9 | t9 ();
0x0040c214 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c218 move a0, s1 | a0 = s1;
0x0040c21c lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c220 move fp, v0 | fp = v0;
0x0040c224 jalr t9 | t9 ();
0x0040c228 move a3, v0 | a3 = v0;
0x0040c22c sltiu v0, fp, 8 | v0 = (fp < 8) ? 1 : 0;
0x0040c230 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c234 bnez v0, 0x40c25c |
0x0040c238 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c23c lui a1, 0x42 | a1 = 0x420000;
0x0040c240 addiu a0, zero, 1 | a0 = 1;
| /* str.country_domain_too_long:__d___8_n */
0x0040c244 addiu a1, a1, -0x7c5c | a1 += -0x7c5c;
0x0040c248 move a2, fp | a2 = fp;
0x0040c24c sw a3, 0x110(sp) | *(var_110h) = a3;
0x0040c250 jalr t9 | t9 ();
0x0040c254 j 0x40c28c | goto label_10;
0x0040c258 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c25c lw a0, -0x7f28(gp) | a0 = *(gp);
| if (fp > 0) {
0x0040c260 blez fp, 0x40c290 |
0x0040c264 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c268 addiu a0, a0, 0x21c | a0 += 0x21c;
0x0040c26c move a1, s6 | a1 = s6;
0x0040c270 move a2, fp | a2 = fp;
0x0040c274 sw a3, 0x110(sp) | *(var_110h) = a3;
0x0040c278 jalr t9 | t9 ();
0x0040c27c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c280 lw v0, -0x7f28(gp) | v0 = *(gp);
0x0040c284 addu v0, v0, fp | v0 += fp;
0x0040c288 sb zero, 0x21c(v0) | *((v0 + 540)) = 0;
| label_10:
0x0040c28c lw a3, 0x110(sp) | a3 = *(var_110h);
| }
0x0040c290 addu v0, fp, a3 | v0 = fp + a3;
0x0040c294 sltiu v0, v0, 0x20 | v0 = (v0 < 0x20) ? 1 : 0;
0x0040c298 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
| if (v0 == 0) {
0x0040c29c bnez v0, 0x40c2c0 |
0x0040c2a0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c2a4 lui a1, 0x42 | a1 = 0x420000;
0x0040c2a8 move a0, zero | a0 = 0;
| /* str.host_length_too_long:__d___d___32_n */
0x0040c2ac addiu a1, a1, -0x7c38 | a1 += -0x7c38;
0x0040c2b0 move a2, fp | a2 = fp;
0x0040c2b4 jalr t9 | t9 ();
0x0040c2b8 j 0x40c3a4 | goto label_11;
0x0040c2bc lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c2c0 lui fp, 0x41 | fp = 0x410000;
0x0040c2c4 move a3, s6 | a3 = s6;
0x0040c2c8 addiu a1, zero, 0x20 | a1 = 0x20;
| /* str._s._s */
0x0040c2cc addiu a2, fp, 0x679c | a2 = fp + 0x679c;
0x0040c2d0 move a0, s3 | a0 = s3;
0x0040c2d4 sw s1, 0x10(sp) | *(var_10h) = s1;
0x0040c2d8 jalr t9 | t9 ();
0x0040c2dc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c2e0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c2e4 move a0, s3 | a0 = s3;
0x0040c2e8 jalr t9 | t9 ();
0x0040c2ec lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c2f0 move a0, s1 | a0 = s1;
0x0040c2f4 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c2f8 move a1, s3 | a1 = s3;
0x0040c2fc move a2, v0 | a2 = v0;
0x0040c300 jalr t9 | t9 ();
0x0040c304 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c308 lui a1, 0x42 | a1 = 0x420000;
0x0040c30c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c310 addiu a0, zero, 2 | a0 = 2;
| /* str.Add_country_domain_to_tcp_host:__s_n */
0x0040c314 addiu a1, a1, -0x7c10 | a1 += -0x7c10;
0x0040c318 move a2, s1 | a2 = s1;
0x0040c31c jalr t9 | t9 ();
0x0040c320 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c324 move a3, s6 | a3 = s6;
0x0040c328 lw t9, -0x7d04(gp) | t9 = sym.imp.snprintf
0x0040c32c addiu a1, zero, 0x20 | a1 = 0x20;
| /* str._s._s */
0x0040c330 addiu a2, fp, 0x679c | a2 = fp + 0x679c;
0x0040c334 move a0, s3 | a0 = s3;
0x0040c338 sw s0, 0x10(sp) | *(var_10h) = s0;
0x0040c33c jalr t9 | t9 ();
0x0040c340 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c344 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c348 move a0, s3 | a0 = s3;
0x0040c34c jalr t9 | t9 ();
0x0040c350 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c354 move a0, s0 | a0 = s0;
0x0040c358 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040c35c move a1, s3 | a1 = s3;
0x0040c360 move a2, v0 | a2 = v0;
0x0040c364 jalr t9 | t9 ();
0x0040c368 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c36c lui a1, 0x42 | a1 = 0x420000;
0x0040c370 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c374 addiu a0, zero, 2 | a0 = 2;
| /* str.Add_country_domain_to_udp_host:__s_n */
0x0040c378 addiu a1, a1, -0x7bec | a1 += -0x7bec;
0x0040c37c move a2, s0 | a2 = s0;
0x0040c380 jalr t9 | t9 ();
0x0040c384 j 0x40c3a4 | goto label_11;
0x0040c388 lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_9:
0x0040c38c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c390 lui a1, 0x42 | a1 = 0x420000;
0x0040c394 addiu a0, zero, 3 | a0 = 3;
| /* str.country_domain_is_not_a_string_n */
0x0040c398 addiu a1, a1, -0x7bc8 | a1 += -0x7bc8;
0x0040c39c jalr t9 | t9 ();
0x0040c3a0 lw gp, 0x18(sp) | gp = *(var_18h);
| label_11:
0x0040c3a4 lw a0, 0x104(sp) | a0 = *(var_104h);
0x0040c3a8 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c3ac lui a1, 0x41 | a1 = 0x415bf8;
| /* esilref: 'tz' */
0x0040c3b0 addiu a1, a1, 0x5bf8 |
0x0040c3b4 move a2, s4 | a2 = s4;
0x0040c3b8 jalr t9 | t9 ();
0x0040c3bc lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x0040c3c0 beqz v0, 0x40c484 |
0x0040c3c4 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c3c8 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c3cc addiu a1, zero, 6 | a1 = 6;
0x0040c3d0 jalr t9 | t9 ();
0x0040c3d4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c3d8 beqz v0, 0x40c484 | goto label_12;
| }
0x0040c3dc lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040c3e0 lw a0, 0x100(sp) | a0 = *(var_100h);
0x0040c3e4 jalr t9 | t9 ();
0x0040c3e8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c3ec move a0, v0 | a0 = v0;
0x0040c3f0 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040c3f4 move s0, v0 | s0 = v0;
0x0040c3f8 jalr t9 | t9 ();
0x0040c3fc move s1, v0 | s1 = v0;
0x0040c400 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c404 bnez v0, 0x40c424 |
0x0040c408 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c40c lui a1, 0x42 | a1 = 0x420000;
0x0040c410 addiu a0, zero, 1 | a0 = 1;
| /* str.tz_is_NULL._n */
0x0040c414 addiu a1, a1, -0x7ba8 | a1 += -0x7ba8;
0x0040c418 jalr t9 | t9 ();
0x0040c41c j 0x40c44c | goto label_13;
0x0040c420 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c424 sltiu v0, v0, 0x40 | v0 = (v0 < 0x40) ? 1 : 0;
0x0040c428 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| if (v0 == 0) {
0x0040c42c bnez v0, 0x40c450 |
0x0040c430 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c434 lui a1, 0x42 | a1 = 0x420000;
0x0040c438 addiu a0, zero, 1 | a0 = 1;
| /* str.tz_too_long._n */
0x0040c43c addiu a1, a1, -0x7b98 | a1 += -0x7b98;
0x0040c440 jalr t9 | t9 ();
0x0040c444 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c448 addiu s1, zero, 0x3f | s1 = 0x3f;
| label_13:
0x0040c44c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| }
0x0040c450 addiu a0, sp, 0x20 | a0 = sp + 0x20;
0x0040c454 move a1, s0 | a1 = s0;
0x0040c458 move a2, s1 | a2 = s1;
0x0040c45c jalr t9 | t9 ();
0x0040c460 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c464 lui a1, 0x42 | a1 = 0x420000;
0x0040c468 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c46c addiu a0, zero, 3 | a0 = 3;
| /* str.tz_s_n */
0x0040c470 addiu a1, a1, -0x7b88 | a1 += -0x7b88;
0x0040c474 addiu a2, sp, 0x20 | a2 = sp + 0x20;
0x0040c478 jalr t9 | t9 ();
0x0040c47c j 0x40c49c | goto label_14;
0x0040c480 lw gp, 0x18(sp) | gp = *(var_18h);
| }
| label_12:
0x0040c484 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c488 lui a1, 0x42 | a1 = 0x420000;
0x0040c48c move a0, zero | a0 = 0;
| /* str.tz_is_not_a_string_n */
0x0040c490 addiu a1, a1, -0x7b80 | a1 += -0x7b80;
0x0040c494 jalr t9 | t9 ();
0x0040c498 lw gp, 0x18(sp) | gp = *(var_18h);
| label_14:
0x0040c49c lw a0, -0x7f28(gp) | a0 = *(gp);
0x0040c4a0 lw t9, -0x7f58(gp) | t9 = sym.method_local_broadcast_msg;
0x0040c4a4 lui a1, 0x42 | a1 = "{\"method\": \"local.status\", \"params\": \"wifi_connecting\"}";
| /* str._method_:__local.status____params_:__wifi_connecting_ */
0x0040c4a8 addiu a1, a1, -0x7b6c |
0x0040c4ac jalr t9 | t9 ();
0x0040c4b0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c4b4 lw a0, 0x140(sp) | a0 = *(arg_140h);
0x0040c4b8 lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040c4bc lui a1, 0x41 | a1 = 0x41527c;
| /* esilref: 'id' */
0x0040c4c0 addiu a1, a1, 0x527c |
0x0040c4c4 move a2, s3 | a2 = s3;
0x0040c4c8 jalr t9 | t9 ();
0x0040c4cc move s0, v0 | s0 = v0;
0x0040c4d0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 >= 0) {
0x0040c4d4 bltz v0, 0x40c52c |
0x0040c4d8 lw v1, 0x148(sp) | v1 = *(arg_148h);
0x0040c4dc sltiu v0, v1, 0x24 | v0 = (v1 < 0x24) ? 1 : 0;
| if (v0 != 0) {
0x0040c4e0 beql v0, zero, 0x40c510 |
0x0040c4e4 lui a1, 0x42 | a1 = 0x420000;
0x0040c4e8 lui a1, 0x41 | a1 = 0x410000;
0x0040c4ec lui a2, 0x41 | a2 = 0x410000;
0x0040c4f0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c4f4 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040c4f8 addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040c4fc addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040c500 addiu a3, zero, 0x104 | a3 = 0x104;
0x0040c504 jalr t9 | t9 ();
0x0040c508 j 0x40c524 | goto label_15;
0x0040c50c nop |
| }
0x0040c510 lw a0, 0x144(sp) | a0 = *(arg_144h);
0x0040c514 lw a2, 0xe0(sp) | a2 = *(var_e0h);
0x0040c518 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
| /* str._id_:_d__result_:__OK__ */
0x0040c51c addiu a1, a1, -0x7b34 | a1 += -0x7b34;
0x0040c520 jalr t9 | t9 ();
| label_15:
0x0040c524 j 0x40c534 | goto label_16;
0x0040c528 lw a2, 0x2e8(s2) | a2 = *((s2 + 186));
| }
0x0040c52c move s0, zero | s0 = 0;
0x0040c530 lw a2, 0x2e8(s2) | a2 = *((s2 + 186));
| label_16:
0x0040c534 lw a3, 0x2ec(s2) | a3 = *((s2 + 187));
0x0040c538 addiu v0, sp, 0x20 | v0 = sp + 0x20;
0x0040c53c sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040c540 move a0, s5 | a0 = s5;
0x0040c544 addiu a1, sp, 0x60 | a1 = sp + 0x60;
0x0040c548 jal 0x40bbbc | fcn_0040bbbc ();
0x0040c54c lw gp, 0x18(sp) | gp = *(var_18h);
| label_5:
0x0040c550 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040c554 move a0, s7 | a0 = s7;
0x0040c558 jalr t9 | t9 ();
0x0040c55c move v0, s0 | v0 = s0;
| label_0:
0x0040c560 lw ra, 0x13c(sp) | ra = *(var_13ch);
0x0040c564 lw fp, 0x138(sp) | fp = *(var_138h);
0x0040c568 lw s7, 0x134(sp) | s7 = *(var_134h);
0x0040c56c lw s6, 0x130(sp) | s6 = *(var_130h);
0x0040c570 lw s5, 0x12c(sp) | s5 = *(var_12ch);
0x0040c574 lw s4, 0x128(sp) | s4 = *(var_128h);
0x0040c578 lw s3, 0x124(sp) | s3 = *(var_124h);
0x0040c57c lw s2, 0x120(sp) | s2 = *(var_120h);
0x0040c580 lw s1, 0x11c(sp) | s1 = *(var_11ch);
0x0040c584 lw s0, 0x118(sp) | s0 = *(var_118h);
0x0040c588 addiu sp, sp, 0x140 |
0x0040c58c 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 @ 0x40ccec */
| #include <stdint.h>
|
; (fcn) sym.method_miio_config_tz () | void method_miio_config_tz () {
0x0040ccec lui gp, 0x43 |
0x0040ccf0 lui v0, 0x42 | v0 = 0x420000;
0x0040ccf4 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040ccf8 lhu v0, -0x7840(v0) | v0 = *((v0 - 15392));
0x0040ccfc addiu sp, sp, -0x88 |
0x0040cd00 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040cd04 sw ra, 0x84(sp) | *(var_84h) = ra;
0x0040cd08 sw s4, 0x7c(sp) | *(var_7ch) = s4;
0x0040cd0c sw s2, 0x74(sp) | *(var_74h) = s2;
0x0040cd10 sw s1, 0x70(sp) | *(var_70h) = s1;
0x0040cd14 sw s0, 0x6c(sp) | *(var_6ch) = s0;
0x0040cd18 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040cd1c move s4, a0 | s4 = a0;
0x0040cd20 sw s5, 0x80(sp) | *(var_80h) = s5;
0x0040cd24 addiu a0, sp, 0x1a | a0 = sp + 0x1a;
0x0040cd28 sw s3, 0x78(sp) | *(var_78h) = s3;
0x0040cd2c move s2, a1 | s2 = a1;
0x0040cd30 move s1, a2 | s1 = a2;
0x0040cd34 move a1, zero | a1 = 0;
0x0040cd38 addiu a2, zero, 0x3e | a2 = 0x3e;
0x0040cd3c sh v0, 0x18(sp) | *(var_18h) = v0;
0x0040cd40 jalr t9 | t9 ();
0x0040cd44 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cd48 lui a1, 0x41 | a1 = 0x410000;
0x0040cd4c lw t9, -0x7fb8(gp) | t9 = sym.json_verify_get_int;
0x0040cd50 sw zero, 0x58(sp) | *(var_58h) = 0;
0x0040cd54 move a0, s4 | a0 = s4;
| /* esilref: 'id' */
0x0040cd58 addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040cd5c addiu a2, sp, 0x58 | a2 = sp + 0x58;
0x0040cd60 jalr t9 | t9 ();
0x0040cd64 move s0, v0 | s0 = v0;
0x0040cd68 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x0040cd6c bgez v0, 0x40cd8c |
0x0040cd70 lui a1, 0x41 | a1 = 0x410000;
0x0040cd74 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cd78 move a0, zero | a0 = 0;
| /* str.json_verify_get_int_fail_n */
0x0040cd7c addiu a1, a1, 0x5aa4 | a1 += 0x5aa4;
0x0040cd80 jalr t9 | t9 ();
0x0040cd84 j 0x40d064 | goto label_0;
0x0040cd88 move v0, s0 | v0 = s0;
| }
0x0040cd8c sltiu s1, s1, 0x2a | s1 = (s1 < 0x2a) ? 1 : 0;
0x0040cd90 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
| if (s1 != 0) {
0x0040cd94 beqz s1, 0x40cdc0 |
0x0040cd98 lui a1, 0x41 | a1 = 0x410000;
0x0040cd9c lui a2, 0x41 | a2 = 0x410000;
0x0040cda0 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cda4 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040cda8 addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040cdac addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040cdb0 addiu a3, zero, 0x1d8 | a3 = 0x1d8;
0x0040cdb4 jalr t9 | t9 ();
0x0040cdb8 j 0x40cf5c | goto label_1;
0x0040cdbc nop |
| }
0x0040cdc0 lw a2, 0x58(sp) | a2 = *(var_58h);
0x0040cdc4 lui s3, 0x42 | s3 = 0x420000;
0x0040cdc8 lui a3, 0x42 | a3 = 0x420000;
| /* str._id_:_d__result_:___s__ */
0x0040cdcc addiu a1, s3, -0x79c4 | a1 = s3 + -0x79c4;
| /* str.ERROR */
0x0040cdd0 addiu a3, a3, -0x79a8 | a3 += -0x79a8;
0x0040cdd4 move a0, s2 | a0 = s2;
0x0040cdd8 jalr t9 | t9 ();
0x0040cddc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cde0 addu v0, s2, v0 | v0 = s2 + v0;
0x0040cde4 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040cde8 move a0, s4 | a0 = s4;
0x0040cdec sb zero, (v0) | *(v0) = 0;
0x0040cdf0 jalr t9 | t9 ();
0x0040cdf4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cdf8 lui a1, 0x41 | a1 = 0x410000;
0x0040cdfc lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040ce00 move a0, v0 | a0 = v0;
| /* str.params */
0x0040ce04 addiu a1, a1, 0x56c4 | a1 += 0x56c4;
0x0040ce08 addiu a2, sp, 0x60 | a2 = sp + 0x60;
0x0040ce0c move s1, v0 | s1 = v0;
0x0040ce10 jalr t9 | t9 ();
0x0040ce14 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040ce18 beqz v0, 0x40cf50 |
0x0040ce1c lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040ce20 lw a0, 0x60(sp) | a0 = *(var_60h);
0x0040ce24 lui a1, 0x41 | a1 = 0x415bf8;
| /* esilref: 'tz' */
0x0040ce28 addiu a1, a1, 0x5bf8 |
0x0040ce2c addiu a2, sp, 0x5c | a2 = sp + 0x5c;
0x0040ce30 jalr t9 | t9 ();
0x0040ce34 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040ce38 lw a0, 0x5c(sp) | a0 = *(var_5ch);
0x0040ce3c lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040ce40 addiu a1, zero, 6 | a1 = 6;
0x0040ce44 jalr t9 | t9 ();
0x0040ce48 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x0040ce4c beqz v0, 0x40cf38 |
0x0040ce50 lw t9, -0x7dfc(gp) | t9 = sym.imp.json_object_get_string;
0x0040ce54 lw a0, 0x5c(sp) | a0 = *(var_5ch);
0x0040ce58 jalr t9 | t9 ();
0x0040ce5c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040ce60 move a0, v0 | a0 = v0;
0x0040ce64 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040ce68 move s4, v0 | s4 = v0;
0x0040ce6c jalr t9 | t9 ();
0x0040ce70 move a2, v0 | a2 = v0;
0x0040ce74 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040ce78 bnez v0, 0x40ce98 |
0x0040ce7c lui a1, 0x42 | a1 = 0x420000;
0x0040ce80 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040ce84 move a0, zero | a0 = 0;
| /* str.tz_is_NULL._n */
0x0040ce88 addiu a1, a1, -0x7ba8 | a1 += -0x7ba8;
0x0040ce8c jalr t9 | t9 ();
0x0040ce90 j 0x40cf5c | goto label_1;
0x0040ce94 nop |
| }
0x0040ce98 sltiu v0, v0, 0x40 | v0 = (v0 < 0x40) ? 1 : 0;
0x0040ce9c lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| if (v0 == 0) {
0x0040cea0 bnez v0, 0x40cec4 |
0x0040cea4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cea8 lui a1, 0x42 | a1 = 0x420000;
0x0040ceac addiu a0, zero, 1 | a0 = 1;
| /* str.tz_too_long._n */
0x0040ceb0 addiu a1, a1, -0x7b98 | a1 += -0x7b98;
0x0040ceb4 jalr t9 | t9 ();
0x0040ceb8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cebc addiu a2, zero, 0x3f | a2 = 0x3f;
0x0040cec0 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
| }
0x0040cec4 addiu s0, sp, 0x18 | s0 = sp + 0x18;
0x0040cec8 move a0, s0 | a0 = s0;
0x0040cecc move a1, s4 | a1 = s4;
0x0040ced0 jalr t9 | t9 ();
0x0040ced4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040ced8 lui a1, 0x42 | a1 = 0x420000;
0x0040cedc lw t9, -0x7fc8(gp) | t9 = sym.log_printf
| /* str.tz_s_n */
0x0040cee0 addiu a1, a1, -0x7b88 | a1 += -0x7b88;
0x0040cee4 move a2, s0 | a2 = s0;
0x0040cee8 addiu a0, zero, 3 | a0 = 3;
0x0040ceec jalr t9 | t9 ();
0x0040cef0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cef4 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040cef8 move a0, s1 | a0 = s1;
0x0040cefc jalr t9 | t9 ();
0x0040cf00 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cf04 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040cf08 move a0, s0 | a0 = s0;
0x0040cf0c jalr t9 | t9 ();
0x0040cf10 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cf14 lw t9, -0x7d14(gp) | t9 = sym.imp.malloc;
0x0040cf18 addiu a0, v0, 0x35 | a0 = v0 + 0x35;
0x0040cf1c jalr t9 | t9 ();
0x0040cf20 move s1, v0 | s1 = v0;
0x0040cf24 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cf28 addiu v0, zero, -1 | v0 = -1;
| if (s1 != 0) {
0x0040cf2c bnez s1, 0x40cf64 | goto label_2;
| }
0x0040cf30 j 0x40d068 | goto label_3;
0x0040cf34 lw ra, 0x84(sp) | ra = *(var_84h);
| }
0x0040cf38 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cf3c lui a1, 0x42 | a1 = 0x420000;
0x0040cf40 move a0, zero | a0 = 0;
| /* str.tz_is_not_a_string_n */
0x0040cf44 addiu a1, a1, -0x7b80 | a1 += -0x7b80;
0x0040cf48 jalr t9 | t9 ();
0x0040cf4c lw gp, 0x10(sp) | gp = *(var_10h);
| }
0x0040cf50 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040cf54 move a0, s1 | a0 = s1;
0x0040cf58 jalr t9 | t9 ();
| label_1:
0x0040cf5c j 0x40d064 | goto label_0;
0x0040cf60 addiu v0, zero, -1 | v0 = -1;
| label_2:
0x0040cf64 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040cf68 lui a1, 0x42 | a1 = 0x420000;
0x0040cf6c move a2, s0 | a2 = s0;
0x0040cf70 move a0, s1 | a0 = s1;
| /* str._method_:__internal.config_tz___params_:_tz_:__s_ */
0x0040cf74 addiu a1, a1, -0x79a0 | a1 += -0x79a0;
0x0040cf78 jalr t9 | t9 ();
0x0040cf7c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cf80 addu v0, s1, v0 | v0 = s1 + v0;
0x0040cf84 lw s4, -0x7f28(gp) | s4 = *(gp);
0x0040cf88 sb zero, (v0) | *(v0) = 0;
0x0040cf8c lw s0, 0x2d4(s4) | s0 = *((s4 + 181));
0x0040cf90 lui s5, 0x42 | s5 = 0x420000;
| if (s0 > 0) {
0x0040cf94 blez s0, 0x40d034 |
0x0040cf98 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040cf9c move a0, s1 | a0 = s1;
0x0040cfa0 jalr t9 | t9 ();
0x0040cfa4 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cfa8 move a0, s0 | a0 = s0;
0x0040cfac lw t9, -0x7fc4(gp) | t9 = sym.general_send_one;
0x0040cfb0 move a1, s1 | a1 = s1;
0x0040cfb4 move a2, v0 | a2 = v0;
0x0040cfb8 jalr t9 | t9 ();
0x0040cfbc lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cfc0 lui a1, 0x42 | a1 = 0x420000;
0x0040cfc4 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cfc8 move s0, v0 | s0 = v0;
0x0040cfcc addiu a0, zero, 2 | a0 = 2;
| /* str._s__:ret_is__d_n */
0x0040cfd0 addiu a1, a1, -0x7968 | a1 += -0x7968;
| /* str.method_miio_config_tz */
0x0040cfd4 addiu a2, s5, -0x777c | a2 = s5 + -0x777c;
0x0040cfd8 move a3, v0 | a3 = v0;
0x0040cfdc jalr t9 | t9 ();
0x0040cfe0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (s0 < 0) {
0x0040cfe4 bgez s0, 0x40d004 |
0x0040cfe8 lw t9, -0x7fc0(gp) | t9 = sym.ot_agent_fd_close;
0x0040cfec lw a1, 0x2d4(s4) | a1 = *((s4 + 181));
0x0040cff0 move a0, s4 | a0 = s4;
0x0040cff4 jalr t9 | t9 ();
0x0040cff8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040cffc j 0x40d054 | goto label_4;
0x0040d000 sw zero, 0x2d4(s4) | *((s4 + 181)) = 0;
| }
0x0040d004 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
0x0040d008 lw a2, 0x58(sp) | a2 = *(var_58h);
0x0040d00c lui a3, 0x42 | a3 = 0x420000;
0x0040d010 move a0, s2 | a0 = s2;
| /* str._id_:_d__result_:___s__ */
0x0040d014 addiu a1, s3, -0x79c4 | a1 = s3 + -0x79c4;
| /* esilref: 'OK' */
0x0040d018 addiu a3, a3, -0x7958 | a3 += -0x7958;
0x0040d01c jalr t9 | t9 ();
0x0040d020 addu s2, s2, v0 | s2 += v0;
0x0040d024 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d028 move s0, v0 | s0 = v0;
0x0040d02c j 0x40d054 | goto label_4;
0x0040d030 sb zero, (s2) | *(s2) = 0;
| }
0x0040d034 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040d038 lui a1, 0x42 | a1 = 0x420000;
0x0040d03c addiu a0, zero, 1 | a0 = 1;
| /* str._s__:No_helper_script__n */
0x0040d040 addiu a1, a1, -0x7954 | a1 += -0x7954;
| /* str.method_miio_config_tz */
0x0040d044 addiu a2, s5, -0x777c | a2 = s5 + -0x777c;
0x0040d048 jalr t9 | t9 ();
0x0040d04c lw gp, 0x10(sp) | gp = *(var_10h);
0x0040d050 addiu s0, zero, -1 | s0 = -1;
| label_4:
0x0040d054 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x0040d058 move a0, s1 | a0 = s1;
0x0040d05c jalr t9 | t9 ();
0x0040d060 move v0, s0 | v0 = s0;
| label_0:
0x0040d064 lw ra, 0x84(sp) | ra = *(var_84h);
| label_3:
0x0040d068 lw s5, 0x80(sp) | s5 = *(var_80h);
0x0040d06c lw s4, 0x7c(sp) | s4 = *(var_7ch);
0x0040d070 lw s3, 0x78(sp) | s3 = *(var_78h);
0x0040d074 lw s2, 0x74(sp) | s2 = *(var_74h);
0x0040d078 lw s1, 0x70(sp) | s1 = *(var_70h);
0x0040d07c lw s0, 0x6c(sp) | s0 = *(var_6ch);
0x0040d080 addiu sp, sp, 0x88 |
0x0040d084 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 @ 0x40c930 */
| #include <stdint.h>
|
; (fcn) sym.method_miio_info () | void method_miio_info () {
0x0040c930 lui gp, 0x43 |
0x0040c934 addiu sp, sp, -0x78 |
0x0040c938 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040c93c sw s6, 0x6c(sp) | *(var_6ch) = s6;
0x0040c940 lw s6, -0x7f28(gp) | s6 = *(gp);
0x0040c944 sw ra, 0x74(sp) | *(var_74h) = ra;
0x0040c948 lw v1, 0x3a8(s6) | v1 = *((s6 + 234));
0x0040c94c sw s7, 0x70(sp) | *(var_70h) = s7;
0x0040c950 sw s5, 0x68(sp) | *(var_68h) = s5;
0x0040c954 sw s4, 0x64(sp) | *(var_64h) = s4;
0x0040c958 sw s3, 0x60(sp) | *(var_60h) = s3;
0x0040c95c sw s2, 0x5c(sp) | *(var_5ch) = s2;
0x0040c960 sw s1, 0x58(sp) | *(var_58h) = s1;
0x0040c964 sw s0, 0x54(sp) | *(var_54h) = s0;
0x0040c968 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0040c96c addiu v0, zero, -1 | v0 = -1;
| if (v1 != 0) {
0x0040c970 beqz v1, 0x40ccc0 |
0x0040c974 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040c978 move s1, a3 | s1 = a3;
0x0040c97c move s3, a2 | s3 = a2;
0x0040c980 move s2, a1 | s2 = a1;
0x0040c984 jalr t9 | t9 ();
0x0040c988 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c98c lui s4, 0x41 | s4 = 0x410000;
0x0040c990 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c994 move a0, v0 | a0 = v0;
| /* esilref: 'id' */
0x0040c998 addiu a1, s4, 0x527c | a1 = s4 + 0x527c;
0x0040c99c addiu a2, sp, 0x44 | a2 = sp + 0x44;
0x0040c9a0 move s0, v0 | s0 = v0;
0x0040c9a4 jalr t9 | t9 ();
0x0040c9a8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c9ac lw a0, 0x44(sp) | a0 = *(var_44h);
0x0040c9b0 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c9b4 addiu a1, zero, 3 | a1 = 3;
0x0040c9b8 jalr t9 | t9 ();
0x0040c9bc move s5, s4 | s5 = s4;
0x0040c9c0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0040c9c4 bnez v0, 0x40c9e8 |
0x0040c9c8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c9cc lui a1, 0x42 | a1 = 0x420000;
0x0040c9d0 move a0, zero | a0 = 0;
| /* str.can_not_get_id_n */
0x0040c9d4 addiu a1, a1, -0x7b04 | a1 += -0x7b04;
0x0040c9d8 jalr t9 | t9 ();
0x0040c9dc addiu s4, zero, -1 | s4 = -1;
0x0040c9e0 j 0x40c9fc | goto label_0;
0x0040c9e4 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040c9e8 lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040c9ec lw a0, 0x44(sp) | a0 = *(var_44h);
0x0040c9f0 jalr t9 | t9 ();
0x0040c9f4 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040c9f8 move s4, v0 | s4 = v0;
| label_0:
0x0040c9fc lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040ca00 move a0, s0 | a0 = s0;
0x0040ca04 jalr t9 | t9 ();
0x0040ca08 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040ca0c addiu s7, sp, 0x20 | s7 = sp + 0x20;
0x0040ca10 lw t9, -0x7de0(gp) | t9 = sym.imp.memset;
0x0040ca14 move a0, s7 | a0 = s7;
0x0040ca18 move a1, zero | a1 = 0;
0x0040ca1c addiu a2, zero, 0x21 | a2 = 0x21;
0x0040ca20 jalr t9 | t9 ();
0x0040ca24 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040ca28 addiu a1, s2, 0x60 | a1 = s2 + 0x60;
0x0040ca2c lw t9, -0x7f24(gp) | t9 = sym.str2hex;
0x0040ca30 addiu a2, zero, 0x10 | a2 = 0x10;
0x0040ca34 move a0, s7 | a0 = s7;
0x0040ca38 jalr t9 | t9 ();
0x0040ca3c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040ca40 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040ca44 lw a0, 0x3a8(s6) | a0 = *((s6 + 234));
0x0040ca48 jalr t9 | t9 ();
0x0040ca4c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040ca50 move a0, s4 | a0 = s4;
0x0040ca54 lw t9, -0x7d88(gp) | t9 = sym.imp.json_object_new_int;
0x0040ca58 move s0, v0 | s0 = v0;
0x0040ca5c jalr t9 | t9 ();
0x0040ca60 lw gp, 0x18(sp) | gp = *(var_18h);
| /* esilref: 'id' */
0x0040ca64 addiu a1, s5, 0x527c | a1 = s5 + 0x527c;
0x0040ca68 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040ca6c move a2, v0 | a2 = v0;
0x0040ca70 move a0, s0 | a0 = s0;
0x0040ca74 jalr t9 | t9 ();
0x0040ca78 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040ca7c move a0, zero | a0 = 0;
0x0040ca80 lw t9, -0x7d88(gp) | t9 = sym.imp.json_object_new_int;
0x0040ca84 lui s5, 0x41 | s5 = 0x410000;
0x0040ca88 jalr t9 | t9 ();
0x0040ca8c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040ca90 lui a1, 0x41 | a1 = 0x410000;
0x0040ca94 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
| /* str.code */
0x0040ca98 addiu a1, a1, 0x6364 | a1 += 0x6364;
0x0040ca9c move a2, v0 | a2 = v0;
0x0040caa0 move a0, s0 | a0 = s0;
0x0040caa4 jalr t9 | t9 ();
0x0040caa8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040caac lui a0, 0x42 | a0 = 0x420000;
0x0040cab0 lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
| /* esilref: 'ok' */
0x0040cab4 addiu a0, a0, -0x7a08 | a0 += -0x7a08;
0x0040cab8 jalr t9 | t9 ();
0x0040cabc lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cac0 lui a1, 0x42 | a1 = 0x420000;
0x0040cac4 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040cac8 move a2, v0 | a2 = v0;
0x0040cacc move a0, s0 | a0 = s0;
| /* str.message */
0x0040cad0 addiu a1, a1, -0x7a04 | a1 += -0x7a04;
0x0040cad4 jalr t9 | t9 ();
0x0040cad8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cadc addiu a2, sp, 0x48 | a2 = sp + 0x48;
0x0040cae0 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040cae4 move a0, s0 | a0 = s0;
| /* str.params */
0x0040cae8 addiu a1, s5, 0x56c4 | a1 = s5 + 0x56c4;
0x0040caec jalr t9 | t9 ();
0x0040caf0 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040caf4 lw a0, 0x48(sp) | a0 = *(var_48h);
0x0040caf8 lw t9, -0x7d08(gp) | t9 = sym.imp.json_object_to_json_string_ext;
0x0040cafc move a1, zero | a1 = 0;
0x0040cb00 jalr t9 | t9 ();
0x0040cb04 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cb08 lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040cb0c move a0, v0 | a0 = v0;
0x0040cb10 jalr t9 | t9 ();
0x0040cb14 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cb18 addiu a0, s2, 0x80 | a0 = s2 + 0x80;
0x0040cb1c lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
0x0040cb20 sw v0, 0x44(sp) | *(var_44h) = v0;
0x0040cb24 move s4, v0 | s4 = v0;
0x0040cb28 jalr t9 | t9 ();
0x0040cb2c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cb30 lui a1, 0x41 | a1 = 0x410000;
0x0040cb34 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040cb38 move a0, s4 | a0 = s4;
| /* str.model */
0x0040cb3c addiu a1, a1, 0x65c8 | a1 += 0x65c8;
0x0040cb40 move a2, v0 | a2 = v0;
0x0040cb44 jalr t9 | t9 ();
0x0040cb48 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cb4c addiu a0, s2, 0x98 | a0 = s2 + 0x98;
0x0040cb50 lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
0x0040cb54 lw s4, 0x44(sp) | s4 = *(var_44h);
0x0040cb58 jalr t9 | t9 ();
0x0040cb5c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cb60 lui a1, 0x41 | a1 = 0x410000;
0x0040cb64 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
| /* esilref: 'mac' */
0x0040cb68 addiu a1, a1, 0x62f4 | a1 += 0x62f4;
0x0040cb6c move a2, v0 | a2 = v0;
0x0040cb70 move a0, s4 | a0 = s4;
0x0040cb74 jalr t9 | t9 ();
0x0040cb78 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cb7c move a0, s7 | a0 = s7;
0x0040cb80 lw t9, -0x7dd8(gp) | t9 = sym.imp.json_object_new_string;
0x0040cb84 lw s2, 0x44(sp) | s2 = *(var_44h);
0x0040cb88 jalr t9 | t9 ();
0x0040cb8c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cb90 lui a1, 0x41 | a1 = 0x410000;
0x0040cb94 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040cb98 move a0, s2 | a0 = s2;
| /* esilref: 'token' */
0x0040cb9c addiu a1, a1, 0x6668 | a1 += 0x6668;
0x0040cba0 move a2, v0 | a2 = v0;
0x0040cba4 jalr t9 | t9 ();
0x0040cba8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cbac lw t9, -0x7f20(gp) | t9 = sym.get_uptime;
0x0040cbb0 lw s2, 0x44(sp) | s2 = *(var_44h);
0x0040cbb4 jalr t9 | t9 ();
0x0040cbb8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cbbc lw t9, -0x7d88(gp) | t9 = sym.imp.json_object_new_int;
0x0040cbc0 move a0, v0 | a0 = v0;
0x0040cbc4 jalr t9 | t9 ();
0x0040cbc8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cbcc lui a1, 0x41 | a1 = 0x410000;
0x0040cbd0 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040cbd4 move a2, v0 | a2 = v0;
0x0040cbd8 move a0, s2 | a0 = s2;
| /* str.life */
0x0040cbdc addiu a1, a1, 0x7ee0 | a1 += 0x7ee0;
0x0040cbe0 jalr t9 | t9 ();
0x0040cbe4 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cbe8 move a0, s0 | a0 = s0;
0x0040cbec lw t9, -0x7db4(gp) | t9 = sym.imp.json_object_object_del;
| /* str.params */
0x0040cbf0 addiu a1, s5, 0x56c4 | a1 = s5 + 0x56c4;
0x0040cbf4 jalr t9 | t9 ();
0x0040cbf8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cbfc lw a2, 0x44(sp) | a2 = *(var_44h);
0x0040cc00 lw t9, -0x7e1c(gp) | t9 = sym.imp.json_object_object_add;
0x0040cc04 lui a1, 0x41 | a1 = 0x410000;
0x0040cc08 move a0, s0 | a0 = s0;
| /* str.result */
0x0040cc0c addiu a1, a1, 0x6398 | a1 += 0x6398;
0x0040cc10 jalr t9 | t9 ();
0x0040cc14 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cc18 move a0, s0 | a0 = s0;
0x0040cc1c lw t9, -0x7d08(gp) | t9 = sym.imp.json_object_to_json_string_ext;
0x0040cc20 move a1, zero | a1 = 0;
0x0040cc24 jalr t9 | t9 ();
0x0040cc28 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cc2c move a0, v0 | a0 = v0;
0x0040cc30 lw t9, -0x7e48(gp) | t9 = sym.imp.strlen;
0x0040cc34 move s2, v0 | s2 = v0;
0x0040cc38 jalr t9 | t9 ();
0x0040cc3c sltu s1, v0, s1 | s1 = (v0 < s1) ? 1 : 0;
0x0040cc40 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s1 == 0) {
0x0040cc44 bnez s1, 0x40cc78 |
0x0040cc48 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cc4c lui a1, 0x42 | a1 = 0x420000;
0x0040cc50 lui a2, 0x41 | a2 = 0x410000;
0x0040cc54 sw s2, 0x10(sp) | *(var_10h) = s2;
0x0040cc58 move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d:__s_n */
0x0040cc5c addiu a1, a1, -0x79fc | a1 += -0x79fc;
| /* str.miio_misc.c */
0x0040cc60 addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040cc64 addiu a3, zero, 0x1b4 | a3 = 0x1b4;
0x0040cc68 jalr t9 | t9 ();
0x0040cc6c addiu s1, zero, -1 | s1 = -1;
0x0040cc70 j 0x40ccb0 | goto label_1;
0x0040cc74 lw gp, 0x18(sp) | gp = *(var_18h);
| }
0x0040cc78 lw t9, -0x7d0c(gp) | t9 = sym.imp.memcpy;
0x0040cc7c move a0, s3 | a0 = s3;
0x0040cc80 move a1, s2 | a1 = s2;
0x0040cc84 move a2, v0 | a2 = v0;
0x0040cc88 jalr t9 | t9 ();
0x0040cc8c lw gp, 0x18(sp) | gp = *(var_18h);
0x0040cc90 lui a1, 0x42 | a1 = 0x420000;
0x0040cc94 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040cc98 addiu a0, zero, 3 | a0 = 3;
| /* str.miio.info:__s_n */
0x0040cc9c addiu a1, a1, -0x79d4 | a1 += -0x79d4;
0x0040cca0 move a2, s2 | a2 = s2;
0x0040cca4 jalr t9 | t9 ();
0x0040cca8 lw gp, 0x18(sp) | gp = *(var_18h);
0x0040ccac move s1, zero | s1 = 0;
| label_1:
0x0040ccb0 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040ccb4 move a0, s0 | a0 = s0;
0x0040ccb8 jalr t9 | t9 ();
0x0040ccbc move v0, s1 | v0 = s1;
| }
0x0040ccc0 lw ra, 0x74(sp) | ra = *(var_74h);
0x0040ccc4 lw s7, 0x70(sp) | s7 = *(var_70h);
0x0040ccc8 lw s6, 0x6c(sp) | s6 = *(var_6ch);
0x0040cccc lw s5, 0x68(sp) | s5 = *(var_68h);
0x0040ccd0 lw s4, 0x64(sp) | s4 = *(var_64h);
0x0040ccd4 lw s3, 0x60(sp) | s3 = *(var_60h);
0x0040ccd8 lw s2, 0x5c(sp) | s2 = *(var_5ch);
0x0040ccdc lw s1, 0x58(sp) | s1 = *(var_58h);
0x0040cce0 lw s0, 0x54(sp) | s0 = *(var_54h);
0x0040cce4 addiu sp, sp, 0x78 |
0x0040cce8 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 @ 0x40c590 */
| #include <stdint.h>
|
; (fcn) sym.method_miio_wifi_assoc_state () | void method_miio_wifi_assoc_state () {
0x0040c590 lui gp, 0x43 |
0x0040c594 addiu gp, gp, 0x1620 |
0x0040c598 addiu sp, sp, -0x38 |
0x0040c59c lw v0, -0x7f28(gp) | v0 = *(gp);
0x0040c5a0 sw s3, 0x30(sp) | *(var_30h) = s3;
0x0040c5a4 sw s2, 0x2c(sp) | *(var_2ch) = s2;
0x0040c5a8 sw ra, 0x34(sp) | *(var_34h) = ra;
0x0040c5ac sw s1, 0x28(sp) | *(var_28h) = s1;
0x0040c5b0 sw s0, 0x24(sp) | *(var_24h) = s0;
0x0040c5b4 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040c5b8 lbu v0, 0x3a0(v0) | v0 = *((v0 + 928));
0x0040c5bc move s3, a1 | s3 = a1;
0x0040c5c0 move s2, a2 | s2 = a2;
| if (v0 == 0) {
0x0040c5c4 bnez v0, 0x40c5d4 |
0x0040c5c8 lui s0, 0x42 | s0 = 0x420000;
0x0040c5cc j 0x40c5dc | goto label_0;
| /* str.CONNECTING */
0x0040c5d0 addiu s0, s0, -0x7b10 | s0 += -0x7b10;
| }
0x0040c5d4 lui s0, 0x42 | s0 = "ONLINE";
| /* str.ONLINE */
0x0040c5d8 addiu s0, s0, -0x7b18 |
| label_0:
0x0040c5dc lw t9, -0x7d40(gp) | t9 = sym.imp.json_tokener_parse;
0x0040c5e0 jalr t9 | t9 ();
0x0040c5e4 nop |
0x0040c5e8 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040c5ec lui a1, 0x41 | a1 = 0x410000;
0x0040c5f0 lw t9, -0x7db8(gp) | t9 = sym.imp.json_object_object_get_ex;
0x0040c5f4 move a0, v0 | a0 = v0;
| /* esilref: 'id' */
0x0040c5f8 addiu a1, a1, 0x527c | a1 += 0x527c;
0x0040c5fc addiu a2, sp, 0x18 | a2 = sp + 0x18;
0x0040c600 move s1, v0 | s1 = v0;
0x0040c604 jalr t9 | t9 ();
0x0040c608 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040c60c lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040c610 lw t9, -0x7e24(gp) | t9 = sym.imp.json_object_is_type;
0x0040c614 addiu a1, zero, 3 | a1 = 3;
0x0040c618 jalr t9 | t9 ();
0x0040c61c lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x0040c620 bnez v0, 0x40c644 |
0x0040c624 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c628 lui a1, 0x42 | a1 = 0x420000;
0x0040c62c move a0, zero | a0 = 0;
| /* str.can_not_get_id_n */
0x0040c630 addiu a1, a1, -0x7b04 | a1 += -0x7b04;
0x0040c634 jalr t9 | t9 ();
0x0040c638 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040c63c j 0x40c654 | goto label_1;
0x0040c640 addiu v0, zero, -1 | v0 = -1;
| }
0x0040c644 lw t9, -0x7d84(gp) | t9 = sym.imp.json_object_get_int;
0x0040c648 lw a0, 0x18(sp) | a0 = *(var_18h);
0x0040c64c jalr t9 | t9 ();
0x0040c650 lw gp, 0x10(sp) | gp = *(var_10h);
| label_1:
0x0040c654 sltiu s2, s2, 0xa1 | s2 = (s2 < 0xa1) ? 1 : 0;
0x0040c658 lw t9, -0x7e00(gp) | t9 = sym.imp.sprintf
| if (s2 != 0) {
0x0040c65c beqz s2, 0x40c698 |
0x0040c660 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040c664 lui a1, 0x41 | a1 = 0x410000;
0x0040c668 lui a2, 0x41 | a2 = 0x410000;
0x0040c66c move a0, zero | a0 = 0;
| /* str.json_string_too_long.__s__line__d_n */
0x0040c670 addiu a1, a1, 0x7eec | a1 += 0x7eec;
| /* str.miio_misc.c */
0x0040c674 addiu a2, a2, 0x7f10 | a2 += 0x7f10;
0x0040c678 addiu a3, zero, 0x133 | a3 = 0x133;
0x0040c67c jalr t9 | t9 ();
0x0040c680 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040c684 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040c688 move a0, s1 | a0 = s1;
0x0040c68c jalr t9 | t9 ();
0x0040c690 j 0x40c6c4 | goto label_2;
0x0040c694 addiu v0, zero, -1 | v0 = -1;
| }
0x0040c698 lui a1, 0x42 | a1 = 0x420000;
0x0040c69c move a0, s3 | a0 = s3;
| /* str._id_:_d__code_:0__message_:_ok___result_:_state_:__s___auth_fail_count_:0__conn_success_count_:1__conn_fail_count_:0__dhcp_fail_count_:0 */
0x0040c6a0 addiu a1, a1, -0x7af4 | a1 += -0x7af4;
0x0040c6a4 move a2, v0 | a2 = v0;
0x0040c6a8 move a3, s0 | a3 = s0;
0x0040c6ac jalr t9 | t9 ();
0x0040c6b0 lw gp, 0x10(sp) | gp = *(var_10h);
0x0040c6b4 lw t9, -0x7e34(gp) | t9 = sym.imp.json_object_put;
0x0040c6b8 move a0, s1 | a0 = s1;
0x0040c6bc jalr t9 | t9 ();
0x0040c6c0 move v0, zero | v0 = 0;
| label_2:
0x0040c6c4 lw ra, 0x34(sp) | ra = *(var_34h);
0x0040c6c8 lw s3, 0x30(sp) | s3 = *(var_30h);
0x0040c6cc lw s2, 0x2c(sp) | s2 = *(var_2ch);
0x0040c6d0 lw s1, 0x28(sp) | s1 = *(var_28h);
0x0040c6d4 lw s0, 0x24(sp) | s0 = *(var_24h);
0x0040c6d8 addiu sp, sp, 0x38 |
0x0040c6dc 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 @ 0x40e64c */
| #include <stdint.h>
|
; (fcn) sym.ot_agent_fd_close () | void ot_agent_fd_close () {
0x0040e64c lui gp, 0x43 |
0x0040e650 addiu sp, sp, -0x28 |
0x0040e654 addiu gp, gp, 0x1620 | gp += 0x1620;
0x0040e658 move v0, zero | v0 = 0;
0x0040e65c sw s1, 0x20(sp) | *(var_20h) = s1;
0x0040e660 sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x0040e664 sw ra, 0x24(sp) | *(var_24h) = ra;
0x0040e668 move s0, a0 | s0 = a0;
0x0040e66c sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040e670 move s1, a1 | s1 = a1;
0x0040e674 move a0, zero | a0 = 0;
| label_0:
0x0040e678 lw v1, 0x194(s0) | v1 = *((s0 + 101));
| do {
0x0040e67c slt a1, v0, v1 | a1 = (v0 < v1) ? 1 : 0;
0x0040e680 sll a1, v0, 3 | a1 = v0 << 3;
| if (a1 == 0) {
0x0040e684 beqz a1, 0x40e6d4 | goto label_2;
| }
0x0040e688 addu a2, s0, a1 | a2 = s0 + a1;
0x0040e68c lw a2, 4(a2) | a2 = *((a2 + 1));
0x0040e690 addiu v0, v0, 1 | v0++;
0x0040e694 bnel a2, s1, 0x40e67c |
| } while (a2 == s1);
0x0040e698 subu v0, v1, v0 | __asm ("subu v0, v1, v0");
0x0040e69c sll v0, v0, 3 | v0 <<= 3;
0x0040e6a0 move a0, zero | a0 = 0;
| do {
0x0040e6a4 addu a3, a0, a1 | a3 = a0 + a1;
0x0040e6a8 addu a3, s0, a3 | a3 = s0 + a3;
0x0040e6ac lw a2, 0xc(a3) | a2 = *((a3 + 3));
0x0040e6b0 addiu a0, a0, 8 | a0 += 8;
0x0040e6b4 sw a2, 4(a3) | *((a3 + 1)) = a2;
0x0040e6b8 lw a2, 0x10(a3) | a2 = *((a3 + 4));
0x0040e6bc sw a2, 8(a3) | *((a3 + 2)) = a2;
0x0040e6c0 bne a0, v0, 0x40e6a4 |
| } while (a0 != v0);
0x0040e6c4 move v0, v1 | v0 = v1;
0x0040e6c8 addiu a0, zero, 1 | a0 = 1;
0x0040e6cc j 0x40e678 | goto label_0;
0x0040e6d0 addiu v0, v0, 1 | v0++;
| label_2:
0x0040e6d4 addiu v1, v1, -1 | v1 += -1;
| if (a0 != 0) {
0x0040e6d8 beqz a0, 0x40e6e4 |
0x0040e6dc j 0x40e6fc | goto label_3;
0x0040e6e0 sw v1, 0x194(s0) | *((s0 + 101)) = v1;
| }
0x0040e6e4 lui a1, 0x42 | a1 = 0x420000;
0x0040e6e8 addiu a0, zero, 1 | a0 = 1;
| /* str.client_fd___d__not_in_pollfds._n */
0x0040e6ec addiu a1, a1, -0x7578 | a1 += -0x7578;
0x0040e6f0 move a2, s1 | a2 = s1;
0x0040e6f4 jal 0x40dfb8 | sym_log_printf ()
0x0040e6f8 lw gp, 0x10(sp) | gp = *(var_10h);
| label_3:
0x0040e6fc lw v1, 0x1e8(s0) | v1 = *((s0 + 122));
0x0040e700 move a1, zero | a1 = 0;
0x0040e704 move v0, zero | v0 = 0;
| do {
| label_1:
0x0040e708 slt a0, v0, v1 | a0 = (v0 < v1) ? 1 : 0;
0x0040e70c addiu a0, v0, 0x66 | a0 = v0 + 0x66;
| if (a0 == 0) {
0x0040e710 beqz a0, 0x40e760 | goto label_4;
| }
0x0040e714 sll a0, a0, 2 | a0 <<= 2;
0x0040e718 addu a0, s0, a0 | a0 = s0 + a0;
0x0040e71c lw a0, (a0) | a0 = *(a0);
0x0040e720 addiu v0, v0, 1 | v0++;
0x0040e724 bnel a0, s1, 0x40e708 |
| } while (a0 == s1);
0x0040e728 subu a2, v1, v0 | __asm ("subu a2, v1, v0");
0x0040e72c sll a2, a2, 2 | a2 <<= 2;
0x0040e730 sll v0, v0, 2 | v0 <<= 2;
0x0040e734 move a0, zero | a0 = 0;
| do {
0x0040e738 addu a1, a0, v0 | a1 = a0 + v0;
0x0040e73c addu a1, s0, a1 | a1 = s0 + a1;
0x0040e740 lw a3, 0x19c(a1) | a3 = *((a1 + 103));
0x0040e744 addiu a0, a0, 4 | a0 += 4;
0x0040e748 sw a3, 0x198(a1) | *((a1 + 102)) = a3;
0x0040e74c bne a0, a2, 0x40e738 |
| } while (a0 != a2);
0x0040e750 move v0, v1 | v0 = v1;
0x0040e754 addiu a1, zero, 1 | a1 = 1;
0x0040e758 j 0x40e708 | goto label_1;
0x0040e75c addiu v0, v0, 1 | v0++;
| label_4:
0x0040e760 addiu v1, v1, -1 | v1 += -1;
| if (a1 != 0) {
0x0040e764 beqz a1, 0x40e770 |
0x0040e768 j 0x40e788 | goto label_5;
0x0040e76c sw v1, 0x1e8(s0) | *((s0 + 122)) = v1;
| }
0x0040e770 lui a1, 0x42 | a1 = 0x420000;
0x0040e774 addiu a0, zero, 1 | a0 = 1;
| /* str.client_fd___d__not_in_clientfds._n */
0x0040e778 addiu a1, a1, -0x7558 | a1 += -0x7558;
0x0040e77c move a2, s1 | a2 = s1;
0x0040e780 jal 0x40dfb8 | sym_log_printf ()
0x0040e784 lw gp, 0x10(sp) | gp = *(var_10h);
| label_5:
0x0040e788 lw ra, 0x24(sp) | ra = *(var_24h);
0x0040e78c lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x0040e790 move a0, s1 | a0 = s1;
0x0040e794 lw t9, -0x7e64(gp) | t9 = sym.imp.close;
0x0040e798 lw s1, 0x20(sp) | s1 = *(var_20h);
0x0040e79c addiu sp, sp, 0x28 |
0x0040e7a0 jr t9 | return t9 ();
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/6225984-11075644.jffs2_new_extract/etc/miio_client/miio_client @ 0x4097d8 */
| #include <stdint.h>
|
; (fcn) sym.queue_ack () | void queue_ack () {
0x004097d8 lui v1, 0x43 | v1 = 0x430000;
0x004097dc addiu sp, sp, -0x20 |
| /* obj.miio */
0x004097e0 addiu v1, v1, -0x6dd0 | v1 += -0x6dd0;
0x004097e4 sw s0, 0x18(sp) | *(var_18h) = s0;
0x004097e8 lw s0, 0x3b0(v1) | s0 = *((v1 + 236));
0x004097ec lui gp, 0x43 |
0x004097f0 move a2, a0 | a2 = a0;
0x004097f4 lw a1, (s0) | a1 = *(s0);
0x004097f8 lw a0, 0x18(s0) | a0 = *((s0 + 6));
0x004097fc addiu gp, gp, 0x1620 | gp += 0x1620;
0x00409800 sw ra, 0x1c(sp) | *(var_1ch) = ra;
0x00409804 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00409808 move v0, a0 | v0 = a0;
| if (a1 != a2) {
0x0040980c bne a1, a2, 0x40981c | goto label_0;
| }
0x00409810 j 0x40985c | goto label_1;
0x00409814 sw a0, 0x3b0(v1) | *((v1 + 236)) = a0;
| do {
0x00409818 lw v0, 0x18(v0) | v0 = *((v0 + 6));
| label_0:
0x0040981c lw ra, 0x1c(sp) | ra = *(var_1ch);
| if (v0 == 0) {
0x00409820 beqz v0, 0x409840 | goto label_2;
| }
0x00409824 lw v1, (v0) | v1 = *(v0);
0x00409828 move s0, v0 | s0 = v0;
0x0040982c bnel v1, a2, 0x409818 |
| } while (v1 == a2);
0x00409830 lw v1, 0x18(v0) | v1 = *((v0 + 6));
0x00409834 sw v1, 0x18(s0) | *((s0 + 6)) = v1;
0x00409838 j 0x40985c | goto label_1;
0x0040983c move s0, v0 | s0 = v0;
| label_2:
0x00409840 lw s0, 0x18(sp) | s0 = *(var_18h);
0x00409844 lui a1, 0x41 | a1 = 0x410000;
0x00409848 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x0040984c move a0, zero | a0 = 0;
| /* str.not_found_data_desc_with_id:__d_n */
0x00409850 addiu a1, a1, 0x69e4 | a1 += 0x69e4;
0x00409854 addiu sp, sp, 0x20 |
0x00409858 jr t9 | t9 ();
| label_1:
0x0040985c lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00409860 lui a1, 0x41 | a1 = 0x410000;
0x00409864 addiu a0, zero, 3 | a0 = 3;
| /* str.data_desc_acked____id:__d_n */
0x00409868 addiu a1, a1, 0x6a08 | a1 += 0x6a08;
0x0040986c jalr t9 | t9 ();
0x00409870 lw gp, 0x10(sp) | gp = *(var_10h);
0x00409874 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00409878 lw a0, 4(s0) | a0 = *((s0 + 1));
0x0040987c jalr t9 | t9 ();
0x00409880 lw gp, 0x10(sp) | gp = *(var_10h);
0x00409884 lw ra, 0x1c(sp) | ra = *(var_1ch);
0x00409888 move a0, s0 | a0 = s0;
0x0040988c lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00409890 lw s0, 0x18(sp) | s0 = *(var_18h);
0x00409894 addiu sp, sp, 0x20 |
0x00409898 jr t9 | return t9 ();
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/6225984-11075644.jffs2_new_extract/etc/miio_client/miio_client @ 0x408b5c */
| #include <stdint.h>
|
; (fcn) sym.report_to_cloud () | void report_to_cloud () {
0x00408b5c lui v0, 0x43 | v0 = 0x430000;
0x00408b60 lui gp, 0x43 |
0x00408b64 lw v0, -0x6b10(v0) | v0 = *((v0 - 6852));
0x00408b68 addiu sp, sp, -0x30 |
0x00408b6c addiu gp, gp, 0x1620 | gp += 0x1620;
0x00408b70 sw s2, 0x28(sp) | *(var_28h) = s2;
0x00408b74 sw s0, 0x20(sp) | *(var_20h) = s0;
0x00408b78 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00408b7c sw s1, 0x24(sp) | *(var_24h) = s1;
0x00408b80 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00408b84 move s0, a1 | s0 = a1;
0x00408b88 andi s2, a2, 0xff | s2 = a2 & 0xff;
0x00408b8c sw zero, 0x18(sp) | *(var_18h) = 0;
| if (v0 == 0) {
0x00408b90 bnez v0, 0x408bb4 |
0x00408b94 lui a1, 0x41 | a1 = 0x410000;
0x00408b98 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408b9c addiu a0, zero, 1 | a0 = 1;
| /* str.Were_offline_now__cant_report_msg__id:__d_n */
0x00408ba0 addiu a1, a1, 0x5cb4 | a1 += 0x5cb4;
0x00408ba4 move a2, s0 | a2 = s0;
0x00408ba8 jalr t9 | t9 ();
0x00408bac j 0x408c00 | goto label_0;
0x00408bb0 nop |
| }
0x00408bb4 lui a2, 0x43 | a2 = 0x430000;
0x00408bb8 addiu a1, sp, 0x18 | a1 = sp + 0x18;
0x00408bbc addiu a2, a2, -0x6aa0 | a2 += -0x6aa0;
0x00408bc0 jal 0x404180 | fcn_00404180 ();
0x00408bc4 lw a1, 0x18(sp) | a1 = *(var_18h);
0x00408bc8 move s1, v0 | s1 = v0;
0x00408bcc slti v0, a1, 0x400 | v0 = (a1 < 0x400) ? 1 : 0;
0x00408bd0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00408bd4 bnez v0, 0x408c08 |
0x00408bd8 lw t9, -0x7fc8(gp) | t9 = sym.log_printf
0x00408bdc lui a1, 0x41 | a1 = 0x410000;
0x00408be0 move a0, zero | a0 = 0;
| /* str.msg_too_long__bigger_than_OT_MAX_PAYLOAD___d__n */
0x00408be4 addiu a1, a1, 0x67d8 | a1 += 0x67d8;
0x00408be8 addiu a2, zero, 0x400 | a2 = 0x400;
0x00408bec jalr t9 | t9 ();
0x00408bf0 lw gp, 0x10(sp) | gp = *(var_10h);
0x00408bf4 lw t9, -0x7e6c(gp) | t9 = sym.imp.free;
0x00408bf8 move a0, s1 | a0 = s1;
0x00408bfc jalr t9 | t9 ();
| label_0:
0x00408c00 j 0x408c18 | goto label_1;
0x00408c04 addiu v0, zero, -1 | v0 = -1;
| }
0x00408c08 move a0, s1 | a0 = s1;
0x00408c0c move a2, s0 | a2 = s0;
0x00408c10 move a3, s2 | a3 = s2;
0x00408c14 jal 0x406f0c | fcn_00406f0c ();
| label_1:
0x00408c18 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00408c1c lw s2, 0x28(sp) | s2 = *(var_28h);
0x00408c20 lw s1, 0x24(sp) | s1 = *(var_24h);
0x00408c24 lw s0, 0x20(sp) | s0 = *(var_20h);
0x00408c28 addiu sp, sp, 0x30 |
0x00408c2c jr ra | return v0;
| }
[*] Function printf used 368 times miio_client