[*] Binary protection state of ble_time_util
Full RELRO Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function system 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 @ 0x400f30 */
| #include <stdint.h>
|
; (fcn) sym.set_time_full_char__char_ () | void set_time_full_char_char_ () {
| /* set_time_full(char*, char*) */
0x00400f30 lui gp, 2 |
0x00400f34 addiu gp, gp, -0x1f10 |
0x00400f38 addu gp, gp, t9 | gp += t9;
0x00400f3c addiu sp, sp, -0x12e0 |
0x00400f40 sw ra, 0x12dc(sp) | *(var_12dch) = ra;
0x00400f44 sw fp, 0x12d8(sp) | *(var_12d8h) = fp;
0x00400f48 sw s0, 0x12d4(sp) | *(var_12d4h) = s0;
0x00400f4c move fp, sp | fp = sp;
0x00400f50 sw gp, 0x28(sp) | *(var_28h) = gp;
0x00400f54 sw a0, 0x34(fp) | *(arg_34h) = a0;
0x00400f58 sw a1, 0x30(fp) | *(arg_30h) = a1;
0x00400f5c lw t8, -0x7f48(gp) | t8 = *((gp - 8146));
0x00400f60 lw t8, (t8) | t8 = *(t8);
0x00400f64 sw t8, 0x12cc(fp) | *(arg_12cch) = t8;
0x00400f68 addiu t8, zero, 0x3a | t8 = 0x3a;
0x00400f6c sh t8, 0x10b4(fp) | *(arg_10b4h) = t8;
0x00400f70 addiu v0, fp, 0x10cc | v0 = fp + 0x10cc;
0x00400f74 addiu t8, zero, 0x100 | t8 = 0x100;
0x00400f78 move a0, v0 | a0 = v0;
0x00400f7c move a1, zero | a1 = 0;
0x00400f80 move a2, t8 | a2 = t8;
0x00400f84 lw t8, -0x7f9c(gp) | t8 = sym.imp.memset;
0x00400f88 move t9, t8 | t9 = t8;
0x00400f8c jalr t9 | t9 ();
0x00400f90 nop |
0x00400f94 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00400f98 sw zero, 0x48(fp) | *(arg_48h) = 0;
0x00400f9c sw zero, 0x40(fp) | *(arg_40h) = 0;
0x00400fa0 sw zero, 0x10b8(fp) | *(arg_10b8h) = 0;
0x00400fa4 sw zero, 0x10bc(fp) | *(arg_10bch) = 0;
0x00400fa8 sw zero, 0x10c0(fp) | *(arg_10c0h) = 0;
0x00400fac sw zero, 0x10c4(fp) | *(arg_10c4h) = 0;
0x00400fb0 sw zero, 0x10c8(fp) | *(arg_10c8h) = 0;
0x00400fb4 addiu v0, fp, 0x11cc | v0 = fp + 0x11cc;
0x00400fb8 addiu t8, zero, 0x100 | t8 = 0x100;
0x00400fbc move a0, v0 | a0 = v0;
0x00400fc0 move a1, zero | a1 = 0;
0x00400fc4 move a2, t8 | a2 = t8;
0x00400fc8 lw t8, -0x7f9c(gp) | t8 = sym.imp.memset;
0x00400fcc move t9, t8 | t9 = t8;
0x00400fd0 jalr t9 | t9 ();
0x00400fd4 nop |
0x00400fd8 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00400fdc addiu t8, fp, 0x9c | t8 = fp + 0x9c;
0x00400fe0 move a0, t8 | a0 = t8;
0x00400fe4 lw t8, -0x7fdc(gp) | t8 = *(gp);
0x00400fe8 move t9, t8 | t9 = t8;
0x00400fec jalr t9 | t9 ();
0x00400ff0 nop |
0x00400ff4 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00400ff8 sw zero, 0x44(fp) | *(arg_44h) = 0;
0x00400ffc lw t8, 0x34(fp) | t8 = *(arg_34h);
| if (t8 == 0) {
0x00401000 beqz t8, 0x4012b0 | goto label_0;
| }
0x00401004 nop |
0x00401008 addiu t8, fp, 0x10cc | t8 = fp + 0x10cc;
0x0040100c move a0, t8 | a0 = t8;
0x00401010 addiu a1, zero, 0x100 | a1 = 0x100;
0x00401014 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* section..rodata */
0x00401018 addiu a2, t8, 0x57a0 | a2 = t8 + 0x57a0;
0x0040101c lw a3, 0x34(fp) | a3 = *(arg_34h);
0x00401020 lw t8, -0x7f70(gp) | t8 = sym.imp.snprintf;
0x00401024 move t9, t8 | t9 = t8;
0x00401028 jalr t9 | t9 ();
0x0040102c nop |
0x00401030 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401034 addiu v0, fp, 0x10cc | v0 = fp + 0x10cc;
0x00401038 addiu t8, fp, 0x10b4 | t8 = fp + 0x10b4;
0x0040103c move a0, v0 | a0 = v0;
0x00401040 move a1, t8 | a1 = t8;
0x00401044 lw t8, -0x7f8c(gp) | t8 = sym.imp.strtok;
0x00401048 move t9, t8 | t9 = t8;
0x0040104c jalr t9 | t9 ();
0x00401050 nop |
0x00401054 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401058 sw v0, 0x48(fp) | *(arg_48h) = v0;
0x0040105c lw t8, 0x48(fp) | t8 = *(arg_48h);
| if (t8 != 0) {
0x00401060 beqz t8, 0x401094 |
0x00401064 nop |
0x00401068 lw a0, 0x48(fp) | a0 = *(arg_48h);
0x0040106c lw t8, -0x7fac(gp) | t8 = sym.imp.atoi;
0x00401070 move t9, t8 | t9 = t8;
0x00401074 jalr t9 | t9 ();
0x00401078 nop |
0x0040107c lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401080 lw t8, 0x40(fp) | t8 = *(arg_40h);
0x00401084 sll t8, t8, 2 | t8 <<= 2;
0x00401088 addiu v1, fp, 0x12d0 | v1 = fp + 0x12d0;
0x0040108c addu t8, v1, t8 | t8 = v1 + t8;
0x00401090 sw v0, -0x1280(t8) | *((t8 - 4736)) = v0;
| }
0x00401094 b 0x4010d4 | goto label_1;
0x00401098 nop |
| do {
0x0040109c lw t8, 0x40(fp) | t8 = *(arg_40h);
0x004010a0 addiu t8, t8, 1 | t8++;
0x004010a4 sw t8, 0x40(fp) | *(arg_40h) = t8;
0x004010a8 lw a0, 0x48(fp) | a0 = *(arg_48h);
0x004010ac lw t8, -0x7fac(gp) | t8 = sym.imp.atoi;
0x004010b0 move t9, t8 | t9 = t8;
0x004010b4 jalr t9 | t9 ();
0x004010b8 nop |
0x004010bc lw gp, 0x28(fp) | gp = *(arg_28h);
0x004010c0 lw t8, 0x40(fp) | t8 = *(arg_40h);
0x004010c4 sll t8, t8, 2 | t8 <<= 2;
0x004010c8 addiu v1, fp, 0x12d0 | v1 = fp + 0x12d0;
0x004010cc addu t8, v1, t8 | t8 = v1 + t8;
0x004010d0 sw v0, -0x1280(t8) | *((t8 - 4736)) = v0;
| label_1:
0x004010d4 addiu t8, fp, 0x10b4 | t8 = fp + 0x10b4;
0x004010d8 move a0, zero | a0 = 0;
0x004010dc move a1, t8 | a1 = t8;
0x004010e0 lw t8, -0x7f8c(gp) | t8 = sym.imp.strtok;
0x004010e4 move t9, t8 | t9 = t8;
0x004010e8 jalr t9 | t9 ();
0x004010ec nop |
0x004010f0 lw gp, 0x28(fp) | gp = *(arg_28h);
0x004010f4 sw v0, 0x48(fp) | *(arg_48h) = v0;
0x004010f8 lw t8, 0x48(fp) | t8 = *(arg_48h);
0x004010fc sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x00401100 andi t8, t8, 0xff | t8 &= 0xff;
0x00401104 bnez t8, 0x40109c |
| } while (t8 != 0);
0x00401108 nop |
0x0040110c lw v0, 0x40(fp) | v0 = *(arg_40h);
0x00401110 addiu t8, zero, 5 | t8 = 5;
| if (v0 != t8) {
0x00401114 beq v0, t8, 0x401128 |
0x00401118 nop |
0x0040111c addiu s0, zero, -1 | s0 = -1;
0x00401120 b 0x401448 | goto label_2;
0x00401124 nop |
| }
0x00401128 lw t8, 0x50(fp) | t8 = *(arg_50h);
0x0040112c sw t8, 0x84(fp) | *(arg_84h) = t8;
0x00401130 lw t8, 0x54(fp) | t8 = *(arg_54h);
0x00401134 sw t8, 0x88(fp) | *(arg_88h) = t8;
0x00401138 lw t8, 0x58(fp) | t8 = *(arg_58h);
0x0040113c sw t8, 0x8c(fp) | *(arg_8ch) = t8;
0x00401140 lw t8, 0x5c(fp) | t8 = *(arg_5ch);
0x00401144 sw t8, 0x90(fp) | *(arg_90h) = t8;
0x00401148 lw t8, 0x60(fp) | t8 = *(arg_60h);
0x0040114c sw t8, 0x94(fp) | *(arg_94h) = t8;
0x00401150 lw t8, 0x64(fp) | t8 = *(arg_64h);
0x00401154 sw t8, 0x98(fp) | *(arg_98h) = t8;
0x00401158 addiu t8, fp, 0x68 | t8 = fp + 0x68;
0x0040115c move a0, t8 | a0 = t8;
0x00401160 lw t8, -0x7f98(gp) | t8 = sym.imp.cam_check_curtime__curtime_setting_;
0x00401164 move t9, t8 | t9 = t8;
0x00401168 jalr t9 | t9 ();
0x0040116c nop |
0x00401170 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401174 move t8, v0 | t8 = v0;
0x00401178 sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x0040117c andi t8, t8, 0xff | t8 &= 0xff;
| if (t8 != 0) {
0x00401180 beqz t8, 0x401194 |
0x00401184 nop |
0x00401188 addiu s0, zero, -1 | s0 = -1;
0x0040118c b 0x401448 | goto label_2;
0x00401190 nop |
| }
0x00401194 lw t8, 0x88(fp) | t8 = *(arg_88h);
0x00401198 lw a3, 0x8c(fp) | a3 = *(arg_8ch);
0x0040119c lw a2, 0x90(fp) | a2 = *(arg_90h);
0x004011a0 lw a1, 0x94(fp) | a1 = *(arg_94h);
0x004011a4 lw a0, 0x84(fp) | a0 = *(arg_84h);
0x004011a8 lw v1, 0x98(fp) | v1 = *(arg_98h);
0x004011ac addiu v0, fp, 0x10b8 | v0 = fp + 0x10b8;
0x004011b0 sw a3, 0x10(sp) | *(var_10h) = a3;
0x004011b4 sw a2, 0x14(sp) | *(var_14h) = a2;
0x004011b8 sw a1, 0x18(sp) | *(var_18h) = a1;
0x004011bc sw a0, 0x1c(sp) | *(var_1ch) = a0;
0x004011c0 sw v1, 0x20(sp) | *(var_20h) = v1;
0x004011c4 move a0, v0 | a0 = v0;
0x004011c8 addiu a1, zero, 0x14 | a1 = 0x14;
0x004011cc lw v0, -0x7fd8(gp) | v0 = *(gp);
| /* str._02d_02d_02d_02d_d._02d */
0x004011d0 addiu a2, v0, 0x57a4 | a2 = v0 + 0x57a4;
0x004011d4 move a3, t8 | a3 = t8;
0x004011d8 lw t8, -0x7f70(gp) | t8 = sym.imp.snprintf;
0x004011dc move t9, t8 | t9 = t8;
0x004011e0 jalr t9 | t9 ();
0x004011e4 nop |
0x004011e8 lw gp, 0x28(fp) | gp = *(arg_28h);
0x004011ec addiu t8, fp, 0x9c | t8 = fp + 0x9c;
0x004011f0 move a0, t8 | a0 = t8;
0x004011f4 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* esilref: 'TMP' */
0x004011f8 addiu a1, t8, 0x57bc | a1 = t8 + 0x57bc;
0x004011fc move a2, zero | a2 = 0;
0x00401200 lw t8, -0x7fa8(gp) | t8 = *(gp);
0x00401204 move t9, t8 | t9 = t8;
0x00401208 jalr t9 | t9 ();
0x0040120c nop |
0x00401210 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401214 addiu v0, fp, 0x9c | v0 = fp + 0x9c;
0x00401218 addiu t8, fp, 0x10b8 | t8 = fp + 0x10b8;
0x0040121c move a0, v0 | a0 = v0;
0x00401220 lw v0, -0x7fd8(gp) | v0 = *(gp);
| /* str.DataParam */
0x00401224 addiu a1, v0, 0x57c0 | a1 = v0 + 0x57c0;
0x00401228 move a2, t8 | a2 = t8;
0x0040122c lw t8, -0x7f44(gp) | t8 = *(gp);
0x00401230 move t9, t8 | t9 = t8;
0x00401234 jalr t9 | t9 ();
0x00401238 nop |
0x0040123c lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401240 addiu t8, fp, 0x9c | t8 = fp + 0x9c;
0x00401244 move a0, t8 | a0 = t8;
0x00401248 lw t8, -0x7f40(gp) | t8 = *(gp);
0x0040124c move t9, t8 | t9 = t8;
0x00401250 jalr t9 | t9 ();
0x00401254 nop |
0x00401258 lw gp, 0x28(fp) | gp = *(arg_28h);
0x0040125c addiu v0, fp, 0x11cc | v0 = fp + 0x11cc;
0x00401260 addiu t8, fp, 0x10b8 | t8 = fp + 0x10b8;
0x00401264 move a0, v0 | a0 = v0;
0x00401268 addiu a1, zero, 0x100 | a1 = 0x100;
0x0040126c lw v0, -0x7fd8(gp) | v0 = *(gp);
| /* str.date__u__s___hwclock__w__u_ */
0x00401270 addiu a2, v0, 0x57cc | a2 = v0 + 0x57cc;
0x00401274 move a3, t8 | a3 = t8;
0x00401278 lw t8, -0x7f70(gp) | t8 = sym.imp.snprintf;
0x0040127c move t9, t8 | t9 = t8;
0x00401280 jalr t9 | t9 ();
0x00401284 nop |
0x00401288 lw gp, 0x28(fp) | gp = *(arg_28h);
0x0040128c addiu t8, fp, 0x11cc | t8 = fp + 0x11cc;
0x00401290 move a0, t8 | a0 = t8;
0x00401294 lw t8, -0x7f50(gp) | t8 = sym.imp.system
0x00401298 move t9, t8 | t9 = t8;
0x0040129c jalr t9 | t9 ();
0x004012a0 nop |
0x004012a4 lw gp, 0x28(fp) | gp = *(arg_28h);
0x004012a8 addiu t8, zero, 1 | t8 = 1;
0x004012ac sw t8, 0x44(fp) | *(arg_44h) = t8;
| label_0:
0x004012b0 lw t8, 0x30(fp) | t8 = *(arg_30h);
| if (t8 != 0) {
0x004012b4 beqz t8, 0x401418 |
0x004012b8 nop |
0x004012bc addiu t8, fp, 0x3c | t8 = fp + 0x3c;
0x004012c0 move a0, t8 | a0 = t8;
0x004012c4 lw t8, -0x7f80(gp) | t8 = *(gp);
0x004012c8 move t9, t8 | t9 = t8;
0x004012cc jalr t9 | t9 ();
0x004012d0 nop |
0x004012d4 lw gp, 0x28(fp) | gp = *(arg_28h);
0x004012d8 addiu t8, fp, 0x3c | t8 = fp + 0x3c;
0x004012dc move a0, t8 | a0 = t8;
0x004012e0 lw a1, 0x30(fp) | a1 = *(arg_30h);
0x004012e4 lw t8, -0x7f78(gp) | t8 = *(gp);
0x004012e8 move t9, t8 | t9 = t8;
0x004012ec jalr t9 | t9 ();
0x004012f0 nop |
0x004012f4 lw gp, 0x28(fp) | gp = *(arg_28h);
0x004012f8 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* str._etc_TZ */
0x004012fc addiu a0, t8, 0x57e8 | a0 = t8 + 0x57e8;
0x00401300 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* esilref: 'w+' */
0x00401304 addiu a1, t8, 0x57f0 | a1 = t8 + 0x57f0;
0x00401308 lw t8, -0x7f64(gp) | t8 = sym.imp.fopen64;
0x0040130c move t9, t8 | t9 = t8;
0x00401310 jalr t9 | t9 ();
0x00401314 nop |
0x00401318 lw gp, 0x28(fp) | gp = *(arg_28h);
0x0040131c move t8, v0 | t8 = v0;
0x00401320 sw t8, 0x4c(fp) | *(arg_4ch) = t8;
0x00401324 lw t8, 0x4c(fp) | t8 = *(arg_4ch);
| if (t8 != 0) {
0x00401328 beqz t8, 0x401388 |
0x0040132c nop |
0x00401330 lw a0, 0x30(fp) | a0 = *(arg_30h);
0x00401334 lw t8, -0x7f68(gp) | t8 = sym.imp.strlen;
0x00401338 move t9, t8 | t9 = t8;
0x0040133c jalr t9 | t9 ();
0x00401340 nop |
0x00401344 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401348 move t8, v0 | t8 = v0;
0x0040134c lw a0, 0x30(fp) | a0 = *(arg_30h);
0x00401350 addiu a1, zero, 1 | a1 = 1;
0x00401354 move a2, t8 | a2 = t8;
0x00401358 lw a3, 0x4c(fp) | a3 = *(arg_4ch);
0x0040135c lw t8, -0x7f4c(gp) | t8 = sym.imp.fwrite;
0x00401360 move t9, t8 | t9 = t8;
0x00401364 jalr t9 | t9 ();
0x00401368 nop |
0x0040136c lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401370 lw a0, 0x4c(fp) | a0 = *(arg_4ch);
0x00401374 lw t8, -0x7f84(gp) | t8 = sym.imp.fclose;
0x00401378 move t9, t8 | t9 = t8;
0x0040137c jalr t9 | t9 ();
0x00401380 nop |
0x00401384 lw gp, 0x28(fp) | gp = *(arg_28h);
| }
0x00401388 addiu t8, fp, 0x9c | t8 = fp + 0x9c;
0x0040138c move a0, t8 | a0 = t8;
0x00401390 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* str.TimeZone */
0x00401394 addiu a1, t8, 0x57f4 | a1 = t8 + 0x57f4;
0x00401398 move a2, zero | a2 = 0;
0x0040139c lw t8, -0x7fa8(gp) | t8 = *(gp);
0x004013a0 move t9, t8 | t9 = t8;
0x004013a4 jalr t9 | t9 ();
0x004013a8 nop |
0x004013ac lw gp, 0x28(fp) | gp = *(arg_28h);
0x004013b0 addiu t8, fp, 0x9c | t8 = fp + 0x9c;
0x004013b4 move a0, t8 | a0 = t8;
0x004013b8 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* str.POSIXTZ */
0x004013bc addiu a1, t8, 0x5800 | a1 = t8 + 0x5800;
0x004013c0 lw a2, 0x30(fp) | a2 = *(arg_30h);
0x004013c4 lw t8, -0x7f58(gp) | t8 = *(gp);
0x004013c8 move t9, t8 | t9 = t8;
0x004013cc jalr t9 | t9 ();
0x004013d0 nop |
0x004013d4 lw gp, 0x28(fp) | gp = *(arg_28h);
0x004013d8 addiu t8, fp, 0x9c | t8 = fp + 0x9c;
0x004013dc move a0, t8 | a0 = t8;
0x004013e0 lw t8, -0x7f40(gp) | t8 = *(gp);
0x004013e4 move t9, t8 | t9 = t8;
0x004013e8 jalr t9 | t9 ();
0x004013ec nop |
0x004013f0 lw gp, 0x28(fp) | gp = *(arg_28h);
0x004013f4 addiu t8, zero, 1 | t8 = 1;
0x004013f8 sw t8, 0x44(fp) | *(arg_44h) = t8;
0x004013fc addiu t8, fp, 0x3c | t8 = fp + 0x3c;
0x00401400 move a0, t8 | a0 = t8;
0x00401404 lw t8, -0x7f54(gp) | t8 = *(gp);
0x00401408 move t9, t8 | t9 = t8;
0x0040140c jalr t9 | t9 ();
0x00401410 nop |
0x00401414 lw gp, 0x28(fp) | gp = *(arg_28h);
| }
0x00401418 lw v0, 0x44(fp) | v0 = *(arg_44h);
0x0040141c addiu t8, zero, 1 | t8 = 1;
| if (v0 == t8) {
0x00401420 bne v0, t8, 0x401444 |
0x00401424 nop |
0x00401428 lw t8, -0x7fd8(gp) | t8 = *(gp);
| /* str._etc_rc.d_init.d_trservices.sh_restart_ */
0x0040142c addiu a0, t8, 0x5808 | a0 = t8 + 0x5808;
0x00401430 lw t8, -0x7f50(gp) | t8 = sym.imp.system
0x00401434 move t9, t8 | t9 = t8;
0x00401438 jalr t9 | t9 ();
0x0040143c nop |
0x00401440 lw gp, 0x28(fp) | gp = *(arg_28h);
| }
0x00401444 move s0, zero | s0 = 0;
| label_2:
0x00401448 addiu t8, fp, 0x9c | t8 = fp + 0x9c;
0x0040144c move a0, t8 | a0 = t8;
0x00401450 lw t8, -0x7fa0(gp) | t8 = sym.imp.TinyDB::TinyDB__;
0x00401454 move t9, t8 | t9 = t8;
0x00401458 jalr t9 | t9 ();
0x0040145c nop |
0x00401460 lw gp, 0x28(fp) | gp = *(arg_28h);
0x00401464 move t8, s0 | t8 = s0;
0x00401468 move v0, t8 | v0 = t8;
0x0040146c lw t8, -0x7f48(gp) | t8 = *((gp - 8146));
0x00401470 lw v1, 0x12cc(fp) | v1 = *(arg_12cch);
0x00401474 lw t8, (t8) | t8 = *(t8);
| if (v1 != t8) {
0x00401478 beq v1, t8, 0x401500 |
0x0040147c nop |
0x00401480 b 0x4014f0 | goto label_3;
0x00401484 nop |
| label_3:
0x004014f0 lw t8, -0x7f88(gp) | t8 = sym.imp.__stack_chk_fail;
0x004014f4 move t9, t8 | t9 = t8;
0x004014f8 jalr t9 | t9 ();
0x004014fc nop |
| }
0x00401500 move sp, fp |
0x00401504 lw ra, 0x12dc(sp) | ra = *(var_12dch);
0x00401508 lw fp, 0x12d8(sp) | fp = *(var_12d8h);
0x0040150c lw s0, 0x12d4(sp) | s0 = *(var_12d4h);
0x00401510 addiu sp, sp, 0x12e0 |
0x00401514 jr ra | return v1;
0x00401518 nop |
| }
[*] Function system used 3 times ble_time_util