[*] Binary protection state of ble_time_util
Full RELRO Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf tear down of ble_time_util
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/sbin/ble_time_util @ 0x40151c */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
0x0040151c lui gp, 2 |
0x00401520 addiu gp, gp, -0x24fc |
0x00401524 addu gp, gp, t9 | gp += t9;
0x00401528 addiu sp, sp, -0x40 |
0x0040152c sw ra, 0x3c(sp) | *(var_3ch) = ra;
0x00401530 sw fp, 0x38(sp) | *(var_38h) = fp;
0x00401534 move fp, sp | fp = sp;
0x00401538 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0040153c sw a0, 0x1c(fp) | *(arg_1ch) = a0;
0x00401540 sw a1, 0x18(fp) | *(arg_18h) = a1;
0x00401544 lw t8, -0x7f48(gp) | t8 = *((gp - 8146));
0x00401548 lw t8, (t8) | t8 = *(t8);
0x0040154c sw t8, 0x34(fp) | *(arg_34h) = t8;
0x00401550 sw zero, 0x24(fp) | *(arg_24h) = 0;
0x00401554 sw zero, 0x30(fp) | *(arg_30h) = 0;
0x00401558 sw zero, 0x28(fp) | *(arg_28h) = 0;
0x0040155c sw zero, 0x2c(fp) | *(arg_2ch) = 0;
0x00401560 lw t8, 0x1c(fp) | t8 = *(arg_1ch);
0x00401564 slti t8, t8, 2 | t8 = (t8 < 2) ? 1 : 0;
| if (t8 != 0) {
0x00401568 beqz t8, 0x40157c |
0x0040156c nop |
0x00401570 addiu t8, zero, -1 | t8 = -1;
0x00401574 b 0x40176c | goto label_0;
0x00401578 nop |
| }
0x0040157c lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00401580 addiu t8, t8, 4 | t8 += 4;
0x00401584 lw t8, (t8) | t8 = *(t8);
0x00401588 move a0, t8 | a0 = t8;
0x0040158c lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* str.time */
0x00401590 addiu a1, t8, 0x5834 | a1 = t8 + 0x5834;
0x00401594 lw t8, -0x7f5c(gp) | t8 = sym.imp.strcasecmp;
0x00401598 move t9, t8 | t9 = t8;
0x0040159c jalr t9 | t9 ();
0x004015a0 nop |
0x004015a4 lw gp, 0x10(fp) | gp = *(envp);
0x004015a8 move t8, v0 | t8 = v0;
| if (t8 == 0) {
0x004015ac bnez t8, 0x4015c0 |
0x004015b0 nop |
0x004015b4 sw zero, 0x24(fp) | *(arg_24h) = 0;
0x004015b8 b 0x40165c | goto label_1;
0x004015bc nop |
| }
0x004015c0 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x004015c4 addiu t8, t8, 4 | t8 += 4;
0x004015c8 lw t8, (t8) | t8 = *(t8);
0x004015cc move a0, t8 | a0 = t8;
0x004015d0 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* str.timezone */
0x004015d4 addiu a1, t8, 0x583c | a1 = t8 + 0x583c;
0x004015d8 lw t8, -0x7f5c(gp) | t8 = sym.imp.strcasecmp;
0x004015dc move t9, t8 | t9 = t8;
0x004015e0 jalr t9 | t9 ();
0x004015e4 nop |
0x004015e8 lw gp, 0x10(fp) | gp = *(envp);
0x004015ec move t8, v0 | t8 = v0;
| if (t8 == 0) {
0x004015f0 bnez t8, 0x401608 |
0x004015f4 nop |
0x004015f8 addiu t8, zero, 1 | t8 = 1;
0x004015fc sw t8, 0x24(fp) | *(arg_24h) = t8;
0x00401600 b 0x40165c | goto label_1;
0x00401604 nop |
| }
0x00401608 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x0040160c addiu t8, t8, 4 | t8 += 4;
0x00401610 lw t8, (t8) | t8 = *(t8);
0x00401614 move a0, t8 | a0 = t8;
0x00401618 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* str.full */
0x0040161c addiu a1, t8, 0x5848 | a1 = t8 + 0x5848;
0x00401620 lw t8, -0x7f5c(gp) | t8 = sym.imp.strcasecmp;
0x00401624 move t9, t8 | t9 = t8;
0x00401628 jalr t9 | t9 ();
0x0040162c nop |
0x00401630 lw gp, 0x10(fp) | gp = *(envp);
0x00401634 move t8, v0 | t8 = v0;
| if (t8 == 0) {
0x00401638 bnez t8, 0x401650 |
0x0040163c nop |
0x00401640 addiu t8, zero, 2 | t8 = 2;
0x00401644 sw t8, 0x24(fp) | *(arg_24h) = t8;
0x00401648 b 0x40165c | goto label_1;
0x0040164c nop |
| }
0x00401650 addiu t8, zero, -1 | t8 = -1;
0x00401654 b 0x40176c | goto label_0;
0x00401658 nop |
| label_1:
0x0040165c lw t8, 0x24(fp) | t8 = *(arg_24h);
| if (t8 == 0) {
0x00401660 bnez t8, 0x401698 |
0x00401664 nop |
0x00401668 lw t8, 0x1c(fp) | t8 = *(arg_1ch);
0x0040166c slti t8, t8, 3 | t8 = (t8 < 3) ? 1 : 0;
| if (t8 != 0) {
0x00401670 beqz t8, 0x401684 |
0x00401674 nop |
0x00401678 addiu t8, zero, -1 | t8 = -1;
0x0040167c b 0x40176c | goto label_0;
0x00401680 nop |
| }
0x00401684 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00401688 lw t8, 8(t8) | t8 = *((t8 + 2));
0x0040168c sw t8, 0x28(fp) | *(arg_28h) = t8;
0x00401690 b 0x40171c | goto label_2;
0x00401694 nop |
| }
0x00401698 lw v0, 0x24(fp) | v0 = *(arg_24h);
0x0040169c addiu t8, zero, 1 | t8 = 1;
| if (v0 == t8) {
0x004016a0 bne v0, t8, 0x4016d8 |
0x004016a4 nop |
0x004016a8 lw t8, 0x1c(fp) | t8 = *(arg_1ch);
0x004016ac slti t8, t8, 3 | t8 = (t8 < 3) ? 1 : 0;
| if (t8 != 0) {
0x004016b0 beqz t8, 0x4016c4 |
0x004016b4 nop |
0x004016b8 addiu t8, zero, -1 | t8 = -1;
0x004016bc b 0x40176c | goto label_0;
0x004016c0 nop |
| }
0x004016c4 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x004016c8 lw t8, 8(t8) | t8 = *((t8 + 2));
0x004016cc sw t8, 0x2c(fp) | *(arg_2ch) = t8;
0x004016d0 b 0x40171c | goto label_2;
0x004016d4 nop |
| }
0x004016d8 lw v0, 0x24(fp) | v0 = *(arg_24h);
0x004016dc addiu t8, zero, 2 | t8 = 2;
| if (v0 == t8) {
0x004016e0 bne v0, t8, 0x40171c |
0x004016e4 nop |
0x004016e8 lw t8, 0x1c(fp) | t8 = *(arg_1ch);
0x004016ec slti t8, t8, 4 | t8 = (t8 < 4) ? 1 : 0;
| if (t8 != 0) {
0x004016f0 beqz t8, 0x401704 |
0x004016f4 nop |
0x004016f8 addiu t8, zero, -1 | t8 = -1;
0x004016fc b 0x40176c | goto label_0;
0x00401700 nop |
| }
0x00401704 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00401708 lw t8, 8(t8) | t8 = *((t8 + 2));
0x0040170c sw t8, 0x2c(fp) | *(arg_2ch) = t8;
0x00401710 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00401714 lw t8, 0xc(t8) | t8 = *((t8 + 3));
0x00401718 sw t8, 0x28(fp) | *(arg_28h) = t8;
| }
| label_2:
0x0040171c lw a0, 0x28(fp) | a0 = *(arg_28h);
0x00401720 lw a1, 0x2c(fp) | a1 = *(arg_2ch);
0x00401724 lw t8, -0x7fd4(gp) | t8 = sym.set_time_full_char__char_;
0x00401728 move t9, t8 | t9 = t8;
0x0040172c jalr t9 | t9 ();
0x00401730 nop |
0x00401734 lw gp, 0x10(fp) | gp = *(envp);
0x00401738 move t8, v0 | t8 = v0;
0x0040173c sw t8, 0x30(fp) | *(arg_30h) = t8;
0x00401740 lw t8, 0x30(fp) | t8 = *(arg_30h);
| if (t8 != 0) {
0x00401744 beqz t8, 0x401768 |
0x00401748 nop |
0x0040174c lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* str.unknown_error */
0x00401750 addiu a0, t8, 0x5850 | a0 = t8 + 0x5850;
0x00401754 lw t8, -0x7fb4(gp) | t8 = sym.imp.printf
0x00401758 move t9, t8 | t9 = t8;
0x0040175c jalr t9 | t9 ();
0x00401760 nop |
0x00401764 lw gp, 0x10(fp) | gp = *(envp);
| }
0x00401768 move t8, zero | t8 = 0;
| label_0:
0x0040176c move v0, t8 | v0 = t8;
0x00401770 lw t8, -0x7f48(gp) | t8 = *((gp - 8146));
0x00401774 lw v1, 0x34(fp) | v1 = *(arg_34h);
0x00401778 lw t8, (t8) | t8 = *(t8);
| if (v1 != t8) {
0x0040177c beq v1, t8, 0x401794 |
0x00401780 nop |
0x00401784 lw t8, -0x7f88(gp) | t8 = sym.imp.__stack_chk_fail;
0x00401788 move t9, t8 | t9 = t8;
0x0040178c jalr t9 | t9 ();
0x00401790 nop |
| }
0x00401794 move sp, fp |
0x00401798 lw ra, 0x3c(sp) | ra = *(var_3ch);
0x0040179c lw fp, 0x38(sp) | fp = *(var_38h);
0x004017a0 addiu sp, sp, 0x40 |
0x004017a4 jr ra | return v1;
0x004017a8 nop |
| }
[*] Function printf used 2 times ble_time_util