[*] Binary protection state of motion_detection_bgm
Full RELRO Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of motion_detection_bgm
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/sbin/motion_detection_bgm @ 0x4022e8 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
0x004022e8 lui gp, 3 |
0x004022ec addiu gp, gp, -0x52a8 |
0x004022f0 addu gp, gp, t9 | gp += t9;
0x004022f4 addiu sp, sp, -0x288 |
0x004022f8 sw ra, 0x284(sp) | *(var_284h) = ra;
0x004022fc sw fp, 0x280(sp) | *(var_280h) = fp;
0x00402300 sw s1, 0x27c(sp) | *(var_27ch) = s1;
0x00402304 sw s0, 0x278(sp) | *(var_278h) = s0;
0x00402308 move fp, sp | fp = sp;
0x0040230c sw gp, 0x20(sp) | *(var_20h) = gp;
0x00402310 sw a0, 0x2c(fp) | *(arg_2ch) = a0;
0x00402314 sw a1, 0x28(fp) | *(arg_28h) = a1;
0x00402318 lw t8, -0x7e74(gp) | t8 = *((gp - 8093));
0x0040231c lw t8, (t8) | t8 = *(t8);
0x00402320 sw t8, 0x274(fp) | *(arg_274h) = t8;
0x00402324 addiu a0, zero, 0x9f8 | a0 = 0x9f8;
0x00402328 lw t8, -0x7f2c(gp) | t8 = sym.imp.operator_new_unsigned_int_;
0x0040232c move t9, t8 | t9 = t8;
0x00402330 jalr t9 | t9 ();
0x00402334 nop |
0x00402338 lw gp, 0x20(fp) | gp = *(arg_20h);
0x0040233c move t8, v0 | t8 = v0;
0x00402340 move s0, t8 | s0 = t8;
0x00402344 move v0, s0 | v0 = s0;
0x00402348 addiu t8, zero, 0x9f8 | t8 = 0x9f8;
0x0040234c move a0, v0 | a0 = v0;
0x00402350 move a1, zero | a1 = 0;
0x00402354 move a2, t8 | a2 = t8;
0x00402358 lw t8, -0x7f3c(gp) | t8 = sym.imp.memset;
0x0040235c move t9, t8 | t9 = t8;
0x00402360 jalr t9 | t9 ();
0x00402364 nop |
0x00402368 lw gp, 0x20(fp) | gp = *(arg_20h);
0x0040236c move a0, s0 | a0 = s0;
0x00402370 lw t8, -0x7fc8(gp) | t8 = *(gp);
0x00402374 move t9, t8 | t9 = t8;
0x00402378 jalr t9 | t9 ();
0x0040237c nop |
0x00402380 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402384 lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00402388 sw s0, (t8) | *(t8) = s0;
0x0040238c lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00402390 lw t8, (t8) | t8 = *(t8);
| if (t8 == 0) {
0x00402394 beqz t8, 0x4028d4 | goto label_0;
| }
0x00402398 nop |
0x0040239c addiu a0, zero, 2 | a0 = 2;
0x004023a0 lw a1, -0x7fc4(gp) | a1 = sym.signal_handle_int_;
0x004023a4 lw t8, -0x7f68(gp) | t8 = sym.imp.signal;
0x004023a8 move t9, t8 | t9 = t8;
0x004023ac jalr t9 | t9 ();
0x004023b0 nop |
0x004023b4 lw gp, 0x20(fp) | gp = *(arg_20h);
0x004023b8 addiu a0, zero, 0xf | a0 = 0xf;
0x004023bc lw a1, -0x7fc4(gp) | a1 = sym.signal_handle_int_;
0x004023c0 lw t8, -0x7f68(gp) | t8 = sym.imp.signal;
0x004023c4 move t9, t8 | t9 = t8;
0x004023c8 jalr t9 | t9 ();
0x004023cc nop |
0x004023d0 lw gp, 0x20(fp) | gp = *(arg_20h);
0x004023d4 addiu a0, zero, 0x10 | a0 = 0x10;
0x004023d8 lw a1, -0x7fc4(gp) | a1 = sym.signal_handle_int_;
0x004023dc lw t8, -0x7f68(gp) | t8 = sym.imp.signal;
0x004023e0 move t9, t8 | t9 = t8;
0x004023e4 jalr t9 | t9 ();
0x004023e8 nop |
0x004023ec lw gp, 0x20(fp) | gp = *(arg_20h);
0x004023f0 addiu a0, zero, 0x11 | a0 = 0x11;
0x004023f4 lw a1, -0x7fc4(gp) | a1 = sym.signal_handle_int_;
0x004023f8 lw t8, -0x7f68(gp) | t8 = sym.imp.signal;
0x004023fc move t9, t8 | t9 = t8;
0x00402400 jalr t9 | t9 ();
0x00402404 nop |
0x00402408 lw gp, 0x20(fp) | gp = *(arg_20h);
0x0040240c addiu t8, fp, 0x4c | t8 = fp + 0x4c;
0x00402410 move a0, t8 | a0 = t8;
0x00402414 move a1, zero | a1 = 0;
0x00402418 addiu a2, zero, 0x228 | a2 = 0x228;
0x0040241c lw t8, -0x7f3c(gp) | t8 = sym.imp.memset;
0x00402420 move t9, t8 | t9 = t8;
0x00402424 jalr t9 | t9 ();
0x00402428 nop |
0x0040242c lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402430 sw zero, 0x5c(fp) | *(arg_5ch) = 0;
0x00402434 sw zero, 0x60(fp) | *(arg_60h) = 0;
0x00402438 addiu v0, fp, 0x34 | v0 = fp + 0x34;
0x0040243c addiu t8, fp, 0x4c | t8 = fp + 0x4c;
0x00402440 move a0, v0 | a0 = v0;
0x00402444 move a1, zero | a1 = 0;
0x00402448 lw v0, -0x7fd4(gp) | v0 = *(gp);
| /* aav.0x00401c90 */
0x0040244c addiu a2, v0, 0x1c90 | a2 = v0 + 0x1c90;
0x00402450 move a3, t8 | a3 = t8;
0x00402454 lw t8, -0x7efc(gp) | t8 = sym.imp.pthread_create;
0x00402458 move t9, t8 | t9 = t8;
0x0040245c jalr t9 | t9 ();
0x00402460 nop |
0x00402464 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402468 sw v0, 0x38(fp) | *(arg_38h) = v0;
0x0040246c lw t8, 0x38(fp) | t8 = *(arg_38h);
| if (t8 >= 0) {
0x00402470 bgez t8, 0x4024e8 | goto label_1;
| }
0x00402474 nop |
0x00402478 lw t8, -0x7ef8(gp) | t8 = *((gp - 8126));
0x0040247c lw s0, (t8) | s0 = *(t8);
0x00402480 lw t8, -0x7fd4(gp) | t8 = *(gp);
| /* aav.0x00401920 */
0x00402484 addiu t8, t8, 0x1920 | t8 += 0x1920;
0x00402488 move t9, t8 | t9 = t8;
0x0040248c jalr t9 | t9 ();
0x00402490 nop |
0x00402494 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402498 move t8, v0 | t8 = v0;
0x0040249c lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str.main */
0x004024a0 addiu v0, v0, 0x1ed4 | v0 += 0x1ed4;
0x004024a4 sw v0, 0x10(sp) | *(var_10h) = v0;
0x004024a8 addiu v0, zero, 0x56 | v0 = 0x56;
0x004024ac sw v0, 0x14(sp) | *(var_14h) = v0;
0x004024b0 move a0, s0 | a0 = s0;
0x004024b4 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str._s____18s____24s__5d_create_thread_failed */
0x004024b8 addiu a1, v0, 0x1884 | a1 = v0 + 0x1884;
0x004024bc move a2, t8 | a2 = t8;
0x004024c0 lw t8, -0x7fd8(gp) | t8 = *((gp - 8182));
| /* esilref: 'ERROR' */
0x004024c4 addiu a3, t8, 0x18b4 | a3 = t8 + 0x18b4;
0x004024c8 lw t8, -0x7f44(gp) | t8 = sym.imp.fprintf
0x004024cc move t9, t8 | t9 = t8;
0x004024d0 jalr t9 | t9 ();
0x004024d4 nop |
0x004024d8 lw gp, 0x20(fp) | gp = *(arg_20h);
0x004024dc addiu t8, zero, -1 | t8 = -1;
0x004024e0 b 0x402948 | goto label_2;
0x004024e4 nop |
| do {
| label_1:
0x004024e8 lw t8, -0x7fd0(gp) | t8 = *(gp);
0x004024ec lw t8, (t8) | t8 = *(t8);
0x004024f0 lw t8, 0x10(t8) | t8 = *((t8 + 4));
| if (t8 != 0) {
0x004024f4 beqz t8, 0x402654 |
0x004024f8 nop |
0x004024fc lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00402500 lw t8, (t8) | t8 = *(t8);
0x00402504 sw zero, 0x10(t8) | *((t8 + 16)) = 0;
0x00402508 lw t8, -0x7fc0(gp) | t8 = sym.get_suspend_status__;
0x0040250c move t9, t8 | t9 = t8;
0x00402510 jalr t9 | t9 ();
0x00402514 nop |
0x00402518 lw gp, 0x20(fp) | gp = *(arg_20h);
0x0040251c move t8, v0 | t8 = v0;
0x00402520 sw t8, 0x3c(fp) | *(arg_3ch) = t8;
0x00402524 lw t8, -0x7ef8(gp) | t8 = *((gp - 8126));
0x00402528 lw s0, (t8) | s0 = *(t8);
0x0040252c lw t8, -0x7fd4(gp) | t8 = *(gp);
| /* aav.0x00401920 */
0x00402530 addiu t8, t8, 0x1920 | t8 += 0x1920;
0x00402534 move t9, t8 | t9 = t8;
0x00402538 jalr t9 | t9 ();
0x0040253c nop |
0x00402540 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402544 move t8, v0 | t8 = v0;
0x00402548 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str.main */
0x0040254c addiu v0, v0, 0x1ed4 | v0 += 0x1ed4;
0x00402550 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00402554 addiu v0, zero, 0x5e | v0 = 0x5e;
0x00402558 sw v0, 0x14(sp) | *(var_14h) = v0;
0x0040255c lw v0, 0x3c(fp) | v0 = *(arg_3ch);
0x00402560 sw v0, 0x18(sp) | *(var_18h) = v0;
0x00402564 move a0, s0 | a0 = s0;
0x00402568 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str._s____18s____24s__5d_MD_SUSPEND__d__n */
0x0040256c addiu a1, v0, 0x18bc | a1 = v0 + 0x18bc;
0x00402570 move a2, t8 | a2 = t8;
0x00402574 lw t8, -0x7fd8(gp) | t8 = *((gp - 8182));
| /* esilref: 'DEBUG' */
0x00402578 addiu a3, t8, 0x1808 | a3 = t8 + 0x1808;
0x0040257c lw t8, -0x7f44(gp) | t8 = sym.imp.fprintf
0x00402580 move t9, t8 | t9 = t8;
0x00402584 jalr t9 | t9 ();
0x00402588 nop |
0x0040258c lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402590 lw t8, 0x3c(fp) | t8 = *(arg_3ch);
| if (t8 < 0) {
0x00402594 bltz t8, 0x402654 | goto label_3;
| }
0x00402598 nop |
0x0040259c slti v0, t8, 2 | v0 = (t8 < 2) ? 1 : 0;
| if (v0 == 0) {
0x004025a0 bnez v0, 0x4025bc |
0x004025a4 nop |
0x004025a8 addiu v0, zero, 2 | v0 = 2;
| if (t8 == v0) {
0x004025ac beq t8, v0, 0x4025f4 | goto label_4;
| }
0x004025b0 nop |
0x004025b4 b 0x402654 | goto label_3;
0x004025b8 nop |
| }
0x004025bc lw v0, 0x5c(fp) | v0 = *(arg_5ch);
0x004025c0 addiu t8, zero, 2 | t8 = 2;
| if (v0 == t8) {
0x004025c4 bne v0, t8, 0x4025dc |
0x004025c8 nop |
0x004025cc lw t8, 0x3c(fp) | t8 = *(arg_3ch);
0x004025d0 sw t8, 0x60(fp) | *(arg_60h) = t8;
0x004025d4 b 0x402654 | goto label_3;
0x004025d8 nop |
| }
0x004025dc lw t8, 0x3c(fp) | t8 = *(arg_3ch);
0x004025e0 sw t8, 0x5c(fp) | *(arg_5ch) = t8;
0x004025e4 lw t8, 0x3c(fp) | t8 = *(arg_3ch);
0x004025e8 sw t8, 0x60(fp) | *(arg_60h) = t8;
0x004025ec b 0x402654 | goto label_3;
0x004025f0 nop |
| label_4:
0x004025f4 addiu t8, fp, 0x44 | t8 = fp + 0x44;
0x004025f8 move a0, t8 | a0 = t8;
0x004025fc move a1, zero | a1 = 0;
0x00402600 lw t8, -0x7e94(gp) | t8 = sym.imp.gettimeofday;
0x00402604 move t9, t8 | t9 = t8;
0x00402608 jalr t9 | t9 ();
0x0040260c nop |
0x00402610 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402614 lw t8, 0x44(fp) | t8 = *(arg_44h);
0x00402618 addiu t8, t8, 0xa | t8 += 0xa;
0x0040261c sw t8, 0x44(fp) | *(arg_44h) = t8;
0x00402620 lw v0, 0x44(fp) | v0 = *(arg_44h);
0x00402624 lw t8, 0x48(fp) | t8 = *(arg_48h);
0x00402628 sw v0, 0x6c(fp) | *(arg_6ch) = v0;
0x0040262c sw t8, 0x70(fp) | *(arg_70h) = t8;
0x00402630 lw v0, 0x5c(fp) | v0 = *(arg_5ch);
0x00402634 addiu t8, zero, 2 | t8 = 2;
| if (v0 != t8) {
0x00402638 beq v0, t8, 0x402650 |
0x0040263c nop |
0x00402640 lw t8, 0x5c(fp) | t8 = *(arg_5ch);
0x00402644 sw t8, 0x60(fp) | *(arg_60h) = t8;
0x00402648 lw t8, 0x3c(fp) | t8 = *(arg_3ch);
0x0040264c sw t8, 0x5c(fp) | *(arg_5ch) = t8;
| }
0x00402650 nop |
| }
| label_3:
0x00402654 lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00402658 lw t8, (t8) | t8 = *(t8);
0x0040265c lw t8, 8(t8) | t8 = *((t8 + 2));
| if (t8 != 0) {
0x00402660 beqz t8, 0x40270c |
0x00402664 nop |
0x00402668 lw t8, -0x7ef8(gp) | t8 = *((gp - 8126));
0x0040266c lw s0, (t8) | s0 = *(t8);
0x00402670 lw t8, -0x7fd4(gp) | t8 = *(gp);
| /* aav.0x00401920 */
0x00402674 addiu t8, t8, 0x1920 | t8 += 0x1920;
0x00402678 move t9, t8 | t9 = t8;
0x0040267c jalr t9 | t9 ();
0x00402680 nop |
0x00402684 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402688 move t8, v0 | t8 = v0;
0x0040268c lw v0, -0x7fd0(gp) | v0 = *(gp);
0x00402690 lw v0, (v0) | v0 = *(v0);
0x00402694 lw v0, 8(v0) | v0 = *((v0 + 2));
0x00402698 lw v1, -0x7fd8(gp) | v1 = *((gp - 8182));
| /* str.main */
0x0040269c addiu v1, v1, 0x1ed4 | v1 += 0x1ed4;
0x004026a0 sw v1, 0x10(sp) | *(var_10h) = v1;
0x004026a4 addiu v1, zero, 0x7d | v1 = 0x7d;
0x004026a8 sw v1, 0x14(sp) | *(var_14h) = v1;
0x004026ac sw v0, 0x18(sp) | *(var_18h) = v0;
0x004026b0 move a0, s0 | a0 = s0;
0x004026b4 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str._s____18s____24s__5d_LEAVE_g_leave_d_n */
0x004026b8 addiu a1, v0, 0x18e8 | a1 = v0 + 0x18e8;
0x004026bc move a2, t8 | a2 = t8;
0x004026c0 lw t8, -0x7fd8(gp) | t8 = *((gp - 8182));
| /* esilref: 'DEBUG' */
0x004026c4 addiu a3, t8, 0x1808 | a3 = t8 + 0x1808;
0x004026c8 lw t8, -0x7f44(gp) | t8 = sym.imp.fprintf
0x004026cc move t9, t8 | t9 = t8;
0x004026d0 jalr t9 | t9 ();
0x004026d4 nop |
0x004026d8 lw gp, 0x20(fp) | gp = *(arg_20h);
0x004026dc addiu t8, zero, 1 | t8 = 1;
0x004026e0 sw t8, 0x64(fp) | *(arg_64h) = t8;
0x004026e4 lw t8, 0x34(fp) | t8 = *(arg_34h);
0x004026e8 move a0, t8 | a0 = t8;
0x004026ec move a1, zero | a1 = 0;
0x004026f0 lw t8, -0x7f6c(gp) | t8 = sym.imp.pthread_join;
0x004026f4 move t9, t8 | t9 = t8;
0x004026f8 jalr t9 | t9 ();
0x004026fc nop |
0x00402700 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402704 b 0x40288c | goto label_5;
0x00402708 nop |
| }
0x0040270c lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00402710 lw t8, (t8) | t8 = *(t8);
0x00402714 lw t8, 0xc(t8) | t8 = *((t8 + 3));
| if (t8 != 0) {
0x00402718 beqz t8, 0x402868 |
0x0040271c nop |
0x00402720 lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00402724 lw t8, (t8) | t8 = *(t8);
0x00402728 sw zero, 0xc(t8) | *((t8 + 12)) = 0;
0x0040272c lw t8, -0x7ef8(gp) | t8 = *((gp - 8126));
0x00402730 lw s0, (t8) | s0 = *(t8);
0x00402734 lw t8, -0x7fd4(gp) | t8 = *(gp);
| /* aav.0x00401920 */
0x00402738 addiu t8, t8, 0x1920 | t8 += 0x1920;
0x0040273c move t9, t8 | t9 = t8;
0x00402740 jalr t9 | t9 ();
0x00402744 nop |
0x00402748 lw gp, 0x20(fp) | gp = *(arg_20h);
0x0040274c move t8, v0 | t8 = v0;
0x00402750 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str.main */
0x00402754 addiu v0, v0, 0x1ed4 | v0 += 0x1ed4;
0x00402758 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040275c addiu v0, zero, 0x85 | v0 = 0x85;
0x00402760 sw v0, 0x14(sp) | *(var_14h) = v0;
0x00402764 move a0, s0 | a0 = s0;
0x00402768 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str._s____18s____24s__5d_RELOAD_n */
0x0040276c addiu a1, v0, 0x1914 | a1 = v0 + 0x1914;
0x00402770 move a2, t8 | a2 = t8;
0x00402774 lw t8, -0x7fd8(gp) | t8 = *((gp - 8182));
| /* esilref: 'DEBUG' */
0x00402778 addiu a3, t8, 0x1808 | a3 = t8 + 0x1808;
0x0040277c lw t8, -0x7f44(gp) | t8 = sym.imp.fprintf
0x00402780 move t9, t8 | t9 = t8;
0x00402784 jalr t9 | t9 ();
0x00402788 nop |
0x0040278c lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402790 addiu t8, zero, 1 | t8 = 1;
0x00402794 sw t8, 0x64(fp) | *(arg_64h) = t8;
0x00402798 lw t8, 0x34(fp) | t8 = *(arg_34h);
0x0040279c move a0, t8 | a0 = t8;
0x004027a0 move a1, zero | a1 = 0;
0x004027a4 lw t8, -0x7f6c(gp) | t8 = sym.imp.pthread_join;
0x004027a8 move t9, t8 | t9 = t8;
0x004027ac jalr t9 | t9 ();
0x004027b0 nop |
0x004027b4 lw gp, 0x20(fp) | gp = *(arg_20h);
0x004027b8 sw zero, 0x64(fp) | *(arg_64h) = 0;
0x004027bc addiu v0, fp, 0x34 | v0 = fp + 0x34;
0x004027c0 addiu t8, fp, 0x4c | t8 = fp + 0x4c;
0x004027c4 move a0, v0 | a0 = v0;
0x004027c8 move a1, zero | a1 = 0;
0x004027cc lw v0, -0x7fd4(gp) | v0 = *(gp);
| /* aav.0x00401c90 */
0x004027d0 addiu a2, v0, 0x1c90 | a2 = v0 + 0x1c90;
0x004027d4 move a3, t8 | a3 = t8;
0x004027d8 lw t8, -0x7efc(gp) | t8 = sym.imp.pthread_create;
0x004027dc move t9, t8 | t9 = t8;
0x004027e0 jalr t9 | t9 ();
0x004027e4 nop |
0x004027e8 lw gp, 0x20(fp) | gp = *(arg_20h);
0x004027ec sw v0, 0x40(fp) | *(arg_40h) = v0;
0x004027f0 lw t8, 0x40(fp) | t8 = *(arg_40h);
| if (t8 >= 0) {
0x004027f4 bgez t8, 0x402868 | goto label_6;
| }
0x004027f8 nop |
0x004027fc lw t8, -0x7ef8(gp) | t8 = *((gp - 8126));
0x00402800 lw s0, (t8) | s0 = *(t8);
0x00402804 lw t8, -0x7fd4(gp) | t8 = *(gp);
| /* aav.0x00401920 */
0x00402808 addiu t8, t8, 0x1920 | t8 += 0x1920;
0x0040280c move t9, t8 | t9 = t8;
0x00402810 jalr t9 | t9 ();
0x00402814 nop |
0x00402818 lw gp, 0x20(fp) | gp = *(arg_20h);
0x0040281c move t8, v0 | t8 = v0;
0x00402820 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str.main */
0x00402824 addiu v0, v0, 0x1ed4 | v0 += 0x1ed4;
0x00402828 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0040282c addiu v0, zero, 0x8b | v0 = 0x8b;
0x00402830 sw v0, 0x14(sp) | *(var_14h) = v0;
0x00402834 move a0, s0 | a0 = s0;
0x00402838 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str._s____18s____24s__5d_create_thread_failed */
0x0040283c addiu a1, v0, 0x1884 | a1 = v0 + 0x1884;
0x00402840 move a2, t8 | a2 = t8;
0x00402844 lw t8, -0x7fd8(gp) | t8 = *((gp - 8182));
| /* esilref: 'ERROR' */
0x00402848 addiu a3, t8, 0x18b4 | a3 = t8 + 0x18b4;
0x0040284c lw t8, -0x7f44(gp) | t8 = sym.imp.fprintf
0x00402850 move t9, t8 | t9 = t8;
0x00402854 jalr t9 | t9 ();
0x00402858 nop |
0x0040285c lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402860 b 0x40288c | goto label_5;
0x00402864 nop |
| }
| label_6:
0x00402868 lui t8, 3 | t8 = 30000;
0x0040286c ori a0, t8, 0xd40 | a0 = 0x30d40;
0x00402870 lw t8, -0x7e7c(gp) | t8 = sym.imp.usleep;
0x00402874 move t9, t8 | t9 = t8;
0x00402878 jalr t9 | t9 ();
0x0040287c nop |
0x00402880 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402884 b 0x4024e8 |
| } while (1);
0x00402888 nop |
| label_5:
0x0040288c lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00402890 lw s0, (t8) | s0 = *(t8);
| if (s0 != 0) {
0x00402894 beqz s0, 0x4028cc |
0x00402898 nop |
0x0040289c move a0, s0 | a0 = s0;
0x004028a0 lw t8, -0x7fbc(gp) | t8 = *(gp);
0x004028a4 move t9, t8 | t9 = t8;
0x004028a8 jalr t9 | t9 ();
0x004028ac nop |
0x004028b0 lw gp, 0x20(fp) | gp = *(arg_20h);
0x004028b4 move a0, s0 | a0 = s0;
0x004028b8 lw t8, -0x7e88(gp) | t8 = sym.imp.operator_delete_void_;
0x004028bc move t9, t8 | t9 = t8;
0x004028c0 jalr t9 | t9 ();
0x004028c4 nop |
0x004028c8 lw gp, 0x20(fp) | gp = *(arg_20h);
| }
0x004028cc lw t8, -0x7fd0(gp) | t8 = *(gp);
0x004028d0 sw zero, (t8) | *(t8) = 0;
| label_0:
0x004028d4 lw t8, -0x7ef8(gp) | t8 = *((gp - 8126));
0x004028d8 lw s0, (t8) | s0 = *(t8);
0x004028dc lw t8, -0x7fd4(gp) | t8 = *(gp);
| /* aav.0x00401920 */
0x004028e0 addiu t8, t8, 0x1920 | t8 += 0x1920;
0x004028e4 move t9, t8 | t9 = t8;
0x004028e8 jalr t9 | t9 ();
0x004028ec nop |
0x004028f0 lw gp, 0x20(fp) | gp = *(arg_20h);
0x004028f4 move t8, v0 | t8 = v0;
0x004028f8 lw v0, 0x28(fp) | v0 = *(arg_28h);
0x004028fc lw v0, (v0) | v0 = *(v0);
0x00402900 lw v1, -0x7fd8(gp) | v1 = *((gp - 8182));
| /* str.main */
0x00402904 addiu v1, v1, 0x1ed4 | v1 += 0x1ed4;
0x00402908 sw v1, 0x10(sp) | *(var_10h) = v1;
0x0040290c addiu v1, zero, 0x94 | v1 = 0x94;
0x00402910 sw v1, 0x14(sp) | *(var_14h) = v1;
0x00402914 sw v0, 0x18(sp) | *(var_18h) = v0;
0x00402918 move a0, s0 | a0 = s0;
0x0040291c lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str._s____18s____24s__5d_bye__s_n */
0x00402920 addiu a1, v0, 0x1938 | a1 = v0 + 0x1938;
0x00402924 move a2, t8 | a2 = t8;
0x00402928 lw t8, -0x7fd8(gp) | t8 = *((gp - 8182));
| /* esilref: 'INFO' */
0x0040292c addiu a3, t8, 0x195c | a3 = t8 + 0x195c;
0x00402930 lw t8, -0x7f44(gp) | t8 = sym.imp.fprintf
0x00402934 move t9, t8 | t9 = t8;
0x00402938 jalr t9 | t9 ();
0x0040293c nop |
0x00402940 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00402944 move t8, zero | t8 = 0;
| label_2:
0x00402948 move v0, t8 | v0 = t8;
0x0040294c lw t8, -0x7e74(gp) | t8 = *((gp - 8093));
0x00402950 lw v1, 0x274(fp) | v1 = *(arg_274h);
0x00402954 lw t8, (t8) | t8 = *(t8);
| if (v1 != t8) {
0x00402958 beq v1, t8, 0x4029b0 |
0x0040295c nop |
0x00402960 b 0x4029a0 | goto label_7;
0x00402964 nop |
| label_7:
0x004029a0 lw t8, -0x7eec(gp) | t8 = sym.imp.__stack_chk_fail;
0x004029a4 move t9, t8 | t9 = t8;
0x004029a8 jalr t9 | t9 ();
0x004029ac nop |
| }
0x004029b0 move sp, fp |
0x004029b4 lw ra, 0x284(sp) | ra = *(var_284h);
0x004029b8 lw fp, 0x280(sp) | fp = *(var_280h);
0x004029bc lw s1, 0x27c(sp) | s1 = *(var_27ch);
0x004029c0 lw s0, 0x278(sp) | s0 = *(var_278h);
0x004029c4 addiu sp, sp, 0x288 |
0x004029c8 jr ra | return v1;
0x004029cc nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/sbin/motion_detection_bgm @ 0x406d30 */
| #include <stdint.h>
|
; (fcn) method.AMD_COMMON.amd_init_md_param_ () | void method_AMD_COMMON_amd_init_md_param_ () {
| /* AMD_COMMON::amd_init(md_param**) */
0x00406d30 lui gp, 2 |
0x00406d34 addiu gp, gp, 0x6310 |
0x00406d38 addu gp, gp, t9 | gp += t9;
0x00406d3c addiu sp, sp, -0x40 |
0x00406d40 sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x00406d44 sw fp, 0x38(sp) | *(var_38h) = fp;
0x00406d48 sw s0, 0x34(sp) | *(var_34h) = s0;
0x00406d4c move fp, sp | fp = sp;
0x00406d50 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00406d54 sw a0, 0x24(fp) | *(arg_24h) = a0;
0x00406d58 sw a1, 0x20(fp) | *(arg_20h) = a1;
0x00406d5c lw t8, -0x7e74(gp) | t8 = *((gp - 8093));
0x00406d60 lw t8, (t8) | t8 = *(t8);
0x00406d64 sw t8, 0x2c(fp) | *(arg_2ch) = t8;
0x00406d68 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406d6c sw zero, 0x844(t8) | *((t8 + 2116)) = 0;
0x00406d70 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406d74 sw zero, 0x848(t8) | *((t8 + 2120)) = 0;
0x00406d78 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406d7c sw zero, 8(t8) | *((t8 + 8)) = 0;
0x00406d80 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406d84 sw zero, 0xc(t8) | *((t8 + 12)) = 0;
0x00406d88 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406d8c sw zero, 0x10(t8) | *((t8 + 16)) = 0;
0x00406d90 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406d94 sw zero, 0x840(t8) | *((t8 + 2112)) = 0;
0x00406d98 addiu t8, zero, 0x4b0 | t8 = 0x4b0;
0x00406d9c sw t8, 0x28(fp) | *(arg_28h) = t8;
0x00406da0 lw t8, 0x28(fp) | t8 = *(arg_28h);
0x00406da4 move a0, t8 | a0 = t8;
0x00406da8 lw t8, -0x7e9c(gp) | t8 = sym.imp.malloc;
0x00406dac move t9, t8 | t9 = t8;
0x00406db0 jalr t9 | t9 ();
0x00406db4 nop |
0x00406db8 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00406dbc move t8, v0 | t8 = v0;
0x00406dc0 move v0, t8 | v0 = t8;
0x00406dc4 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406dc8 sw v0, 0x840(t8) | *((t8 + 2112)) = v0;
0x00406dcc lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406dd0 lw t8, 0x840(t8) | t8 = *((t8 + 528));
| if (t8 == 0) {
0x00406dd4 bnez t8, 0x406e4c |
0x00406dd8 nop |
0x00406ddc lw t8, -0x7ef8(gp) | t8 = *((gp - 8126));
0x00406de0 lw s0, (t8) | s0 = *(t8);
0x00406de4 lw t8, -0x7fd4(gp) | t8 = *(gp);
| /* aav.0x00406940 */
0x00406de8 addiu t8, t8, 0x6940 | t8 += 0x6940;
0x00406dec move t9, t8 | t9 = t8;
0x00406df0 jalr t9 | t9 ();
0x00406df4 nop |
0x00406df8 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00406dfc move t8, v0 | t8 = v0;
0x00406e00 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* esilref: 'amd_init' */
0x00406e04 addiu v0, v0, 0x24a4 | v0 += 0x24a4;
0x00406e08 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00406e0c addiu v0, zero, 0x2f | v0 = 0x2f;
0x00406e10 sw v0, 0x14(sp) | *(var_14h) = v0;
0x00406e14 move a0, s0 | a0 = s0;
0x00406e18 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str._s____18s____24s__5d_malloc_motion_map_fail_n */
0x00406e1c addiu a1, v0, 0x1f08 | a1 = v0 + 0x1f08;
0x00406e20 move a2, t8 | a2 = t8;
0x00406e24 lw t8, -0x7fd8(gp) | t8 = *((gp - 8182));
| /* esilref: 'ERROR' */
0x00406e28 addiu a3, t8, 0x1f3c | a3 = t8 + 0x1f3c;
0x00406e2c lw t8, -0x7f44(gp) | t8 = sym.imp.fprintf
0x00406e30 move t9, t8 | t9 = t8;
0x00406e34 jalr t9 | t9 ();
0x00406e38 nop |
0x00406e3c lw gp, 0x18(fp) | gp = *(arg_18h);
0x00406e40 addiu t8, zero, -1 | t8 = -1;
0x00406e44 b 0x406eb8 | goto label_0;
0x00406e48 nop |
| }
0x00406e4c lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406e50 lw v0, 0x840(t8) | v0 = *((t8 + 528));
0x00406e54 lw t8, 0x28(fp) | t8 = *(arg_28h);
0x00406e58 move a0, v0 | a0 = v0;
0x00406e5c move a1, zero | a1 = 0;
0x00406e60 move a2, t8 | a2 = t8;
0x00406e64 lw t8, -0x7f3c(gp) | t8 = sym.imp.memset;
0x00406e68 move t9, t8 | t9 = t8;
0x00406e6c jalr t9 | t9 ();
0x00406e70 nop |
0x00406e74 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00406e78 lw t8, 0x20(fp) | t8 = *(arg_20h);
0x00406e7c lw v0, (t8) | v0 = *(t8);
0x00406e80 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406e84 lw t8, 0x840(t8) | t8 = *((t8 + 528));
0x00406e88 move a0, v0 | a0 = v0;
0x00406e8c move a1, t8 | a1 = t8;
0x00406e90 lw t8, -0x7fa0(gp) | t8 = sym.motion_mapping_md_param__unsigned_char_;
0x00406e94 move t9, t8 | t9 = t8;
0x00406e98 jalr t9 | t9 ();
0x00406e9c nop |
0x00406ea0 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00406ea4 lw t8, 0x20(fp) | t8 = *(arg_20h);
0x00406ea8 lw v0, (t8) | v0 = *(t8);
0x00406eac lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00406eb0 sw v0, 0x83c(t8) | *((t8 + 2108)) = v0;
0x00406eb4 move t8, zero | t8 = 0;
| label_0:
0x00406eb8 move v0, t8 | v0 = t8;
0x00406ebc lw t8, -0x7e74(gp) | t8 = *((gp - 8093));
0x00406ec0 lw v1, 0x2c(fp) | v1 = *(arg_2ch);
0x00406ec4 lw t8, (t8) | t8 = *(t8);
| if (v1 != t8) {
0x00406ec8 beq v1, t8, 0x406ee0 |
0x00406ecc nop |
0x00406ed0 lw t8, -0x7eec(gp) | t8 = sym.imp.__stack_chk_fail;
0x00406ed4 move t9, t8 | t9 = t8;
0x00406ed8 jalr t9 | t9 ();
0x00406edc nop |
| }
0x00406ee0 move sp, fp |
0x00406ee4 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x00406ee8 lw fp, 0x38(sp) | fp = *(var_38h);
0x00406eec lw s0, 0x34(sp) | s0 = *(var_34h);
0x00406ef0 addiu sp, sp, 0x40 |
0x00406ef4 jr ra | return v1;
0x00406ef8 nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/sbin/motion_detection_bgm @ 0x4019fc */
| #include <stdint.h>
|
; (fcn) sym.signal_handle_int_ () | void signal_handle_int_ () {
| /* signal_handle(int) */
0x004019fc lui gp, 3 |
0x00401a00 addiu gp, gp, -0x49bc |
0x00401a04 addu gp, gp, t9 | gp += t9;
0x00401a08 addiu sp, sp, -0x48 |
0x00401a0c sw ra, 0x44(sp) | *(var_44h) = ra;
0x00401a10 sw fp, 0x40(sp) | *(var_40h) = fp;
0x00401a14 sw s0, 0x3c(sp) | *(var_3ch) = s0;
0x00401a18 move fp, sp | fp = sp;
0x00401a1c sw gp, 0x20(sp) | *(var_20h) = gp;
0x00401a20 sw a0, 0x2c(fp) | *(arg_2ch) = a0;
0x00401a24 lw t8, -0x7e74(gp) | t8 = *((gp - 8093));
0x00401a28 lw t8, (t8) | t8 = *(t8);
0x00401a2c sw t8, 0x34(fp) | *(arg_34h) = t8;
0x00401a30 lw t8, -0x7ef8(gp) | t8 = *((gp - 8126));
0x00401a34 lw s0, (t8) | s0 = *(t8);
0x00401a38 lw t8, -0x7fd4(gp) | t8 = *(gp);
| /* aav.0x00401920 */
0x00401a3c addiu t8, t8, 0x1920 | t8 += 0x1920;
0x00401a40 move t9, t8 | t9 = t8;
0x00401a44 jalr t9 | t9 ();
0x00401a48 nop |
0x00401a4c lw gp, 0x20(fp) | gp = *(arg_20h);
0x00401a50 move t8, v0 | t8 = v0;
0x00401a54 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str.signal_handle */
0x00401a58 addiu v0, v0, 0x1ec4 | v0 += 0x1ec4;
0x00401a5c sw v0, 0x10(sp) | *(var_10h) = v0;
0x00401a60 addiu v0, zero, 0xc | v0 = 0xc;
0x00401a64 sw v0, 0x14(sp) | *(var_14h) = v0;
0x00401a68 lw v0, 0x2c(fp) | v0 = *(arg_2ch);
0x00401a6c sw v0, 0x18(sp) | *(var_18h) = v0;
0x00401a70 move a0, s0 | a0 = s0;
0x00401a74 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
| /* str._s____18s____24s__5d_recieve_signal:__d_n */
0x00401a78 addiu a1, v0, 0x17d8 | a1 = v0 + 0x17d8;
0x00401a7c move a2, t8 | a2 = t8;
0x00401a80 lw t8, -0x7fd8(gp) | t8 = *((gp - 8182));
| /* esilref: 'DEBUG' */
0x00401a84 addiu a3, t8, 0x1808 | a3 = t8 + 0x1808;
0x00401a88 lw t8, -0x7f44(gp) | t8 = sym.imp.fprintf
0x00401a8c move t9, t8 | t9 = t8;
0x00401a90 jalr t9 | t9 ();
0x00401a94 nop |
0x00401a98 lw gp, 0x20(fp) | gp = *(arg_20h);
0x00401a9c lw t8, 0x2c(fp) | t8 = *(arg_2ch);
0x00401aa0 addiu v0, zero, 0xf | v0 = 0xf;
| if (t8 != v0) {
0x00401aa4 beq t8, v0, 0x401aec |
0x00401aa8 nop |
0x00401aac slti v0, t8, 0x10 | v0 = (t8 < 0x10) ? 1 : 0;
| if (v0 != 0) {
0x00401ab0 beqz v0, 0x401acc |
0x00401ab4 nop |
0x00401ab8 addiu v0, zero, 2 | v0 = 2;
| if (t8 == v0) {
0x00401abc beq t8, v0, 0x401aec | goto label_0;
| }
0x00401ac0 nop |
0x00401ac4 b 0x401b30 | goto label_1;
0x00401ac8 nop |
| }
0x00401acc addiu v0, zero, 0x10 | v0 = 0x10;
| if (t8 == v0) {
0x00401ad0 beq t8, v0, 0x401b04 | goto label_2;
| }
0x00401ad4 nop |
0x00401ad8 addiu v0, zero, 0x11 | v0 = 0x11;
| if (t8 == v0) {
0x00401adc beq t8, v0, 0x401b1c | goto label_3;
| }
0x00401ae0 nop |
0x00401ae4 b 0x401b30 | goto label_1;
0x00401ae8 nop |
| }
| label_0:
0x00401aec lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00401af0 lw t8, (t8) | t8 = *(t8);
0x00401af4 addiu v0, zero, 1 | v0 = 1;
0x00401af8 sw v0, 8(t8) | *((t8 + 8)) = v0;
0x00401afc b 0x401b30 | goto label_1;
0x00401b00 nop |
| label_2:
0x00401b04 lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00401b08 lw t8, (t8) | t8 = *(t8);
0x00401b0c addiu v0, zero, 1 | v0 = 1;
0x00401b10 sw v0, 0x10(t8) | *((t8 + 16)) = v0;
0x00401b14 b 0x401b30 | goto label_1;
0x00401b18 nop |
| label_3:
0x00401b1c lw t8, -0x7fd0(gp) | t8 = *(gp);
0x00401b20 lw t8, (t8) | t8 = *(t8);
0x00401b24 addiu v0, zero, 1 | v0 = 1;
0x00401b28 sw v0, 0xc(t8) | *((t8 + 12)) = v0;
0x00401b2c nop |
| label_1:
0x00401b30 lw t8, -0x7e74(gp) | t8 = *((gp - 8093));
0x00401b34 lw v0, 0x34(fp) | v0 = *(arg_34h);
0x00401b38 lw t8, (t8) | t8 = *(t8);
| if (v0 != t8) {
0x00401b3c beq v0, t8, 0x401b54 |
0x00401b40 nop |
0x00401b44 lw t8, -0x7eec(gp) | t8 = sym.imp.__stack_chk_fail;
0x00401b48 move t9, t8 | t9 = t8;
0x00401b4c jalr t9 | t9 ();
0x00401b50 nop |
| }
0x00401b54 move sp, fp |
0x00401b58 lw ra, 0x44(sp) | ra = *(var_44h);
0x00401b5c lw fp, 0x40(sp) | fp = *(var_40h);
0x00401b60 lw s0, 0x3c(sp) | s0 = *(var_3ch);
0x00401b64 addiu sp, sp, 0x48 |
0x00401b68 jr ra | return v0;
0x00401b6c nop |
| }
[*] Function fprintf used 9 times motion_detection_bgm