[*] Binary protection state of vision-devices
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function printf tear down of vision-devices
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/vision-devices @ 0x1fe4 */
| #include <stdint.h>
|
; (fcn) sym.get_fd () | void get_fd () {
0x00001fe4 lui gp, 2 |
0x00001fe8 addiu gp, gp, -0x6fd4 |
0x00001fec addu gp, gp, t9 | gp += t9;
0x00001ff0 addiu sp, sp, -0x58 |
0x00001ff4 sw s2, 0x3c(sp) | *(var_3ch) = s2;
0x00001ff8 lw s2, -0x7f68(gp) | s2 = *((gp - 8154));
0x00001ffc sw s0, 0x34(sp) | *(var_34h) = s0;
0x00002000 lw s0, -0x7fdc(gp) | s0 = *((gp - 8183));
0x00002004 lw v0, (s2) | v0 = *(s2);
0x00002008 sw s1, 0x38(sp) | *(var_38h) = s1;
| /* section..data.rel.ro */
0x0000200c addiu s1, s0, 0x2c40 | s1 = s0 + 0x2c40;
0x00002010 sw s7, 0x50(sp) | *(var_50h) = s7;
0x00002014 sw s6, 0x4c(sp) | *(var_4ch) = s6;
0x00002018 sw s5, 0x48(sp) | *(var_48h) = s5;
0x0000201c sw s4, 0x44(sp) | *(var_44h) = s4;
0x00002020 sw s3, 0x40(sp) | *(var_40h) = s3;
0x00002024 sw gp, 0x20(sp) | *(var_20h) = gp;
0x00002028 sw ra, 0x54(sp) | *(var_54h) = ra;
0x0000202c move s5, a0 | s5 = a0;
0x00002030 move s7, a1 | s7 = a1;
0x00002034 move s3, a3 | s3 = a3;
0x00002038 sw v0, 0x2c(sp) | *(var_2ch) = v0;
0x0000203c sb zero, 0x2b(sp) | *(var_2bh) = 0;
0x00002040 move s4, s1 | s4 = s1;
0x00002044 move s0, zero | s0 = 0;
0x00002048 addiu s6, zero, 0xd | s6 = 0xd;
| do {
0x0000204c lw t9, -0x7f9c(gp) | t9 = sym.imp.strcmp;
0x00002050 move a1, s5 | a1 = s5;
0x00002054 move a0, s4 | a0 = s4;
0x00002058 jalr t9 | t9 ();
0x0000205c lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 == 0) {
0x00002060 beqz v0, 0x216c | goto label_5;
| }
0x00002064 addiu s0, s0, 1 | s0++;
0x00002068 addiu s4, s4, 0x2c | s4 += 0x2c;
0x0000206c bne s0, s6, 0x204c |
| } while (s0 != s6);
0x00002070 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00002074 lw t9, -0x7f9c(gp) | t9 = sym.imp.strcmp;
0x00002078 move a1, s5 | a1 = s5;
0x0000207c addiu a0, a0, 0x27d8 | a0 += str.CAM_IOC_ACE_API_VERSION;
0x00002080 jalr t9 | t9 ();
0x00002084 lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 == 0) {
0x00002088 beqz v0, 0x2260 | goto label_6;
| }
| do {
0x0000208c lw s1, -0x7fd8(gp) | s1 = *((gp - 8182));
| label_3:
0x00002090 lw s0, -0x7fd8(gp) | s0 = *((gp - 8182));
0x00002094 lw t9, -0x7f88(gp) | t9 = sym.imp.__snprintf_chk
0x00002098 addiu s0, s0, 0x2bb4 | s0 += str._s_d;
0x0000209c addiu s1, s1, 0x2ba8 | s1 += str._dev_camov;
0x000020a0 addiu a3, zero, -1 | a3 = -1;
0x000020a4 addiu a2, zero, 1 | a2 = 1;
0x000020a8 move a1, zero | a1 = 0;
0x000020ac move a0, zero | a0 = 0;
0x000020b0 sw s0, 0x10(sp) | *(var_10h) = s0;
0x000020b4 sw s3, 0x18(sp) | *(var_18h) = s3;
0x000020b8 sw s1, 0x14(sp) | *(var_14h) = s1;
0x000020bc jalr t9 | t9 ();
0x000020c0 lw gp, 0x20(sp) | gp = *(var_20h);
0x000020c4 addiu s5, v0, 1 | s5 = v0 + 1;
0x000020c8 lw t9, -0x7f7c(gp) | t9 = sym.imp.malloc;
0x000020cc move a0, s5 | a0 = s5;
0x000020d0 jalr t9 | t9 ();
0x000020d4 lw gp, 0x20(sp) | gp = *(var_20h);
0x000020d8 addiu a3, zero, -1 | a3 = -1;
0x000020dc addiu a2, zero, 1 | a2 = 1;
0x000020e0 lw t9, -0x7f88(gp) | t9 = sym.imp.__snprintf_chk
0x000020e4 move a1, s5 | a1 = s5;
0x000020e8 move a0, v0 | a0 = v0;
0x000020ec sw s0, 0x10(sp) | *(var_10h) = s0;
0x000020f0 sw s3, 0x18(sp) | *(var_18h) = s3;
0x000020f4 sw s1, 0x14(sp) | *(var_14h) = s1;
0x000020f8 move s4, v0 | s4 = v0;
0x000020fc jalr t9 | t9 ();
0x00002100 lw gp, 0x20(sp) | gp = *(var_20h);
0x00002104 addiu a1, zero, 2 | a1 = 2;
0x00002108 lw t9, -0x7f18(gp) | t9 = sym.imp.open;
0x0000210c move a0, s4 | a0 = s4;
0x00002110 jalr t9 | t9 ();
0x00002114 move s0, v0 | s0 = v0;
0x00002118 lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 < 0) {
0x0000211c bltz v0, 0x2208 | goto label_7;
| }
| label_1:
0x00002120 lw t9, -0x7f40(gp) | t9 = sym.imp.free;
0x00002124 move a0, s4 | a0 = s4;
0x00002128 jalr t9 | t9 ();
0x0000212c lw gp, 0x20(sp) | gp = *(var_20h);
| label_0:
0x00002130 lw a0, 0x2c(sp) | a0 = *(var_2ch);
0x00002134 lw v1, (s2) | v1 = *(s2);
0x00002138 move v0, s0 | v0 = s0;
| if (a0 != v1) {
0x0000213c bne a0, v1, 0x2268 | goto label_8;
| }
0x00002140 lw ra, 0x54(sp) | ra = *(var_54h);
0x00002144 lw s7, 0x50(sp) | s7 = *(var_50h);
0x00002148 lw s6, 0x4c(sp) | s6 = *(var_4ch);
0x0000214c lw s5, 0x48(sp) | s5 = *(var_48h);
0x00002150 lw s4, 0x44(sp) | s4 = *(var_44h);
0x00002154 lw s3, 0x40(sp) | s3 = *(var_40h);
0x00002158 lw s2, 0x3c(sp) | s2 = *(var_3ch);
0x0000215c lw s1, 0x38(sp) | s1 = *(var_38h);
0x00002160 lw s0, 0x34(sp) | s0 = *(var_34h);
0x00002164 addiu sp, sp, 0x58 |
0x00002168 jr ra | return v1;
| label_5:
0x0000216c addiu v0, zero, 0x2c | v0 = 0x2c;
0x00002170 mul v1, s0, v0 | __asm ("mul v1, s0, v0");
0x00002174 addiu a1, sp, 0x2b | a1 = sp + 0x2b;
0x00002178 addu s0, v1, s1 | s0 = v1 + s1;
0x0000217c lw s1, -0x7fdc(gp) | s1 = *((gp - 8183));
0x00002180 lw t9, 0x28(s0) | t9 = *((s0 + 10));
0x00002184 addiu a0, s1, 0x3140 | a0 = s1 + 0x3140;
0x00002188 jalr t9 | t9 ();
0x0000218c lw gp, 0x20(sp) | gp = *(var_20h);
| if (v0 < 0) {
0x00002190 bltz v0, 0x2258 | goto label_9;
| }
0x00002194 addiu s1, s1, 0x3140 | s1 += 0x3140;
| label_2:
0x00002198 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x0000219c lw t9, -0x7f9c(gp) | t9 = sym.imp.strcmp;
0x000021a0 move a1, s5 | a1 = s5;
0x000021a4 addiu a0, a0, 0x27d8 | a0 += str.CAM_IOC_ACE_API_VERSION;
0x000021a8 jalr t9 | t9 ();
0x000021ac lw gp, 0x20(sp) | gp = *(var_20h);
0x000021b0 lbu v1, 0x2b(sp) | v1 = *(var_2bh);
| if (v0 != 0) {
0x000021b4 bnez v0, 0x2274 | goto label_10;
| }
0x000021b8 lw t9, -0x7fc8(gp) | t9 = sym.version_compare;
| if (v1 == 0) {
0x000021bc beqz v1, 0x2260 | goto label_6;
| }
| label_4:
0x000021c0 move a1, s7 | a1 = s7;
0x000021c4 move a0, s1 | a0 = s1;
0x000021c8 bal 0x1db0 | sym_version_compare ();
0x000021cc lw gp, 0x20(sp) | gp = *(var_20h);
0x000021d0 bnez v0, 0x208c |
| } while (v0 != 0);
0x000021d4 lw a3, -0x7fd8(gp) | a3 = *((gp - 8182));
0x000021d8 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x000021dc lw t9, -0x7fa8(gp) | t9 = sym.imp.g_log;
0x000021e0 sw s7, 0x14(sp) | *(var_14h) = s7;
0x000021e4 sw s1, 0x10(sp) | *(var_10h) = s1;
0x000021e8 addiu a3, a3, 0x26ac | a3 += 0x26ac;
0x000021ec addiu a2, a2, 0x2b88 | a2 += str._sNon_matching_versions___s__s;
0x000021f0 addiu a1, zero, 0x10 | a1 = 0x10;
0x000021f4 move a0, zero | a0 = 0;
0x000021f8 jalr t9 | t9 ();
0x000021fc addiu s0, zero, -1 | s0 = -1;
0x00002200 lw gp, 0x20(sp) | gp = *(var_20h);
0x00002204 b 0x2130 | goto label_0;
| label_7:
0x00002208 lw t9, -0x7f08(gp) | t9 = sym.imp.__errno_location;
0x0000220c jalr t9 | t9 ();
0x00002210 nop |
0x00002214 lw gp, 0x20(sp) | gp = *(var_20h);
0x00002218 lw t9, -0x7f1c(gp) | t9 = sym.imp.strerror;
0x0000221c lw a0, (v0) | a0 = *(v0);
0x00002220 jalr t9 | t9 ();
0x00002224 lw gp, 0x20(sp) | gp = *(var_20h);
0x00002228 sw v0, 0x14(sp) | *(var_14h) = v0;
0x0000222c sw s4, 0x10(sp) | *(var_10h) = s4;
0x00002230 lw a3, -0x7fd8(gp) | a3 = *((gp - 8182));
0x00002234 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00002238 lw t9, -0x7fa8(gp) | t9 = sym.imp.g_log;
0x0000223c addiu a3, a3, 0x26ac | a3 += 0x26ac;
0x00002240 addiu a2, a2, 0x2bbc | a2 += str._sFailed_to_open_device__s:__s;
0x00002244 addiu a1, zero, 0x100 | a1 = 0x100;
0x00002248 move a0, zero | a0 = 0;
0x0000224c jalr t9 | t9 ();
0x00002250 lw gp, 0x20(sp) | gp = *(var_20h);
0x00002254 b 0x2120 | goto label_1;
| label_9:
0x00002258 move s1, zero | s1 = 0;
0x0000225c b 0x2198 | goto label_2;
| label_6:
0x00002260 addiu s0, zero, -1 | s0 = -1;
0x00002264 b 0x2130 | goto label_0;
| label_8:
0x00002268 lw t9, -0x7f80(gp) | t9 = sym.imp.__stack_chk_fail;
0x0000226c jalr t9 | t9 ();
0x00002270 nop |
| if (v1 == 0) {
| label_10:
0x00002274 beql v1, zero, 0x2090 | goto label_3;
| }
0x00002278 lw s1, -0x7fd8(gp) | s1 = *((gp - 8182));
0x0000227c lw t9, -0x7fc8(gp) | t9 = sym.version_compare;
0x00002280 b 0x21c0 | goto label_4;
| }
[*] Function printf used 3 times vision-devices