[*] Binary protection state of libwebsockets.so.12
Partial RELRO No Canary found NX disabled DSO No RPATH No RUNPATH Symbols
[*] Function strcpy tear down of libwebsockets.so.12
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libwebsockets.so.12 @ 0x113dc */
| #include <stdint.h>
|
; (fcn) sym.ERR_error_string_n () | void ERR_error_string_n (int32_t arg2) {
| r1 = arg2;
0x000113dc mov r0, r1 | r0 = r1;
0x000113e0 ldr r1, [pc, 4] | r1 = *(0x000113ec);
0x000113e4 add r1, pc, r1 | r1 = pc + r1;
0x000113e8 b 0x4a38 | return void (*0x4a38)() ();
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libwebsockets.so.12 @ 0x113f4 */
| #include <stdint.h>
|
; (fcn) sym.ERR_error_string () | void ERR_error_string (int32_t arg2) {
| r1 = arg2;
0x000113f4 subs r0, r1, 0 | r0 = r1 - 0;
0x000113f8 push {r4, lr} |
| if (r0 != r1) {
0x000113fc beq 0x1140c |
0x00011400 ldr r1, [pc, 0x10] | r1 = *(0x11414);
0x00011404 add r1, pc, r1 | r1 = pc + r1;
0x00011408 bl 0x4570 | strcpy (r0, r1)
| }
0x0001140c ldr r0, [pc, 8] | r0 = *(0x0001141c);
0x00011410 add r0, pc, r0 | r0 = pc + r0;
0x00011414 pop {r4, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libwebsockets.so.12 @ 0xeaf8 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) sym.lws_client_connect_2 () | void lws_client_connect_2 (int32_t arg1) {
| int32_t var_bp_0h;
| int32_t var_0h;
| int32_t var_ch;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_1ch;
| void * addr;
| int32_t var_22h;
| void * s;
| int32_t var_28h;
| int32_t var_2ch;
| int32_t var_44h;
| r0 = arg1;
0x0000eaf8 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0000eafc ldrb r3, [r0, 0x1cf] | r3 = *(var_bp_0hx1cf);
0x0000eb00 sub sp, sp, 0x44 |
0x0000eb04 str r3, [sp, 0xc] | var_ch = r3;
0x0000eb08 ldr r3, [r0] | r3 = *(r0);
0x0000eb0c mov r4, r0 | r4 = r0;
0x0000eb10 cmp r3, 0 |
0x0000eb14 ldr r6, [r0, 0x154] | r6 = *(var_bp_0hx154);
| if (r3 != 0) {
0x0000eb18 bne 0xebc4 | goto label_7;
| }
0x0000eb1c ldr r5, [pc, 0x56c] | r5 = *(0xf08c);
0x0000eb20 ldr r1, [pc, 0x56c] | r1 = $d;
0x0000eb24 add r5, pc, r5 | r5 = pc + r5;
0x0000eb28 mov r2, r5 | r2 = r5;
0x0000eb2c add r1, pc, r1 | r1 = pc + r1;
0x0000eb30 mov r0, 1 | r0 = 1;
0x0000eb34 bl 0x4c24 | fcn_00004c24 ();
| do {
| label_1:
0x0000eb38 mov r0, r4 | r0 = r4;
0x0000eb3c bl 0xa328 | lws_header_table_force_to_detachable_state ();
0x0000eb40 ldrb r3, [r4, 0x1c9] | r3 = *((r4 + 0x1c9));
0x0000eb44 sub r3, r3, 0x20 | r3 -= 0x20;
0x0000eb48 cmp r3, 2 |
| if (r3 <= 2) {
0x0000eb4c bhi 0xeb88 |
0x0000eb50 mov r0, r5 | r0 = r5;
0x0000eb54 bl 0x4d74 | strlen (r0);
0x0000eb58 ldr r3, [r4, 0x158] | r3 = *((r4 + 0x158));
0x0000eb5c mov r1, 1 | r1 = 1;
0x0000eb60 ldr r3, [r3, 0x14c] | r3 = *((r3 + 0x14c));
0x0000eb64 str r0, [sp] | *(sp) = r0;
0x0000eb68 mov r0, r4 | r0 = r4;
0x0000eb6c ldr r6, [r3, 4] | r6 = *((r3 + 4));
0x0000eb70 ldr r2, [r4, 0x17c] | r2 = *((r4 + 0x17c));
0x0000eb74 mov r3, r5 | r3 = r5;
0x0000eb78 blx r6 | uint32_t (*r6)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x0000eb7c ldrb r3, [r4, 0x1c2] | r3 = *((r4 + 0x1c2));
0x0000eb80 orr r3, r3, 1 | r3 |= 1;
0x0000eb84 strb r3, [r4, 0x1c2] | *((r4 + 0x1c2)) = r3;
| }
0x0000eb88 ldr r3, [r4, 0x1a0] | r3 = *((r4 + 0x1a0));
0x0000eb8c cmn r3, 1 |
| if (r3 != 1) {
0x0000eb90 bne 0xf00c | goto label_8;
| }
0x0000eb94 mov r0, r4 | r0 = r4;
0x0000eb98 bl 0x54f4 | lws_remove_from_timeout_list ();
0x0000eb9c mov r1, 0 | r1 = 0;
0x0000eba0 mov r0, r4 | r0 = r4;
0x0000eba4 bl 0xa37c | lws_header_table_detach ();
0x0000eba8 ldr r2, [pc, 0x4e8] | r2 = *(0xf094);
0x0000ebac mov r1, 0 | r1 = 0;
0x0000ebb0 add r2, pc, r2 | r2 = pc + r2;
0x0000ebb4 mov r0, r4 | r0 = r4;
0x0000ebb8 bl 0xcc3c | lws_realloc ();
| label_4:
0x0000ebbc mov r4, 0 | r4 = 0;
0x0000ebc0 b 0xefa8 | goto label_5;
| label_7:
0x0000ebc4 ldrb r3, [r0, 0x1c2] | r3 = *(var_bp_0hx1c2);
0x0000ebc8 add r8, r0, 0x1c4 | r8 += var_bp_0hx1c4;
0x0000ebcc bic r3, r3, 8 | r3 = BIT_MASK (r3, 8);
0x0000ebd0 strb r3, [r0, 0x1c2] | *(var_bp_0hx1c2) = r3;
0x0000ebd4 ldr r3, [r0, 0x158] | r3 = *(var_bp_0hx158);
0x0000ebd8 ldr r5, [r3, 0x174] | r5 = *((r3 + 0x174));
0x0000ebdc cmp r5, 0 |
| if (r5 == 0) {
0x0000ebe0 beq 0xecf0 | goto label_9;
| }
0x0000ebe4 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0000ebe8 mov r1, 0x55 | r1 = 0x55;
0x0000ebec lsl r7, r3, 6 | r7 = r3 << 6;
0x0000ebf0 add sb, r6, r7 | sb = r6 + r7;
0x0000ebf4 ldr r5, [sb, 0x68] | r5 = *((sb + 0x68));
0x0000ebf8 bl 0xa708 | lws_hdr_simple_ptr ();
0x0000ebfc ldr r1, [pc, 0x498] | r1 = *(0xf098);
0x0000ec00 ldrh r3, [r8, 2] | r3 = *((r8 + 2));
0x0000ec04 add r1, pc, r1 | r1 = pc + r1;
0x0000ec08 mov r2, r0 | r2 = r0;
0x0000ec0c mov r0, r5 | r0 = r5;
0x0000ec10 bl 0x4c18 | sprintf (r0, r1, r2);
0x0000ec14 ldr r2, [r4, 0x158] | r2 = *((r4 + 0x158));
0x0000ec18 ldrb r3, [r2, 0x80] | r3 = *((r2 + 0x80));
0x0000ec1c cmp r3, 0 |
0x0000ec20 mov r5, r0 | r5 = r0;
| if (r3 != 0) {
0x0000ec24 beq 0xec44 |
0x0000ec28 ldr r0, [sb, 0x68] | r0 = *((sb + 0x68));
0x0000ec2c ldr r1, [pc, 0x46c] | r1 = *(0xf09c);
0x0000ec30 add r0, r0, r5 | r0 += r5;
0x0000ec34 add r2, r2, 0x80 | r2 += 0x80;
0x0000ec38 add r1, pc, r1 | r1 = pc + r1;
0x0000ec3c bl 0x4c18 | r0 = sprintf (r0, r1, r2);
0x0000ec40 add r5, r5, r0 | r5 += r0;
| }
0x0000ec44 add r7, r6, r7 | r7 = r6 + r7;
0x0000ec48 ldr r0, [r7, 0x68] | r0 = *((r7 + 0x68));
0x0000ec4c ldr r1, [pc, 0x450] | r1 = *(0xf0a0);
0x0000ec50 add r0, r0, r5 | r0 += r5;
0x0000ec54 add r1, pc, r1 | r1 = pc + r1;
0x0000ec58 bl 0x4570 | strcpy (r0, r1)
0x0000ec5c ldr r7, [r4, 0x158] | r7 = *((r4 + 0x158));
0x0000ec60 add r5, r5, 2 | r5 += 2;
0x0000ec64 ldr sb, [r7, 0x174] | sb = *((r7 + 0x174));
| label_0:
0x0000ec68 ldr r2, [pc, 0x438] | r2 = *(0xf0a4);
0x0000ec6c ldr r1, [pc, 0x438] | r1 = *(0xf0a8);
0x0000ec70 mov r3, r4 | r3 = r4;
0x0000ec74 add r2, pc, r2 | r2 = pc + r2;
0x0000ec78 add r1, pc, r1 | r1 = pc + r1;
0x0000ec7c mov r0, 4 | r0 = 4;
0x0000ec80 str r7, [sp] | *(sp) = r7;
0x0000ec84 bl 0x4c24 | fcn_00004c24 ();
0x0000ec88 mov r2, 0x1c | r2 = 0x1c;
0x0000ec8c mov r1, 0 | r1 = 0;
0x0000ec90 add r0, sp, 0x24 | r0 += s;
0x0000ec94 bl 0x4b04 | memset (r0, r1, r2);
0x0000ec98 add sl, sp, 0x20 | sl += addr;
0x0000ec9c mov r3, 2 | r3 = 2;
0x0000eca0 mov r1, 0 | r1 = 0;
0x0000eca4 str r3, [sp, 0x20] | addr = r3;
0x0000eca8 mov fp, 1 |
0x0000ecac add r3, sp, 0x14 | r3 += var_14h;
0x0000ecb0 mov r2, sl | r2 = sl;
0x0000ecb4 mov r0, r7 | r0 = r7;
0x0000ecb8 str r1, [sp, 0x14] | var_14h = r1;
0x0000ecbc str fp, [sp, 0x28] | var_28h = fp;
0x0000ecc0 bl 0x4c9c | r0 = getaddrinfo ();
0x0000ecc4 subs r3, r0, 0 | r3 = r0 - 0;
| if (r3 != r0) {
0x0000ecc8 ldreq r0, [sp, 0x14] | r0 = var_14h;
| }
| if (r3 != r0) {
0x0000eccc moveq r1, r0 | r1 = r0;
| }
| if (r3 == r0) {
0x0000ecd0 beq 0xed1c | goto label_10;
| }
0x0000ecd4 ldr r1, [pc, 0x3d4] | r1 = *(0xf0ac);
0x0000ecd8 ldr r5, [pc, 0x3d4] | r5 = *(0xf0b0);
0x0000ecdc add r1, pc, r1 | r1 = pc + r1;
0x0000ece0 mov r0, fp | r0 = fp;
0x0000ece4 bl 0x4c24 | fcn_00004c24 ();
0x0000ece8 add r5, pc, r5 | r5 = pc + r5;
0x0000ecec b 0xeb38 |
| } while (1);
| label_9:
0x0000ecf0 mov r1, 0x55 | r1 = 0x55;
0x0000ecf4 bl 0xa708 | lws_hdr_simple_ptr ();
0x0000ecf8 ldrh sb, [r8, 2] | sb = *((r8 + 2));
0x0000ecfc mov r7, r0 | r7 = r0;
0x0000ed00 b 0xec68 | goto label_0;
| do {
0x0000ed04 ldr r3, [r1, 4] | r3 = *((r1 + 4));
0x0000ed08 cmp r3, 2 |
| if (r3 != 2) {
0x0000ed0c ldreq r3, [r1, 0x14] | r3 = *((r1 + 0x14));
| }
0x0000ed10 ldr r1, [r1, 0x1c] | r1 = *((r1 + 0x1c));
| if (r3 != 2) {
0x0000ed14 addeq r3, r3, 4 | r3 += 4;
| }
| if (r3 == 2) {
0x0000ed18 movne r3, 0 | r3 = 0;
| }
| label_10:
0x0000ed1c adds r2, r1, 0 | r2 = r1 + 0;
| if (r2 == r1) {
0x0000ed20 movne r2, 1 | r2 = 1;
| }
0x0000ed24 cmp r3, 0 |
| if (r3 == 0) {
0x0000ed28 movne r2, 0 | r2 = 0;
| }
0x0000ed2c cmp r2, 0 |
0x0000ed30 bne 0xed04 |
| } while (r2 != 0);
0x0000ed34 cmp r3, 0 |
| if (r3 == 0) {
0x0000ed38 bne 0xed64 |
0x0000ed3c cmp r0, 0 |
| if (r0 != 0) {
0x0000ed40 beq 0xed48 |
0x0000ed44 bl 0x4810 | freeaddrinfo ();
| }
0x0000ed48 ldr r1, [pc, 0x368] | r1 = *(0xf0b4);
0x0000ed4c ldr r5, [pc, 0x368] | r5 = "d";
0x0000ed50 add r1, pc, r1 | r1 = pc + r1;
0x0000ed54 mov r0, 1 | r0 = 1;
0x0000ed58 bl 0x4c24 | fcn_00004c24 ();
0x0000ed5c add r5, pc, r5 | r5 = pc + r5;
0x0000ed60 b 0xeb38 | goto label_1;
| }
0x0000ed64 mov r1, 2 | r1 = 2;
0x0000ed68 strh r1, [sp, 0x20] | addr = r1;
0x0000ed6c ldr r3, [r3] | r3 = *(r3);
0x0000ed70 cmp r0, 0 |
0x0000ed74 str r3, [sp, 0x24] | s = r3;
0x0000ed78 str r2, [sp, 0x28] | var_28h = r2;
0x0000ed7c str r2, [sp, 0x2c] | var_2ch = r2;
| if (r0 != 0) {
0x0000ed80 beq 0xed88 |
0x0000ed84 bl 0x4810 | freeaddrinfo ();
| }
0x0000ed88 ldr r3, [r4, 0x19c] | r3 = *((r4 + 0x19c));
0x0000ed8c cmp r3, 0 |
0x0000ed90 blt 0xee08 |
| while (r3 == r0) {
| label_2:
0x0000ed94 lsl r3, sb, 0x10 | r3 = sb << 0x10;
0x0000ed98 lsr r3, r3, 0x18 | r3 >>= 0x18;
0x0000ed9c orr sb, r3, sb, lsl 8 | sb = r3 | (sb << 8);
0x0000eda0 mov r2, 0x10 | r2 = 0x10;
0x0000eda4 mov r1, sl | r1 = sl;
0x0000eda8 ldr r0, [r4, 0x19c] | r0 = *((r4 + 0x19c));
0x0000edac strh sb, [sp, 0x22] | var_22h = sb;
0x0000edb0 bl 0x45d0 | r0 = connect (r0, r1, r2);
0x0000edb4 mov r7, r0 | r7 = r0;
0x0000edb8 bl 0x4cfc | errno_location ();
0x0000edbc cmn r7, 1 |
0x0000edc0 ldr r2, [r0] | r2 = *(r0);
| if (r7 != 1) {
0x0000edc4 bne 0xef34 | goto label_11;
| }
| label_3:
0x0000edc8 sub r3, r2, 0x72 | r3 = r2 - 0x72;
0x0000edcc cmp r2, 0xb |
0x0000edd0 cmpne r3, 1 | __asm ("cmpne r3, 1");
| if (r2 > 0xb) {
0x0000edd4 bhi 0xefb4 | goto label_12;
| }
0x0000edd8 mov r0, r4 | r0 = r4;
0x0000eddc bl 0x4870 | r0 = fcn_00004870 ();
0x0000ede0 subs r1, r0, 0 | r1 = r0 - 0;
| if (r1 != r0) {
0x0000ede4 bne 0xf060 | goto label_13;
| }
0x0000ede8 mov r2, 4 | r2 = 4;
0x0000edec mov r0, r4 | r0 = r4;
0x0000edf0 bl 0x8dfc | r0 = lws_change_pollfd ();
0x0000edf4 cmp r0, 0 |
| if (r0 == 0) {
0x0000edf8 beq 0xefa8 | goto label_5;
| }
0x0000edfc ldr r5, [pc, 0x2bc] | r5 = *(0xf0bc);
0x0000ee00 add r5, pc, r5 | r5 = pc + r5;
0x0000ee04 b 0xefd4 | goto label_6;
0x0000ee08 mov r1, 1 | r1 = 1;
0x0000ee0c mov r2, 0 | r2 = 0;
0x0000ee10 mov r0, 2 | r0 = 2;
0x0000ee14 bl 0x47c8 | r0 = socket (r0, r1, r2);
0x0000ee18 cmp r0, 0 |
0x0000ee1c mov r1, r0 | r1 = r0;
0x0000ee20 str r0, [r4, 0x19c] | *((r4 + 0x19c)) = r0;
| if (r0 < 0) {
0x0000ee24 bge 0xee44 |
0x0000ee28 ldr r1, [pc, 0x294] | r1 = *(0xf0c0);
0x0000ee2c ldr r5, [pc, 0x294] | r5 = *(0xf0c4);
0x0000ee30 add r1, pc, r1 | r1 = pc + r1;
0x0000ee34 mov r0, 2 | r0 = 2;
0x0000ee38 bl 0x4c24 | fcn_00004c24 ();
0x0000ee3c add r5, pc, r5 | r5 = pc + r5;
0x0000ee40 b 0xeb38 | goto label_1;
| }
0x0000ee44 ldr r0, [r4, 0x158] | r0 = *((r4 + 0x158));
0x0000ee48 bl 0x4ba0 | r0 = fcn_00004ba0 ();
0x0000ee4c cmp r0, 0 |
| if (r0 != 0) {
0x0000ee50 beq 0xee78 |
0x0000ee54 ldr r1, [pc, 0x270] | r1 = *(0xf0c8);
0x0000ee58 ldr r5, [pc, 0x270] | r5 = *(0xf0cc);
0x0000ee5c add r1, pc, r1 | r1 = pc + r1;
0x0000ee60 mov r0, 1 | r0 = 1;
0x0000ee64 bl 0x4c24 | fcn_00004c24 ();
0x0000ee68 ldr r0, [r4, 0x19c] | r0 = *((r4 + 0x19c));
0x0000ee6c bl 0x4e34 | close (r0);
0x0000ee70 add r5, pc, r5 | r5 = pc + r5;
0x0000ee74 b 0xeb38 | goto label_1;
| }
0x0000ee78 mov r3, 0x22 | r3 = 0x22;
0x0000ee7c mov r1, r4 | r1 = r4;
0x0000ee80 strb r3, [r4, 0x1c9] | *((r4 + 0x1c9)) = r3;
0x0000ee84 mov r0, r6 | r0 = r6;
0x0000ee88 bl 0x8ca0 | r0 = insert_wsi_socket_into_fds ();
0x0000ee8c subs r1, r0, 0 | r1 = r0 - 0;
| if (r1 != r0) {
0x0000ee90 beq 0xeea8 |
0x0000ee94 ldr r5, [pc, 0x238] | r5 = *(0xf0d0);
0x0000ee98 ldr r0, [r4, 0x19c] | r0 = *((r4 + 0x19c));
0x0000ee9c bl 0x4e34 | close (r0);
0x0000eea0 add r5, pc, r5 | r5 = pc + r5;
0x0000eea4 b 0xeb38 | goto label_1;
| }
0x0000eea8 mov r2, 1 | r2 = 1;
0x0000eeac mov r0, r4 | r0 = r4;
0x0000eeb0 bl 0x8dfc | lws_change_pollfd ();
0x0000eeb4 ldr r3, [r4, 0x168] | r3 = *((r4 + 0x168));
0x0000eeb8 mov r7, 0 | r7 = 0;
0x0000eebc cmp r3, 0 |
| if (r3 != 0) {
0x0000eec0 ldreq r3, [r4, 0x158] | r3 = *((r4 + 0x158));
| }
0x0000eec4 mov r1, 0x1d | r1 = 0x1d;
| if (r3 != 0) {
0x0000eec8 ldreq r3, [r3, 0x14c] | r3 = *((r3 + 0x14c));
| }
0x0000eecc mov r0, r4 | r0 = r4;
| if (r3 != 0) {
0x0000eed0 streq r3, [r4, 0x168] | *((r4 + 0x168)) = r3;
| }
0x0000eed4 ldr r3, [r4, 0x168] | r3 = *((r4 + 0x168));
0x0000eed8 str r7, [sp] | *(sp) = r7;
0x0000eedc ldr fp, [r3, 4] | fp = *((r3 + 4));
0x0000eee0 ldr r2, [r4, 0x17c] | r2 = *((r4 + 0x17c));
0x0000eee4 mov r3, r7 | r3 = r7;
0x0000eee8 blx fp | fp (r0, r1, r2, r3);
0x0000eeec mov r2, 0x14 | r2 = 0x14;
0x0000eef0 mov r1, 2 | r1 = 2;
0x0000eef4 mov r0, r4 | r0 = r4;
0x0000eef8 bl 0x45a0 | fcn_000045a0 ();
0x0000eefc mov r1, 0x5a | r1 = 0x5a;
0x0000ef00 mov r0, r4 | r0 = r4;
0x0000ef04 bl 0xa708 | r0 = lws_hdr_simple_ptr ();
0x0000ef08 subs r3, r0, 0 | r3 = r0 - 0;
0x0000ef0c beq 0xed94 |
| }
0x0000ef10 mov r2, r7 | r2 = r7;
0x0000ef14 ldr r1, [r4, 0x19c] | r1 = *((r4 + 0x19c));
0x0000ef18 ldr r0, [r4, 0x158] | r0 = *((r4 + 0x158));
0x0000ef1c bl 0x71c0 | r0 = lws_socket_bind ();
0x0000ef20 cmp r0, r7 |
| if (r0 >= r7) {
0x0000ef24 bge 0xed94 | goto label_2;
| }
0x0000ef28 ldr r5, [pc, 0x1a8] | r5 = *(0xf0d4);
0x0000ef2c add r5, pc, r5 | r5 = pc + r5;
0x0000ef30 b 0xefd4 | goto label_6;
| label_11:
0x0000ef34 cmp r2, 0x6a |
| if (r2 == 0x6a) {
0x0000ef38 beq 0xedc8 | goto label_3;
| }
| do {
0x0000ef3c ldr r2, [r4, 0x158] | r2 = *((r4 + 0x158));
0x0000ef40 ldr r7, [r2, 0x174] | r7 = *((r2 + 0x174));
0x0000ef44 cmp r7, 0 |
| if (r7 == 0) {
0x0000ef48 beq 0xf01c | goto label_14;
| }
0x0000ef4c mov r1, 0x55 | r1 = 0x55;
0x0000ef50 mov r0, r4 | r0 = r4;
0x0000ef54 bl 0xa868 | r0 = lws_hdr_simple_create ();
0x0000ef58 cmp r0, 0 |
| if (r0 != 0) {
0x0000ef5c bne 0xf06c | goto label_15;
| }
0x0000ef60 ldr r3, [r4, 0x158] | r3 = *((r4 + 0x158));
0x0000ef64 mov r2, r5 | r2 = r5;
0x0000ef68 ldr r3, [r3, 0x174] | r3 = *((r3 + 0x174));
0x0000ef6c ldr r0, [r4, 0x19c] | r0 = *((r4 + 0x19c));
0x0000ef70 strh r3, [r8, 2] | *((r8 + 2)) = r3;
0x0000ef74 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0000ef78 add r6, r6, r3, lsl 6 | r6 += (r3 << 6);
0x0000ef7c ldr r1, [r6, 0x68] | r1 = *((r6 + 0x68));
0x0000ef80 mov r3, 0x4000 | r3 = 0x4000;
0x0000ef84 bl 0x4804 | r0 = send (r0, r1, r2, r3);
0x0000ef88 cmp r0, 0 |
| if (r0 < 0) {
0x0000ef8c blt 0xf078 | goto label_16;
| }
0x0000ef90 mov r2, 0x14 | r2 = 0x14;
0x0000ef94 mov r1, 1 | r1 = 1;
0x0000ef98 mov r0, r4 | r0 = r4;
0x0000ef9c bl 0x45a0 | fcn_000045a0 ();
0x0000efa0 mov r3, 0x23 | r3 = 0x23;
0x0000efa4 strb r3, [r4, 0x1c9] | *((r4 + 0x1c9)) = r3;
| label_5:
0x0000efa8 mov r0, r4 | r0 = r4;
0x0000efac add sp, sp, 0x44 |
0x0000efb0 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_12:
0x0000efb4 cmp r2, 0x6a |
0x0000efb8 beq 0xef3c |
| } while (r2 == 0x6a);
0x0000efbc ldr r1, [pc, 0x118] | r1 = *(0xf0d8);
0x0000efc0 mov r0, 4 | r0 = 4;
0x0000efc4 add r1, pc, r1 | r1 = pc + r1;
0x0000efc8 bl 0x4c24 | fcn_00004c24 ();
0x0000efcc ldr r5, [pc, 0x10c] | r5 = *(0xf0dc);
0x0000efd0 add r5, pc, r5 | r5 = pc + r5;
| do {
| label_6:
0x0000efd4 mov r0, r5 | r0 = r5;
0x0000efd8 bl 0x4d74 | strlen (r0);
0x0000efdc ldr r3, [r4, 0x158] | r3 = *((r4 + 0x158));
0x0000efe0 mov r1, 1 | r1 = 1;
0x0000efe4 ldr r3, [r3, 0x14c] | r3 = *((r3 + 0x14c));
0x0000efe8 str r0, [sp] | *(sp) = r0;
0x0000efec mov r0, r4 | r0 = r4;
0x0000eff0 ldr r6, [r3, 4] | r6 = *((r3 + 4));
0x0000eff4 ldr r2, [r4, 0x17c] | r2 = *((r4 + 0x17c));
0x0000eff8 mov r3, r5 | r3 = r5;
0x0000effc blx r6 | uint32_t (*r6)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x0000f000 ldrb r3, [r4, 0x1c2] | r3 = *((r4 + 0x1c2));
0x0000f004 orr r3, r3, 1 | r3 |= 1;
0x0000f008 strb r3, [r4, 0x1c2] | *((r4 + 0x1c2)) = r3;
| label_8:
0x0000f00c mov r1, 0 | r1 = 0;
0x0000f010 mov r0, r4 | r0 = r4;
0x0000f014 bl 0x6424 | lws_close_free_wsi ();
0x0000f018 b 0xebbc | goto label_4;
| label_14:
0x0000f01c mov r2, 0x14 | r2 = 0x14;
0x0000f020 mov r1, 8 | r1 = 8;
0x0000f024 mov r0, r4 | r0 = r4;
0x0000f028 bl 0x45a0 | fcn_000045a0 ();
0x0000f02c mov r3, 0x24 | r3 = 0x24;
0x0000f030 strb r3, [r4, 0x1c9] | *((r4 + 0x1c9)) = r3;
0x0000f034 ldr r3, [r4, 0x19c] | r3 = *((r4 + 0x19c));
0x0000f038 add r1, sp, 0x18 | r1 += var_18h;
0x0000f03c str r3, [sp, 0x18] | var_18h = r3;
0x0000f040 ldr r3, [pc, 0x9c] | r3 = *(0xf0e0);
0x0000f044 mov r0, r6 | r0 = r6;
0x0000f048 str r3, [sp, 0x1c] | var_1ch = r3;
0x0000f04c bl 0x4594 | r0 = fcn_00004594 ();
0x0000f050 cmp r0, 0 |
| if (r0 < 0) {
0x0000f054 blt 0xf084 | goto label_17;
| }
| if (r0 == 0) {
0x0000f058 movne r4, r7 | r4 = r7;
| }
0x0000f05c b 0xefa8 | goto label_5;
| label_13:
0x0000f060 ldr r5, [pc, 0x80] | r5 = *(0xf0e4);
0x0000f064 add r5, pc, r5 | r5 = pc + r5;
0x0000f068 b 0xefd4 |
| } while (1);
| label_15:
0x0000f06c ldr r5, [pc, 0x78] | r5 = *(0xf0e8);
0x0000f070 add r5, pc, r5 | r5 = pc + r5;
0x0000f074 b 0xefd4 | goto label_6;
| label_16:
0x0000f078 ldr r5, [pc, 0x70] | r5 = *(0xf0ec);
0x0000f07c add r5, pc, r5 | r5 = pc + r5;
0x0000f080 b 0xefd4 | goto label_6;
| label_17:
0x0000f084 ldr r5, [pc, 0x68] | r5 = *(0xf0f0);
0x0000f088 add r5, pc, r5 | r5 = pc + r5;
0x0000f08c b 0xefd4 | goto label_6;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libwebsockets.so.12 @ 0xc8c4 */
| #include <stdint.h>
|
; (fcn) sym.lws_create_context () | void lws_create_context (int32_t arg1) {
| r0 = arg1;
0x0000c8c4 ldr r1, [pc, 0x304] | r1 = *(0xcbcc);
0x0000c8c8 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x0000c8cc ldr r6, [pc, 0x300] | r6 = *(0xcbd0);
0x0000c8d0 add r1, pc, r1 | r1 = pc + r1;
0x0000c8d4 mov r5, r0 | r5 = r0;
0x0000c8d8 mov r0, 4 | r0 = 4;
0x0000c8dc bl 0x4c24 | fcn_00004c24 ();
0x0000c8e0 bl 0x4d68 | fcn_00004d68 ();
0x0000c8e4 add r6, pc, r6 | r6 = pc + r6;
0x0000c8e8 cmp r0, 0 |
| if (r0 != 0) {
0x0000c8ec bne 0xcae8 | goto label_3;
| }
0x0000c8f0 ldr r1, [pc, 0x2e0] | r1 = *(0xcbd4);
0x0000c8f4 mov r0, 0x1b8 | r0 = 0x1b8;
0x0000c8f8 add r1, pc, r1 | r1 = pc + r1;
0x0000c8fc bl 0xcc50 | r0 = lws_zalloc ();
0x0000c900 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x0000c904 bne 0xc920 |
0x0000c908 ldr r1, [pc, 0x2cc] | r1 = *(0xcbd8);
0x0000c90c mov r0, 1 | r0 = 1;
0x0000c910 add r1, pc, r1 | r1 = pc + r1;
0x0000c914 bl 0x4c24 | fcn_00004c24 ();
| label_0:
0x0000c918 mov r0, r4 | r0 = r4;
0x0000c91c pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
0x0000c920 ldr r3, [r5, 0x80] | r3 = *((r5 + 0x80));
0x0000c924 mov r0, 0 | r0 = 0;
0x0000c928 cmp r3, 0 |
| if (r3 != 0) {
0x0000c92c moveq r3, 0x1000 | r3 = 0x1000;
| }
0x0000c930 str r3, [r4, 0x184] | *((r4 + 0x184)) = r3;
0x0000c934 ldr r3, [pc, 0x2a4] | r3 = *(0xcbdc);
0x0000c938 add r8, r4, 0x1ac | r8 = r4 + 0x1ac;
0x0000c93c ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0000c940 str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x0000c944 ldr r3, [pc, 0x298] | r3 = *(0xcbe0);
0x0000c948 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0000c94c str r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
0x0000c950 ldr r3, [pc, 0x290] | r3 = *(0xcbe4);
0x0000c954 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0000c958 str r3, [r4, 0x18] | *((r4 + 0x18)) = r3;
0x0000c95c ldr r3, [pc, 0x288] | r3 = *(0xcbe8);
0x0000c960 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0000c964 str r3, [r4, 0x1c] | *((r4 + 0x1c)) = r3;
0x0000c968 ldr r3, [pc, 0x280] | r3 = *(0xcbec);
0x0000c96c ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0000c970 add r6, r4, 0x1a4 | r6 = r4 + 0x1a4;
0x0000c974 str r3, [r4, 0x20] | *((r4 + 0x20)) = r3;
0x0000c978 mov r3, 0 | r3 = 0;
0x0000c97c str r3, [r4, 0x24] | *((r4 + 0x24)) = r3;
0x0000c980 add r3, r4, 0x10 | r3 = r4 + 0x10;
0x0000c984 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x0000c988 ldr r3, [r5, 0xb4] | r3 = *((r5 + 0xb4));
0x0000c98c cmp r3, 0 |
| if (r3 == 0) {
0x0000c990 strne r3, [r4, 0x3c] | *((r4 + 0x3c)) = r3;
| }
0x0000c994 ldr r3, [r5, 0x98] | r3 = *((r5 + 0x98));
0x0000c998 str r3, [r4, 0xd4] | *((r4 + 0xd4)) = r3;
0x0000c99c ldr r3, [r5, 0x9c] | r3 = *((r5 + 0x9c));
0x0000c9a0 cmp r3, 0 |
| if (r3 == 0) {
0x0000c9a4 strne r3, [r4, 0xc4] | *((r4 + 0xc4)) = r3;
| }
0x0000c9a8 bl 0x4b70 | time (r0);
0x0000c9ac ldr r3, [r5, 0xb8] | r3 = *((r5 + 0xb8));
0x0000c9b0 str r3, [r4, 0x18c] | *((r4 + 0x18c)) = r3;
0x0000c9b4 str r0, [r4, 8] | *((r4 + 8)) = r0;
0x0000c9b8 bl 0x45ac | getdtablesize ();
0x0000c9bc ldr r3, [r5, 0x54] | r3 = *((r5 + 0x54));
0x0000c9c0 cmp r3, 0 |
| if (r3 != 0) {
0x0000c9c4 moveq r3, 1 | r3 = 1;
| }
0x0000c9c8 str r0, [r4, 0x15c] | *((r4 + 0x15c)) = r0;
0x0000c9cc strh r3, [r6, 2] | *((r6 + 2)) = r3;
0x0000c9d0 ldrsh r3, [r6, 2] | r3 = *((r6 + 2));
0x0000c9d4 cmp r3, 1 |
| if (r3 <= 1) {
0x0000c9d8 movgt r3, 1 | r3 = 1;
| }
0x0000c9dc strhgt r3, [r6, 2] | __asm ("strhgt r3, [r6, 2]");
0x0000c9e0 ldr r3, [r5, 0x10] | r3 = *((r5 + 0x10));
0x0000c9e4 str r3, [r4, 0xc8] | *((r4 + 0xc8)) = r3;
0x0000c9e8 ldr r3, [r5, 0x38] | r3 = *((r5 + 0x38));
0x0000c9ec str r3, [r4, 0x178] | *((r4 + 0x178)) = r3;
0x0000c9f0 ldr r3, [r5, 0x5c] | r3 = *((r5 + 0x5c));
0x0000c9f4 cmp r3, 0 |
| if (r3 != 0) {
0x0000c9f8 moveq r3, 0x14 | r3 = 0x14;
| }
0x0000c9fc str r3, [r4, 0x180] | *((r4 + 0x180)) = r3;
0x0000ca00 ldrh r3, [r5, 0x90] | r3 = *((r5 + 0x90));
0x0000ca04 strh r3, [r8, 2] | *((r8 + 2)) = r3;
0x0000ca08 ldrsh r3, [r5, 0x50] | r3 = *((r5 + 0x50));
0x0000ca0c cmp r3, 0 |
0x0000ca10 beq 0xcabc |
| while (1) {
0x0000ca14 str r3, [r4, 0x188] | *((r4 + 0x188)) = r3;
0x0000ca18 ldrsh r3, [r5, 0x52] | r3 = *((r5 + 0x52));
0x0000ca1c ldrsh r7, [r6, 2] | r7 = *((r6 + 2));
0x0000ca20 cmp r3, 0 |
| if (r3 != 0) {
0x0000ca24 moveq r3, 4 | r3 = 4;
| }
0x0000ca28 cmp r7, 0 |
0x0000ca2c strh r3, [r6] | *(r6) = r3;
| if (r7 > 0) {
0x0000ca30 ble 0xca78 |
0x0000ca34 ldr sb, [pc, 0x1b8] | sb = *(0xcbf0);
0x0000ca38 ldr r1, [r4, 0x184] | r1 = *((r4 + 0x184));
0x0000ca3c add sb, pc, sb | sb = pc + sb;
0x0000ca40 mov r2, sb | r2 = sb;
0x0000ca44 mov r0, 0 | r0 = 0;
0x0000ca48 bl 0xcc3c | r0 = lws_realloc ();
0x0000ca4c cmp r0, 0 |
0x0000ca50 mov r7, r0 | r7 = r0;
0x0000ca54 str r0, [r4, 0x68] | *((r4 + 0x68)) = r0;
| if (r0 == 0) {
0x0000ca58 beq 0xcad8 | goto label_4;
| }
0x0000ca5c mov r0, 0 | r0 = 0;
0x0000ca60 strb r0, [r4, 0x7e] | *((r4 + 0x7e)) = r0;
0x0000ca64 ldrsh r7, [r6, 2] | r7 = *((r6 + 2));
0x0000ca68 str r0, [r4, 0x54] | *((r4 + 0x54)) = r0;
0x0000ca6c cmp r7, 1 |
0x0000ca70 str r0, [r4, 0x78] | *((r4 + 0x78)) = r0;
| if (r7 > 1) {
0x0000ca74 bgt 0xcacc | goto label_5;
| }
| }
0x0000ca78 ldr r3, [r5, 0x58] | r3 = *((r5 + 0x58));
0x0000ca7c cmp r3, 0 |
| if (r3 == 0) {
0x0000ca80 strne r3, [r4, 0x17c] | *((r4 + 0x17c)) = r3;
| }
| if (r3 == 0) {
0x0000ca84 bne 0xca98 |
0x0000ca88 mov r1, r7 | r1 = r7;
0x0000ca8c ldr r0, [r4, 0x15c] | r0 = *((r4 + 0x15c));
0x0000ca90 bl 0x150ec | aeabi_idiv ();
0x0000ca94 str r0, [r4, 0x17c] | *((r4 + 0x17c)) = r0;
| }
0x0000ca98 ldr r6, [r5, 0x48] | r6 = *((r5 + 0x48));
0x0000ca9c cmp r6, 0 |
| if (r6 != 0) {
0x0000caa0 bne 0xcaf0 | goto label_6;
| }
0x0000caa4 ldr r3, [r5, 0x40] | r3 = *((r5 + 0x40));
0x0000caa8 cmp r3, 0 |
| if (r3 <= 0) {
0x0000caac ble 0xcaf0 | goto label_6;
| }
0x0000cab0 ldr r1, [pc, 0x140] | r1 = *(0xcbf4);
0x0000cab4 add r1, pc, r1 | r1 = pc + r1;
0x0000cab8 b 0xcae0 | goto label_2;
0x0000cabc ldr r3, [r5, 0x84] | r3 = *((r5 + 0x84));
0x0000cac0 cmp r3, 0 |
| if (r3 != 0) {
0x0000cac4 moveq r3, 0x1000 | r3 = 0x1000;
| }
0x0000cac8 b 0xca14 |
| }
| label_5:
0x0000cacc mov r2, sb | r2 = sb;
0x0000cad0 ldr r1, [r4, 0x184] | r1 = *((r4 + 0x184));
0x0000cad4 bl 0xcc3c | lws_realloc ();
| label_4:
0x0000cad8 ldr r1, [pc, 0x11c] | r1 = *(0xcbf8);
0x0000cadc add r1, pc, r1 | r1 = pc + r1;
| label_2:
0x0000cae0 mov r0, 1 | r0 = 1;
0x0000cae4 bl 0x4c24 | fcn_00004c24 ();
| do {
| label_3:
0x0000cae8 mov r4, 0 | r4 = 0;
0x0000caec b 0xc918 | goto label_0;
| label_6:
0x0000caf0 ldr r0, [r4, 0x17c] | r0 = *((r4 + 0x17c));
0x0000caf4 ldr r1, [pc, 0x104] | r1 = *(0xcbfc);
0x0000caf8 lsl r3, r0, 3 | r3 = r0 << 3;
0x0000cafc add r1, pc, r1 | r1 = pc + r1;
0x0000cb00 mul r0, r7, r3 | r0 = r7 * r3;
0x0000cb04 bl 0xcc50 | r0 = lws_zalloc ();
0x0000cb08 cmp r0, 0 |
0x0000cb0c str r0, [r4, 0x40] | *((r4 + 0x40)) = r0;
| if (r0 != 0) {
0x0000cb10 bne 0xcb34 | goto label_7;
| }
0x0000cb14 ldr r1, [pc, 0xe8] | r1 = *(0xcc00);
0x0000cb18 ldr r2, [r4, 0x15c] | r2 = *((r4 + 0x15c));
0x0000cb1c add r1, pc, r1 | r1 = pc + r1;
0x0000cb20 mov r0, 1 | r0 = 1;
0x0000cb24 bl 0x4c24 | fcn_00004c24 ();
| label_1:
0x0000cb28 mov r0, r4 | r0 = r4;
0x0000cb2c bl 0x4be8 | fcn_00004be8 ();
0x0000cb30 b 0xcae8 |
| } while (1);
| label_7:
0x0000cb34 ldr r0, [r5, 0x7c] | r0 = *((r5 + 0x7c));
0x0000cb38 cmp r0, 0 |
| if (r0 != 0) {
0x0000cb3c beq 0xcb4c |
0x0000cb40 str r0, [r4, 0xd0] | *((r4 + 0xd0)) = r0;
0x0000cb44 bl 0x4d74 | strlen (r0);
0x0000cb48 strh r0, [r8] | *(r8) = r0;
| }
0x0000cb4c mov r1, r5 | r1 = r5;
0x0000cb50 mov r0, r4 | r0 = r4;
0x0000cb54 bl 0x4e40 | r0 = fcn_00004e40 ();
0x0000cb58 cmp r0, 0 |
| if (r0 != 0) {
0x0000cb5c bne 0xcb28 | goto label_1;
| }
0x0000cb60 mov r0, r5 | r0 = r5;
0x0000cb64 bl 0x129f8 | lws_context_init_ssl_library ();
0x0000cb68 ldr r3, [r5, 0x3c] | r3 = *((r5 + 0x3c));
0x0000cb6c str r3, [r4, 0xcc] | *((r4 + 0xcc)) = r3;
0x0000cb70 ldr r3, [r5, 0x38] | r3 = *((r5 + 0x38));
0x0000cb74 tst r3, 0x2000 |
| if ((r3 & 0x2000) != 0) {
0x0000cb78 bne 0xcb98 | goto label_8;
| }
0x0000cb7c mov r1, r5 | r1 = r5;
0x0000cb80 mov r0, r4 | r0 = r4;
0x0000cb84 bl 0x4c00 | r0 = fcn_00004c00 ();
0x0000cb88 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 != r0) {
0x0000cb8c ldreq r1, [pc, 0x74] | r1 = *((pc + 0x74));
| }
| if (r6 == r0) {
0x0000cb90 addeq r1, pc, r1 | r1 = pc + r1;
| goto label_9;
| }
| if (r6 == r0) {
| label_9:
0x0000cb94 beq 0xcae0 | goto label_2;
| }
| label_8:
0x0000cb98 ldr r1, [pc, 0x6c] | r1 = *(0xcc08);
0x0000cb9c add r0, r4, 0xdc | r0 = r4 + 0xdc;
0x0000cba0 add r1, pc, r1 | r1 = pc + r1;
0x0000cba4 bl 0x4570 | strcpy (r0, r1)
0x0000cba8 ldr r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x0000cbac str r3, [r4, 0x164] | *((r4 + 0x164)) = r3;
0x0000cbb0 ldr r3, [r5, 0x30] | r3 = *((r5 + 0x30));
0x0000cbb4 str r3, [r4, 0x168] | *((r4 + 0x168)) = r3;
0x0000cbb8 ldr r3, [r5, 0x38] | r3 = *((r5 + 0x38));
0x0000cbbc tst r3, 0x2000 |
| if ((r3 & 0x2000) != 0) {
0x0000cbc0 bne 0xc918 | goto label_0;
| }
0x0000cbc4 mov r0, r5 | r0 = r5;
0x0000cbc8 bl 0x4d50 | fcn_00004d50 ();
0x0000cbcc b 0xc918 | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libwebsockets.so.12 @ 0xe320 */
| #include <stdint.h>
|
; (fcn) sym.lws_generate_client_handshake () | void lws_generate_client_handshake (int32_t arg1, char * arg2) {
| int32_t var_0h;
| char * dest;
| int32_t var_ch;
| char * src;
| int32_t var_47h;
| char * s;
| char * var_0h_2;
| int32_t var_c8h;
| r0 = arg1;
| r1 = arg2;
0x0000e320 push {r4, r5, r6, r7, r8, lr} |
0x0000e324 ldr r7, [r0, 0x154] | r7 = *((r0 + 0x154));
0x0000e328 sub sp, sp, 0xc8 |
0x0000e32c str r1, [sp, 8] | dest = r1;
0x0000e330 mov r5, r1 | r5 = r1;
0x0000e334 mov r1, 0x54 | r1 = 0x54;
0x0000e338 mov r4, r0 | r4 = r0;
0x0000e33c bl 0xa708 | lws_hdr_simple_ptr ();
0x0000e340 mov r1, 0x59 | r1 = 0x59;
0x0000e344 mov r6, r0 | r6 = r0;
0x0000e348 mov r0, r4 | r0 = r4;
0x0000e34c bl 0xa708 | lws_hdr_simple_ptr ();
0x0000e350 ldrb r3, [r4, 0x1c3] | r3 = *((r4 + 0x1c3));
0x0000e354 subs r8, r0, 0 | r8 = r0 - 0;
0x0000e358 bicne r3, r3, 2 | __asm ("bicne r3, r3, 2");
| if (r8 == r0) {
0x0000e35c strbne r3, [r4, 0x1c3] | *((r4 + 0x1c3)) = r3;
| }
| if (r8 != r0) {
0x0000e360 ldreq r8, [pc, 0x370] | r8 = *(0x0000e6d8);
| }
| if (r8 != r0) {
0x0000e364 orreq r3, r3, 2 | r3 |= 2;
| }
| if (r8 != r0) {
0x0000e368 addeq r8, pc, r8 | r8 = pc + r8;
| }
| if (r8 != r0) {
0x0000e36c strbeq r3, [r4, 0x1c3] | *((r4 + 0x1c3)) = r3;
| }
0x0000e370 ldr r1, [pc, 0x364] | r1 = $d;
0x0000e374 mov r0, r8 | r0 = r8;
0x0000e378 add r1, pc, r1 | r1 = pc + r1;
0x0000e37c bl 0x4bb8 | r0 = strcmp (r0, r1);
0x0000e380 subs r2, r0, 0 | r2 = r0 - 0;
| if (r2 != r0) {
0x0000e384 bne 0xe43c | goto label_4;
| }
0x0000e388 mov r1, r2 | r1 = r2;
0x0000e38c mov r0, r4 | r0 = r4;
0x0000e390 bl 0x45a0 | fcn_000045a0 ();
0x0000e394 ldr r1, [pc, 0x344] | r1 = *(0xe6dc);
0x0000e398 mov r0, 4 | r0 = 4;
0x0000e39c add r1, pc, r1 | r1 = pc + r1;
0x0000e3a0 bl 0x4c24 | fcn_00004c24 ();
0x0000e3a4 cmp r6, 0 |
| if (r6 != 0) {
0x0000e3a8 beq 0xe3e4 |
0x0000e3ac mov r1, r6 | r1 = r6;
0x0000e3b0 ldr r0, [r4, 0x158] | r0 = *((r4 + 0x158));
0x0000e3b4 bl 0x481c | r0 = fcn_0000481c ();
0x0000e3b8 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 == r0) {
0x0000e3bc bne 0xe3d8 |
0x0000e3c0 ldr r1, [pc, 0x31c] | r1 = *(0xe6e0);
0x0000e3c4 mov r2, r6 | r2 = r6;
0x0000e3c8 add r1, pc, r1 | r1 = pc + r1;
| label_0:
0x0000e3cc mov r0, 1 | r0 = 1;
0x0000e3d0 bl 0x4c24 | fcn_00004c24 ();
0x0000e3d4 b 0xe40c | goto label_1;
| }
0x0000e3d8 mov r1, r5 | r1 = r5;
0x0000e3dc mov r0, r4 | r0 = r4;
0x0000e3e0 bl 0x6088 | lws_bind_protocol ();
| }
0x0000e3e4 ldr r2, [r4, 0x168] | r2 = *((r4 + 0x168));
0x0000e3e8 mov r3, 0 | r3 = 0;
0x0000e3ec str r3, [sp] | *(sp) = r3;
0x0000e3f0 mov r1, 0x3e | r1 = 0x3e;
0x0000e3f4 ldr r5, [r2, 4] | r5 = *((r2 + 4));
0x0000e3f8 mov r0, r4 | r0 = r4;
0x0000e3fc ldr r2, [r4, 0x17c] | r2 = *((r4 + 0x17c));
0x0000e400 blx r5 | r0 = uint32_t (*r5)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x0000e404 subs r5, r0, 0 | r5 = r0 - 0;
0x0000e408 beq 0xe418 |
| while (1) {
| label_1:
0x0000e40c mov r0, 0 | r0 = 0;
| label_2:
0x0000e410 add sp, sp, 0xc8 |
0x0000e414 pop {r4, r5, r6, r7, r8, pc} |
0x0000e418 mov r0, r4 | r0 = r4;
0x0000e41c bl 0xa328 | lws_header_table_force_to_detachable_state ();
0x0000e420 mov r0, r4 | r0 = r4;
0x0000e424 mov r1, 0xc | r1 = 0xc;
0x0000e428 bl 0x4af8 | fcn_00004af8 ();
0x0000e42c mov r1, 1 | r1 = 1;
0x0000e430 mov r0, r4 | r0 = r4;
0x0000e434 bl 0xa37c | lws_header_table_detach ();
0x0000e438 b 0xe40c |
| }
| label_4:
0x0000e43c ldrb r3, [r4, 0x1c3] | r3 = *((r4 + 0x1c3));
0x0000e440 tst r3, 2 |
| if ((r3 & 2) == 0) {
0x0000e444 beq 0xe488 | goto label_5;
| }
0x0000e448 add r6, sp, 0xc | r6 += var_ch;
0x0000e44c mov r1, r6 | r1 = r6;
0x0000e450 mov r2, 0x10 | r2 = 0x10;
0x0000e454 mov r0, r7 | r0 = r7;
0x0000e458 bl 0x4bf4 | r0 = fcn_00004bf4 ();
0x0000e45c cmp r0, 0x10 |
0x0000e460 mov r1, r0 | r1 = r0;
| if (r0 == 0x10) {
0x0000e464 ldrne r2, [pc, 0x27c] | r2 = *(0x0000e6e8);
| }
| if (r0 == 0x10) {
0x0000e468 ldrne r1, [pc, 0x27c] | r1 = *((pc + 0x27c));
| }
| if (r0 == 0x10) {
0x0000e46c addne r2, pc, r2 | r2 = pc + r2;
| }
| if (r0 != 0x10) {
0x0000e470 addne r1, pc, r1 | r1 = pc + r1;
| goto label_6;
| }
| if (r0 != 0x10) {
| label_6:
0x0000e474 bne 0xe3cc | goto label_0;
| }
0x0000e478 mov r3, 0x28 | r3 = 0x28;
0x0000e47c add r2, sp, 0x20 | r2 += src;
0x0000e480 mov r0, r6 | r0 = r6;
0x0000e484 bl 0x457c | fcn_0000457c ();
| label_5:
0x0000e488 mov r1, 0x56 | r1 = 0x56;
0x0000e48c mov r0, r4 | r0 = r4;
0x0000e490 ldr r6, [sp, 8] | r6 = dest;
0x0000e494 bl 0xa708 | lws_hdr_simple_ptr ();
0x0000e498 ldr r1, [pc, 0x250] | r1 = *(0xe6ec);
0x0000e49c mov r2, r8 | r2 = r8;
0x0000e4a0 add r1, pc, r1 | r1 = pc + r1;
0x0000e4a4 mov r3, r0 | r3 = r0;
0x0000e4a8 mov r0, r6 | r0 = r6;
0x0000e4ac bl 0x4c18 | sprintf (r0, r1, r2);
0x0000e4b0 ldr r3, [sp, 8] | r3 = dest;
0x0000e4b4 ldr r1, [pc, 0x238] | r1 = *(0xe6f0);
0x0000e4b8 add r1, pc, r1 | r1 = pc + r1;
0x0000e4bc add r0, r3, r0 | r0 = r3 + r0;
0x0000e4c0 str r0, [sp, 8] | dest = r0;
0x0000e4c4 bl 0x4570 | strcpy (r0, r1)
0x0000e4c8 ldr r6, [sp, 8] | r6 = dest;
0x0000e4cc mov r1, 0x57 | r1 = 0x57;
0x0000e4d0 add r6, r6, 0x2b | r6 += 0x2b;
0x0000e4d4 mov r0, r4 | r0 = r4;
0x0000e4d8 str r6, [sp, 8] | dest = r6;
0x0000e4dc bl 0xa708 | lws_hdr_simple_ptr ();
0x0000e4e0 ldr r1, [pc, 0x210] | r1 = *(0xe6f4);
0x0000e4e4 add r1, pc, r1 | r1 = pc + r1;
0x0000e4e8 mov r2, r0 | r2 = r0;
0x0000e4ec mov r0, r6 | r0 = r6;
0x0000e4f0 bl 0x4c18 | sprintf (r0, r1, r2);
0x0000e4f4 ldr r3, [sp, 8] | r3 = dest;
0x0000e4f8 mov r1, 0x58 | r1 = 0x58;
0x0000e4fc add r0, r3, r0 | r0 = r3 + r0;
0x0000e500 str r0, [sp, 8] | dest = r0;
0x0000e504 mov r0, r4 | r0 = r4;
0x0000e508 bl 0xa708 | r0 = lws_hdr_simple_ptr ();
0x0000e50c cmp r0, 0 |
| if (r0 != 0) {
0x0000e510 beq 0xe550 |
0x0000e514 ldr r3, [r7, 0x178] | r3 = *((r7 + 0x178));
0x0000e518 ldr r6, [sp, 8] | r6 = dest;
0x0000e51c tst r3, 0x80000 |
0x0000e520 mov r1, 0x58 | r1 = 0x58;
0x0000e524 mov r0, r4 | r0 = r4;
| if ((r3 & 0x80000) == 0) {
0x0000e528 beq 0xe6c4 | goto label_7;
| }
0x0000e52c bl 0xa708 | lws_hdr_simple_ptr ();
0x0000e530 ldr r1, [pc, 0x1c4] | r1 = *(0xe6f8);
0x0000e534 add r1, pc, r1 | r1 = pc + r1;
0x0000e538 mov r2, r0 | r2 = r0;
| label_3:
0x0000e53c mov r0, r6 | r0 = r6;
0x0000e540 bl 0x4c18 | sprintf (r0, r1, r2);
0x0000e544 ldr r3, [sp, 8] | r3 = dest;
0x0000e548 add r0, r3, r0 | r0 = r3 + r0;
0x0000e54c str r0, [sp, 8] | dest = r0;
| }
0x0000e550 ldrb r3, [r4, 0x1c3] | r3 = *((r4 + 0x1c3));
0x0000e554 tst r3, 2 |
| if ((r3 & 2) != 0) {
0x0000e558 beq 0xe66c |
0x0000e55c ldr r1, [pc, 0x19c] | r1 = *(0xe6fc);
0x0000e560 ldr r0, [sp, 8] | r0 = dest;
0x0000e564 add r1, pc, r1 | r1 = pc + r1;
0x0000e568 bl 0x4570 | strcpy (r0, r1)
0x0000e56c ldr r6, [sp, 8] | r6 = dest;
0x0000e570 add r8, sp, 0x20 | r8 += src;
0x0000e574 add r6, r6, 0x3c | r6 += 0x3c;
0x0000e578 mov r1, r8 | r1 = r8;
0x0000e57c mov r0, r6 | r0 = r6;
0x0000e580 str r6, [sp, 8] | dest = r6;
0x0000e584 bl 0x4570 | strcpy (r0, r1)
0x0000e588 mov r0, r8 | r0 = r8;
0x0000e58c bl 0x4d74 | strlen (r0);
0x0000e590 ldr r1, [pc, 0x16c] | r1 = *(0xe700);
0x0000e594 add r1, pc, r1 | r1 = pc + r1;
0x0000e598 add r0, r6, r0 | r0 = r6 + r0;
0x0000e59c str r0, [sp, 8] | dest = r0;
0x0000e5a0 bl 0x4570 | strcpy (r0, r1)
0x0000e5a4 ldr r3, [sp, 8] | r3 = dest;
0x0000e5a8 mov r1, 0x54 | r1 = 0x54;
0x0000e5ac add r3, r3, 2 | r3 += 2;
0x0000e5b0 mov r0, r4 | r0 = r4;
0x0000e5b4 str r3, [sp, 8] | dest = r3;
0x0000e5b8 bl 0xa708 | r0 = lws_hdr_simple_ptr ();
0x0000e5bc cmp r0, 0 |
| if (r0 != 0) {
0x0000e5c0 beq 0xe5f4 |
0x0000e5c4 mov r1, 0x54 | r1 = 0x54;
0x0000e5c8 mov r0, r4 | r0 = r4;
0x0000e5cc ldr r6, [sp, 8] | r6 = dest;
0x0000e5d0 bl 0xa708 | lws_hdr_simple_ptr ();
0x0000e5d4 ldr r1, [pc, 0x12c] | r1 = *(0xe704);
0x0000e5d8 add r1, pc, r1 | r1 = pc + r1;
0x0000e5dc mov r2, r0 | r2 = r0;
0x0000e5e0 mov r0, r6 | r0 = r6;
0x0000e5e4 bl 0x4c18 | sprintf (r0, r1, r2);
0x0000e5e8 ldr r3, [sp, 8] | r3 = dest;
0x0000e5ec add r0, r3, r0 | r0 = r3 + r0;
0x0000e5f0 str r0, [sp, 8] | dest = r0;
| }
0x0000e5f4 ldrb r2, [r4, 0x1c8] | r2 = *((r4 + 0x1c8));
0x0000e5f8 cmp r2, 0 |
| if (r2 != 0) {
0x0000e5fc beq 0xe61c |
0x0000e600 ldr r1, [pc, 0x104] | r1 = *(0xe708);
0x0000e604 ldr r0, [sp, 8] | r0 = dest;
0x0000e608 add r1, pc, r1 | r1 = pc + r1;
0x0000e60c bl 0x4c18 | sprintf (r0, r1, r2);
0x0000e610 ldr r3, [sp, 8] | r3 = dest;
0x0000e614 add r0, r3, r0 | r0 = r3 + r0;
0x0000e618 str r0, [sp, 8] | dest = r0;
| }
0x0000e61c ldr r1, [pc, 0xec] | r1 = *(0xe70c);
0x0000e620 add r6, sp, 0x48 | r6 += s;
0x0000e624 mov r3, 0 | r3 = 0;
0x0000e628 mov r2, r8 | r2 = r8;
0x0000e62c add r1, pc, r1 | r1 = pc + r1;
0x0000e630 mov r0, r6 | r0 = r6;
0x0000e634 strb r3, [sp, 0x47] | var_47h = r3;
0x0000e638 bl 0x4c18 | sprintf (r0, r1, r2);
0x0000e63c add r8, sp, 0xc | r8 += var_ch;
0x0000e640 mov r2, r8 | r2 = r8;
0x0000e644 mov r1, r0 | r1 = r0;
0x0000e648 mov r0, r6 | r0 = r6;
0x0000e64c bl 0x4dbc | fcn_00004dbc ();
0x0000e650 ldr r2, [r4] | r2 = *(r4);
0x0000e654 mov r3, 0x1e | r3 = 0x1e;
0x0000e658 add r2, r2, 0xb50 | r2 += 0xb50;
0x0000e65c add r2, r2, 8 | r2 += 8;
0x0000e660 mov r1, 0x14 | r1 = 0x14;
0x0000e664 mov r0, r8 | r0 = r8;
0x0000e668 bl 0x457c | fcn_0000457c ();
| }
0x0000e66c ldr r2, [r7, 0x184] | r2 = *((r7 + 0x184));
0x0000e670 ldr r3, [r4, 0x168] | r3 = *((r4 + 0x168));
0x0000e674 add r5, r5, r2 | r5 += r2;
0x0000e678 ldr r2, [sp, 8] | r2 = dest;
0x0000e67c mov r1, 0x18 | r1 = 0x18;
0x0000e680 sub r5, r5, r2 | r5 -= r2;
0x0000e684 sub r5, r5, 0xc | r5 -= 0xc;
0x0000e688 str r5, [sp] | *(sp) = r5;
0x0000e68c ldr r2, [r4, 0x17c] | r2 = *((r4 + 0x17c));
0x0000e690 ldr r5, [r3, 4] | r5 = *((r3 + 4));
0x0000e694 mov r0, r4 | r0 = r4;
0x0000e698 add r3, sp, 8 | r3 += dest;
0x0000e69c blx r5 | r0 = uint32_t (*r5)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x0000e6a0 cmp r0, 0 |
| if (r0 != 0) {
0x0000e6a4 bne 0xe40c | goto label_1;
| }
0x0000e6a8 ldr r1, [pc, 0x64] | r1 = *(0xe710);
0x0000e6ac ldr r0, [sp, 8] | r0 = dest;
0x0000e6b0 add r1, pc, r1 | r1 = pc + r1;
0x0000e6b4 bl 0x4570 | strcpy (r0, r1)
0x0000e6b8 ldr r0, [sp, 8] | r0 = dest;
0x0000e6bc add r0, r0, 2 | r0 += 2;
0x0000e6c0 b 0xe410 | goto label_2;
| label_7:
0x0000e6c4 bl 0xa708 | lws_hdr_simple_ptr ();
0x0000e6c8 ldr r1, [pc, 0x48] | r1 = lws_finalize_startup;
0x0000e6cc add r1, pc, r1 | r1 = pc + r1;
0x0000e6d0 mov r2, r0 | r2 = r0;
0x0000e6d4 b 0xe53c | goto label_3;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libwebsockets.so.12 @ 0x6244 */
| #include <stdint.h>
|
; (fcn) sym.lwsl_hexdump_level () | void lwsl_hexdump_level (int32_t arg1, int32_t arg2) {
| char * format;
| char * var_8h;
| int32_t var_ch;
| char * s;
| int32_t var_64h;
| r0 = arg1;
| r1 = arg2;
0x00006244 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00006248 sub sp, sp, 0x64 |
0x0000624c mov r7, r0 | r7 = r0;
0x00006250 mov sl, r1 | sl = r1;
0x00006254 mov r8, r2 | r8 = r2;
0x00006258 bl 0x46b4 | r0 = fcn_000046b4 ();
0x0000625c cmp r0, 0 |
| if (r0 != 0) {
0x00006260 beq 0x62a8 |
0x00006264 ldr r1, [pc, 0x180] | r1 = *(0x63e8);
0x00006268 mov r0, r7 | r0 = r7;
0x0000626c add r1, pc, r1 | r1 = pc + r1;
0x00006270 bl 0x4c24 | fcn_00004c24 ();
0x00006274 ldr r3, [pc, 0x174] | r3 = *(0x63ec);
0x00006278 mov r5, 0 | r5 = 0;
0x0000627c add r3, pc, r3 | r3 = pc + r3;
0x00006280 str r3, [sp, 4] | format = r3;
0x00006284 ldr r3, [pc, 0x168] | r3 = *(0x63f0);
0x00006288 add r3, pc, r3 | r3 = pc + r3;
0x0000628c str r3, [sp, 8] | var_8h = r3;
| label_2:
0x00006290 cmp r8, r5 |
| if (r8 > r5) {
0x00006294 bhi 0x62b0 | goto label_4;
| }
0x00006298 ldr r1, [pc, 0x158] | r1 = *(0x63f4);
0x0000629c mov r0, r7 | r0 = r7;
0x000062a0 add r1, pc, r1 | r1 = pc + r1;
0x000062a4 bl 0x4c24 | fcn_00004c24 ();
| }
0x000062a8 add sp, sp, 0x64 |
0x000062ac pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_4:
0x000062b0 add sb, sp, 0x10 | sb += s;
0x000062b4 mov r2, r5 | r2 = r5;
0x000062b8 ldr r1, [sp, 4] | r1 = format;
0x000062bc mov r0, sb | r0 = sb;
0x000062c0 bl 0x4c18 | sprintf (r0, r1, r2);
0x000062c4 mov r6, 0 | r6 = 0;
0x000062c8 add r4, sl, r5 | r4 = sl + r5;
0x000062cc add r3, sb, r0 | r3 = sb + r0;
| do {
0x000062d0 cmp r6, 0xf |
0x000062d4 add fp, r5, r6 |
| if (r6 > 0xf) {
0x000062d8 movls r2, 1 | r2 = 1;
| }
| if (r6 <= 0xf) {
0x000062dc movhi r2, 0 | r2 = 0;
| }
0x000062e0 cmp r8, fp |
| if (r8 > fp) {
0x000062e4 movls r2, 0 | r2 = 0;
| }
0x000062e8 cmp r2, 0 |
| if (r2 == 0) {
0x000062ec bne 0x6350 |
0x000062f0 ldr r2, [pc, 0x104] | r2 = *(0x63f8);
0x000062f4 add r2, pc, r2 | r2 = pc + r2;
| label_0:
0x000062f8 cmp r6, 0xf |
0x000062fc add r4, r3, 3 | r4 = r3 + 3;
| if (r6 < 0xf) {
0x00006300 bls 0x6374 | goto label_5;
| }
0x00006304 ldr r1, [pc, 0xf4] | r1 = *(0x63fc);
0x00006308 mov r0, r3 | r0 = r3;
0x0000630c add r1, pc, r1 | r1 = pc + r1;
0x00006310 bl 0x4570 | strcpy (r0, r1)
0x00006314 sub r1, r8, r5 | r1 = r8 - r5;
0x00006318 mov r3, 0 | r3 = 0;
0x0000631c add r5, sl, r5 | r5 = sl + r5;
0x00006320 mov r0, 0x2e | r0 = 0x2e;
| label_1:
0x00006324 cmp r1, r3 |
| if (r1 != r3) {
0x00006328 bne 0x6394 | goto label_6;
| }
0x0000632c mov r2, r4 | r2 = r4;
0x00006330 sub r0, r3, r4 | r0 = r3 - r4;
0x00006334 mov ip, 0x20 |
| label_3:
0x00006338 add r1, r2, r0 | r1 = r2 + r0;
0x0000633c cmp r1, 0xf |
| if (r1 < 0xf) {
0x00006340 bls 0x63e4 | goto label_7;
| }
0x00006344 rsb r3, r3, 0x10 | r3 = 0x10 - r3;
0x00006348 add r4, r4, r3 | r4 += r3;
0x0000634c b 0x63b8 | goto label_8;
| }
0x00006350 ldrb r2, [r4, r6] | r2 = *((r4 + r6));
0x00006354 mov r0, r3 | r0 = r3;
0x00006358 ldr r1, [sp, 8] | r1 = var_8h;
0x0000635c str r3, [sp, 0xc] | var_ch = r3;
0x00006360 bl 0x4c18 | sprintf (r0, r1, r2);
0x00006364 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00006368 add r6, r6, 1 | r6++;
0x0000636c add r3, r3, 3 | r3 += 3;
0x00006370 b 0x62d0 |
| } while (1);
| label_5:
0x00006374 mov r1, r2 | r1 = r2;
0x00006378 mov r0, r3 | r0 = r3;
0x0000637c str r2, [sp, 0xc] | var_ch = r2;
0x00006380 add r6, r6, 1 | r6++;
0x00006384 bl 0x4570 | strcpy (r0, r1)
0x00006388 mov r3, r4 | r3 = r4;
0x0000638c ldr r2, [sp, 0xc] | r2 = var_ch;
0x00006390 b 0x62f8 | goto label_0;
| label_6:
0x00006394 ldrb r2, [r5, r3] | r2 = *((r5 + r3));
0x00006398 add r4, r4, 1 | r4++;
0x0000639c sub ip, r2, 0x20 |
0x000063a0 cmp ip, 0x5e |
0x000063a4 add r3, r3, 1 | r3++;
| if (ip > 0x5e) {
0x000063a8 strbls r2, [r4, -1] | *((r4 - 1)) = r2;
| }
| if (ip <= 0x5e) {
0x000063ac strbhi r0, [r4, -1] | *((r4 - 1)) = r0;
| }
0x000063b0 cmp r3, 0x10 |
| if (r3 != 0x10) {
0x000063b4 bne 0x6324 | goto label_1;
| }
| label_8:
0x000063b8 ldr r1, [pc, 0x44] | r1 = *(0x6400);
0x000063bc mov r3, 0xa | r3 = 0xa;
0x000063c0 strb r3, [r4] | *(r4) = r3;
0x000063c4 mov r3, 0 | r3 = 0;
0x000063c8 strb r3, [r4, 1] | *((r4 + 1)) = r3;
0x000063cc mov r2, sb | r2 = sb;
0x000063d0 add r1, pc, r1 | r1 = pc + r1;
0x000063d4 mov r0, r7 | r0 = r7;
0x000063d8 bl 0x4c24 | fcn_00004c24 ();
0x000063dc mov r5, fp | r5 = fp;
0x000063e0 b 0x6290 | goto label_2;
| label_7:
0x000063e4 strb ip, [r2], 1 | *(r2) = ip;
| r2++;
0x000063e8 b 0x6338 | goto label_3;
| }
[*] Function strcpy used 11 times libwebsockets.so.12