// // This file was generated by the Retargetable Decompiler // Website: https://retdec.com // Copyright (c) 2020 Retargetable Decompiler // #include #include #include #include #include #include #include // ----------------- Float Types Definitions ------------------ typedef float float32_t; typedef double float64_t; // ------------------- Function Prototypes -------------------- void _24_a(void); int32_t _24_d(void); int32_t __data_start(int32_t result); int32_t __do_global_dtors_aux(void); int32_t __libc_csu_fini(void); int32_t __libc_csu_init(int32_t result, int32_t a2, int32_t a3, int32_t a4); int32_t _doEncrypt(int32_t flag, int32_t wgLng, int32_t wgLat, int32_t wgHeight, int32_t wgWeek, int32_t wgTime, int32_t * chainLng, int32_t * chainLat); int32_t _fini(int32_t result, int32_t a2, int32_t a3, int32_t a4); int32_t _init(int32_t a1, int32_t a2, int32_t a3, int32_t a4); int32_t _start(int32_t a1, int32_t a2); int32_t call_weak_fn(void); int32_t deregister_tm_clones(void); float64_t Elev_Inter(float64_t x, float64_t y); void EncrpytIni(int32_t iValue, int32_t uiSJ, int32_t uiLon, int32_t uiLat); float64_t EncrpytLonLatA(float64_t dLon, float64_t dLat); float64_t EncrpytLonLatB(float64_t dLon, float64_t dLat); float64_t encrpytTL(float64_t dInput); float64_t EncryptHX(float64_t dX, float64_t dY); float64_t EncryptHY(float64_t dX, float64_t dY); float64_t EncryptRn(int32_t wg_time); int32_t frame_dummy(int32_t a1, int32_t a2, int32_t a3, int32_t a4); int32_t function_10bc8(int32_t * handle); char * function_10bd4(char * dest, char * src); int32_t * function_10be0(char * file, int32_t mode); int32_t function_10bec(int32_t main2, int32_t argc, char ** ubp_av, void (*init)(), void (*fini)(), void (*rtld_fini)()); void function_10bf8(void); char * function_10c04(char * buf, int32_t size); float64_t function_10c10(float64_t a1); int32_t function_10c1c(char * s); float64_t function_10c28(float64_t a1); void function_10c34(void); int32_t * function_10c40(int32_t * handle, char * name); float64_t function_10c4c(float64_t a1); int32_t function_11180(void); int32_t function_113a4(int32_t result, int32_t a2, int32_t a3); int32_t function_115d8(void); int32_t function_117d4(int32_t result); int32_t function_117e8(void); int32_t function_11874(int32_t result, int32_t a2, uint32_t a3); int32_t function_1193a(void); int32_t function_119a4(int32_t result); int32_t function_11b6c(int32_t result); int32_t function_11f74(int32_t result); int32_t function_11f88(void); int32_t function_11f98(void); int32_t function_11fb0(void); int32_t function_174acb0(void); int32_t function_174aec0(void); int32_t function_23060(int32_t a1); int32_t function_23074(void); int32_t function_23094(void); int32_t function_230a8(void); int32_t function_fe3e1926(void); float64_t getYuValue(float64_t dValue, float64_t dN); float64_t getZJValue(float64_t dx); int32_t GpsPlugin_encrypt(int32_t flag, int32_t wgLng, int32_t wgLat, int32_t wgHeight, int32_t wgWeek, int32_t wgTime, int32_t * chinaLng, int32_t * chinaLat); int32_t JudgeSD(float64_t wg_lng, float64_t wg_lat); int32_t register_tm_clones(int32_t * a1); float64_t ToPow(float64_t dX, int32_t n); int32_t wgtochina_lb(int32_t wg_flag, int32_t wg_lng, int32_t wg_lat, int32_t wg_heit, int32_t wg_week, int32_t wg_time, int32_t * china_lng, int32_t * china_lat); // --------------------- Global Variables --------------------- int32_t g1 = 0; // apsr_nzcv bool g2 = false; // cpsr_n bool g3 = false; // cpsr_v bool g4 = false; // cpsr_z float64_t g5 = 0.0; // d0 float64_t g6 = 0.0; // d1 float64_t g7 = 0.0; // d8 float64_t g8 = 0.0; // d9 int32_t g9 = 0; // fpscr char * g10; int32_t g11 = 0x10d15; int32_t g12 = 0; int32_t g13 = 1; int32_t g16 = 2; int32_t g17 = 0; int32_t g18; // 0x23048 int32_t g19; // 0x2304c int32_t g21 = 0; float64_t g23 = 3.9552303956167904e-309; // 0x2305c int64_t * g24 = (int64_t *)0x2d818; // 0x23060 int32_t g26 = 0; char * g27; float64_t m_EncryAir = 0.0; float64_t m_EncryLatA = 0.0; float64_t m_EncryLatB = 0.0; int32_t m_EncrySW = 0; int32_t g28 = 0; // r0 int32_t g29 = 0; // r2 int32_t g30 = 0; // r4 int32_t g31 = 0; // r7 int32_t g32; int32_t * g14 = &g13; float64_t * g15 = &m_EncryAir; float64_t * g20 = &m_EncryLatA; int32_t * g22 = &m_EncrySW; float64_t * g25 = &m_EncryLatB; // ------------------------ Functions ------------------------- // Address range: 0x10b9c - 0x10ba8 int32_t _init(int32_t a1, int32_t a2, int32_t a3, int32_t a4) { // 0x10b9c g28 = a1; return call_weak_fn(); } // Address range: 0x10bbc - 0x10bc8 void _24_a(void) { // 0x10bbc __stack_chk_fail(); } // Address range: 0x10bc8 - 0x10bd4 int32_t function_10bc8(int32_t * handle) { // 0x10bc8 return dlclose(handle); } // Address range: 0x10bd4 - 0x10be0 char * function_10bd4(char * dest, char * src) { // 0x10bd4 return strcpy(dest, src); } // Address range: 0x10be0 - 0x10bec int32_t * function_10be0(char * file, int32_t mode) { // 0x10be0 return dlopen(file, mode); } // Address range: 0x10bec - 0x10bf8 int32_t function_10bec(int32_t main2, int32_t argc, char ** ubp_av, void (*init)(), void (*fini)(), void (*rtld_fini)()) { // 0x10bec return __libc_start_main(main2, argc, ubp_av, init, fini, rtld_fini); } // Address range: 0x10bf8 - 0x10c04 void function_10bf8(void) { // 0x10bf8 __gmon_start__(); } // Address range: 0x10c04 - 0x10c10 char * function_10c04(char * buf, int32_t size) { // 0x10c04 return getcwd(buf, size); } // Address range: 0x10c10 - 0x10c1c float64_t function_10c10(float64_t a1) { // 0x10c10 return sin(a1); } // Address range: 0x10c1c - 0x10c28 int32_t function_10c1c(char * s) { // 0x10c1c return strlen(s); } // Address range: 0x10c28 - 0x10c34 float64_t function_10c28(float64_t a1) { // 0x10c28 return sqrt(a1); } // Address range: 0x10c34 - 0x10c40 void function_10c34(void) { // 0x10c34 abort(); } // Address range: 0x10c40 - 0x10c4c int32_t * function_10c40(int32_t * handle, char * name) { // 0x10c40 return dlsym(handle, name); } // Address range: 0x10c4c - 0x10c58 float64_t function_10c4c(float64_t a1) { // 0x10c4c return cos(a1); } // Address range: 0x10c58 - 0x10c7c int32_t _start(int32_t a1, int32_t a2) { // 0x10c58 int32_t v1; __libc_start_main(0x10d6d, a2, (char **)&v1, (void (*)())0x12001, (void (*)())0x10d6d, (void (*)())a1); abort(); // UNREACHABLE } // Address range: 0x10c7c - 0x10c80 int32_t _24_d(void) { // 0x10c7c return 61; } // Address range: 0x10c88 - 0x10ca4 int32_t call_weak_fn(void) { // 0x10c88 if (g21 == 0) { // bb return g28; } // 0x10ca0 __gmon_start__(); return &g32; } // Address range: 0x10cac - 0x10cca int32_t deregister_tm_clones(void) { // 0x10cc8 return (int32_t)&g27; } // Address range: 0x10cd0 - 0x10cfa int32_t register_tm_clones(int32_t * a1) { // 0x10cd0 return (int32_t)&g27; } // Address range: 0x10cfc - 0x10d14 int32_t __do_global_dtors_aux(void) { // 0x10cfc int32_t result; // 0x10d0a if (*(char *)&g27 == 0) { // 0x10d0a result = deregister_tm_clones(); *(char *)(int32_t)&g27 = 1; } // 0x10d12 return result; } // Address range: 0x10d14 - 0x10d38 int32_t frame_dummy(int32_t a1, int32_t a2, int32_t a3, int32_t a4) { // 0x10d22 return register_tm_clones(&g12); } // From module: /home/anjy/projs/AD/brain/source/main.cpp // Address range: 0x10d38 - 0x10d6c // Line range: 7 - 13 int32_t _doEncrypt(int32_t flag, int32_t wgLng, int32_t wgLat, int32_t wgHeight, int32_t wgWeek, int32_t wgTime, int32_t * chainLng, int32_t * chainLat) { int32_t v1; // bp-24 g31 = &v1; v1 = wgHeight; return GpsPlugin_encrypt(flag, wgLng, wgLat, wgHeight, wgWeek, wgTime, chainLng, chainLat); } // From module: /home/anjy/projs/AD/brain/source/main.cpp // Address range: 0x10d6c - 0x10e6a // Line range: 15 - 41 int main(int argc, char ** argv) { // 0x10d6c int32_t v1; // r4 int32_t v2 = v1; // bp-16 int32_t v3 = __asm_subw((int32_t)&v2, 2072); // 0x10d6e *(int32_t *)(v3 + 4) = argc; *(int32_t *)v3 = (int32_t)argv; int32_t * v4 = (int32_t *)(v3 + 2068); // 0x10d86 *v4 = *(int32_t *)g16; int32_t * v5 = (int32_t *)(v3 + 8); // 0x10d90 *v5 = 0; int32_t v6 = v3 + 12; // 0x10d92 int32_t * v7 = (int32_t *)v6; // 0x10d98 *v7 = 0; int32_t buf = __asm_addw(v3, 1044); // 0x10d9a int32_t v8 = v3 + 20; // 0x10daa char * str = (char *)v8; // 0x10db0 strcpy(str, getcwd((char *)buf, 1023)); int32_t v9 = strlen(str) + v8; // 0x10dc8 v1 = v9; *(int32_t *)v9 = 0x62696c2f; *(int32_t *)(v1 + 4) = 0x69617262; *(int32_t *)(v1 + 8) = 0x6f732e6e; *(char *)(v1 + 12) = *(char *)&g10; int32_t * v10 = dlopen(str, 257); // 0x10dec *(int32_t *)v6 = (int32_t)v10; int32_t v11; // 0x10e4e if (v10 == NULL) { v11 = -1; } else { int32_t * v12 = dlsym((int32_t *)*v7, "brain_main"); // 0x10e0e *(int32_t *)(v3 + 16) = (int32_t)v12; if (v12 == NULL) { v11 = -2; } else { // 0x10e2a *v5 = 0x10d37; dlclose((int32_t *)*v7); v11 = *v5; } } int32_t result = v11; // r0 if (*v4 != *(int32_t *)g16) { // 0x10e5e __stack_chk_fail(); result = &g32; } // 0x10e62 __asm_addw(v3, 2072); return result; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x10e80 - 0x11170 // Line range: 5382 - 5426 float64_t Elev_Inter(float64_t x, float64_t y) { int32_t cell_i[4]; // bp-44 int32_t cell_j[4]; // bp-28 int32_t v1[4]; // 0x10f66 int32_t v2[4]; // 0x10f94 // 0x10e80 int32_t v3; __asm_vstr(g5, v3); int32_t v4; // bp-136 __asm_vstr(g6, v4); int32_t v5 = *(int32_t *)g17; // 0x10e96 uint64_t v6 = *(int64_t *)__asm_adr(740); // 0x10e9c uint64_t v7 = *(int64_t *)__asm_adr(736); // 0x10ea6 int64_t v8 = *(int64_t *)__asm_adr(736); // 0x10eb0 cell_i = {0, 0, 0, 0}; bool v9 = false; // cpsr_n bool v10 = true; // cpsr_z cell_j = {0, 0, 0, 0}; float64_t v11 = __asm_vldr(v3); // 0x10ed4 int32_t v12 = v7 / 0x100000000; __asm_vcmpe_f64(v11, __asm_vldr(v12)); __asm_vmrs(g1, g9); int32_t v13; if (v9) { v13 = 0; goto lab_0x1114e; } else { float64_t v14 = __asm_vldr(v12); // 0x10ee6 float64_t v15 = __asm_vadd_f64(v14, __asm_vldr(0x4050752a)); // 0x10eee __asm_vcmpe_f64(v15, __asm_vldr(v3)); __asm_vmrs(g1, g9); if (v9) { v13 = 0; goto lab_0x1114e; } else { int32_t v16 = v8 / 0x100000000; float64_t v17 = __asm_vldr(v16); // 0x10f00 float64_t v18 = __asm_vsub_f64(v17, __asm_vldr(0x404b7fb7)); // 0x10f08 __asm_vcmpe_f64(v18, __asm_vldr(v4)); __asm_vmrs(g1, g9); if (v10 || v9 != g3) { float64_t v19 = __asm_vldr(v4); // 0x10f1a __asm_vcmpe_f64(v19, __asm_vldr(v16)); __asm_vmrs(g1, g9); if (v10 || v9 != g3) { float64_t v20 = __asm_vldr(v3); // 0x10f3a float64_t v21 = __asm_vsub_f64(v20, __asm_vldr(v12)); // 0x10f42 int32_t v22 = v6 / 0x100000000; float64_t v23 = __asm_vdiv_f64(v21, __asm_vldr(v22)); // 0x10f4a float64_t v24 = __asm_vsub_f64(v23, __asm_vmov_f64_2(0.5f)); // 0x10f52 float64_t v25 = __asm_vadd_f64(v24, __asm_vmov_f64_2(1.0f)); // 0x10f5a int32_t v26 = __asm_vmov_3(__asm_vcvt_u32_f64(v25)); // 0x10f62 v1[0] = v26; cell_i = v1; float64_t v27 = __asm_vldr(v16); // 0x10f68 float64_t v28 = __asm_vsub_f64(v27, __asm_vldr(v4)); // 0x10f70 float64_t v29 = __asm_vdiv_f64(v28, __asm_vldr(v22)); // 0x10f78 float64_t v30 = __asm_vsub_f64(v29, __asm_vmov_f64_2(0.5f)); // 0x10f80 float64_t v31 = __asm_vadd_f64(v30, __asm_vmov_f64_2(1.0f)); // 0x10f88 int32_t v32 = __asm_vmov_3(__asm_vcvt_u32_f64(v31)); // 0x10f90 v2[0] = v32; cell_j = v2; int32_t v33 = cell_i[0]; // 0x10f96 float64_t v34 = __asm_vcvt_f64_u32(__asm_vmov(v33 - 1)); // 0x10fbe float64_t v35 = __asm_vmul_f64(v34, __asm_vldr(v22)); // 0x10fc6 float64_t v36 = __asm_vldr(v12); // 0x10fca float64_t v37; __asm_vstr(__asm_vadd_f64(v35, v36), (int32_t)(float32_t)v37); float64_t v38 = __asm_vcvt_f64_u32(__asm_vmov(cell_j[0] - 1)); // 0x10fde float64_t v39 = __asm_vmul_f64(v38, __asm_vldr(v22)); // 0x10fe6 float64_t v40 = __asm_vldr(v16); // 0x10fea float64_t v41; __asm_vstr(__asm_vsub_f64(v40, v39), (int32_t)(float32_t)v41); float64_t v42 = __asm_vldr(v3); // 0x10ff6 float64_t v43 = __asm_vldr((int32_t)(float32_t)v37); // 0x10ffa float64_t v44; __asm_vstr(__asm_vsub_f64(v42, v43), (int32_t)(float32_t)v44); float64_t v45 = __asm_vldr((int32_t)(float32_t)v41); // 0x11006 float64_t v46 = __asm_vldr(v4); // 0x1100a float64_t v47; __asm_vstr(__asm_vsub_f64(v45, v46), (int32_t)(float32_t)v47); int32_t v48 = *(int32_t *)((int32_t)&g14 + 72); // 0x11026 float64_t v49 = __asm_vldr(*(int32_t *)(v48 + 8 * (80 * cell_j[0] - 80 + v33))); // 0x1102c float64_t v50 = __asm_vldr(v22); // 0x11030 float64_t v51 = __asm_vldr((int32_t)(float32_t)v44); // 0x11034 float64_t v52 = __asm_vmul_f64(v49, __asm_vsub_f64(v50, v51)); // 0x1103c float64_t v53 = __asm_vldr(v22); // 0x11040 float64_t v54 = __asm_vldr((int32_t)(float32_t)v47); // 0x11044 float64_t v55 = __asm_vmul_f64(v52, __asm_vsub_f64(v53, v54)); // 0x1104c float64_t v56 = __asm_vldr(v22); // 0x11050 float64_t v57 = __asm_vmul_f64(v56, __asm_vldr(v22)); // 0x11058 float64_t v58; __asm_vstr(__asm_vdiv_f64(v55, v57), (int32_t)(float32_t)v58); int32_t v59 = 80 * cell_j[0]; float64_t v60 = __asm_vldr(*(int32_t *)(g18 + 8 * (v33 - 79 + v59))); // 0x1107a float64_t v61 = __asm_vmul_f64(v60, __asm_vldr((int32_t)(float32_t)v44)); // 0x11082 float64_t v62 = __asm_vldr(v22); // 0x11086 float64_t v63 = __asm_vldr((int32_t)(float32_t)v47); // 0x1108a float64_t v64 = __asm_vmul_f64(v61, __asm_vsub_f64(v62, v63)); // 0x11092 float64_t v65 = __asm_vldr(v22); // 0x11096 float64_t v66 = __asm_vldr(v22); // 0x1109a float64_t v67 = __asm_vdiv_f64(v64, __asm_vmul_f64(v65, v66)); // 0x110a2 float64_t v68 = __asm_vldr((int32_t)(float32_t)v58); // 0x110a6 __asm_vstr(__asm_vadd_f64(v68, v67), (int32_t)(float32_t)v58); float64_t v69 = __asm_vldr(*(int32_t *)(g18 + 8 * (v59 + v33))); // 0x110c8 float64_t v70 = __asm_vldr(v22); // 0x110cc float64_t v71 = __asm_vldr((int32_t)(float32_t)v44); // 0x110d0 float64_t v72 = __asm_vmul_f64(v69, __asm_vsub_f64(v70, v71)); // 0x110d8 float64_t v73 = __asm_vmul_f64(v72, __asm_vldr((int32_t)(float32_t)v47)); // 0x110e0 float64_t v74 = __asm_vldr(v22); // 0x110e4 float64_t v75 = __asm_vldr(v22); // 0x110e8 float64_t v76 = __asm_vdiv_f64(v73, __asm_vmul_f64(v74, v75)); // 0x110f0 float64_t v77 = __asm_vldr((int32_t)(float32_t)v58); // 0x110f4 __asm_vstr(__asm_vadd_f64(v77, v76), (int32_t)(float32_t)v58); float64_t v78 = __asm_vldr(*(int32_t *)(g18 + 8 * (v59 + v33 + 1))); // 0x11116 float64_t v79 = __asm_vmul_f64(v78, __asm_vldr((int32_t)(float32_t)v44)); // 0x1111e float64_t v80 = __asm_vmul_f64(v79, __asm_vldr((int32_t)(float32_t)v47)); // 0x11126 float64_t v81 = __asm_vldr(v22); // 0x1112a float64_t v82 = __asm_vldr(v22); // 0x1112e float64_t v83 = __asm_vdiv_f64(v80, __asm_vmul_f64(v81, v82)); // 0x11136 float64_t v84 = __asm_vldr((int32_t)(float32_t)v58); // 0x1113a __asm_vstr(__asm_vadd_f64(v84, v83), (int32_t)(float32_t)v58); v13 = (int64_t)v58 / 0x100000000; goto lab_0x1114e; } else { v13 = 0; goto lab_0x1114e; } } else { v13 = 0; goto lab_0x1114e; } } } lab_0x1114e: // 0x1114e __asm_vmov_f64(__asm_vmov_4(0, v13)); g29 = v5; int32_t v85; // 0x1116e if (v5 == *(int32_t *)g17) { // 0x1114e v85 = (float32_t)x; } else { // 0x11166 __stack_chk_fail(); v85 = &g32; } // 0x1116a return (int64_t)v85; } // Address range: 0x11180 - 0x11198 int32_t function_11180(void) { // 0x11180 bool v1; // cpsr_z bool v2 = v1; // 0x11180 bool v3; // cpsr_c bool v4; // cpsr_n bool v5; // cpsr_v bool v6; // 0x11188 if (v2 || v4 != v5) { // 0x11180 if (v3) { v6 = true; goto lab_bb185; } else { goto lab_bb184; } } else { bool v7 = v3; // 0x11180 int32_t v8; // r8 int32_t v9 = (int32_t)!v7 + 0x2d40000 - v8; // 0x11180 uint32_t v10 = v9 - (int32_t)!v7; // 0x11180 bool v11 = !v7 ? v8 != -1 | v10 > 0x2d40000 : v8 > 0x2d40000; // 0x11180 v3 = !v11; v4 = v9 < 0; v1 = v9 == 0; if (!v11) { v2 = v9 == 0; v6 = true; goto lab_bb185; } else { goto lab_bb184; } } lab_bb185:; int32_t result; // 0x11188 if (v6 == !v2) { // bb186 int32_t v12; // r7 result = *(int32_t *)(v12 - 4); } // bb187 if (v4) { // branch -> 0x11198 } // 0x11198 return result; lab_bb184: // bb184 __asm_svclo(0xeaaa64); v2 = v1; v6 = v3; goto lab_bb185; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x111a4 - 0x111ee // Line range: 5431 - 5435 float64_t getYuValue(float64_t dValue, float64_t dN) { // 0x111a4 g29 = (float32_t)dN; int32_t v1; // bp-24 int32_t v2 = &v1; // r7 uint64_t v3; int32_t v4 = v3; // 0x111aa __asm_vstr(g5, v4); __asm_vstr(g6, v1); float64_t v5 = __asm_vldr(v4); // 0x111b2 float64_t v6 = __asm_vdiv_f64(v5, __asm_vldr(v1)); // 0x111ba float64_t v7 = __asm_vcvt_f64_u32(__asm_vcvt_u32_f64(v6)); // 0x111c2 float64_t v8 = __asm_vmul_f64(v7, __asm_vldr(v1)); // 0x111ca float64_t v9 = __asm_vldr(v4); // 0x111ce __asm_vstr(__asm_vsub_f64(v9, v8), v4); __asm_vmov_f64(__asm_vmov_4((int32_t)(v3 / 0x100000000), v4)); int32_t v10 = v2 + 16; // 0x111e6 g3 = (v10 & -v2) < 0; g2 = v10 < 0; g4 = v10 == 0; return (int64_t)(int32_t)(float32_t)dValue; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x111f0 - 0x1123c // Line range: 5437 - 5448 float64_t ToPow(float64_t dX, int32_t n) { int32_t v1 = (float32_t)dX; // r0 uint64_t v2; int32_t v3 = v2; // 0x111f6 __asm_vstr(g5, v3); uint64_t v4 = v2 / 0x100000000; // 0x111fc int32_t v5 = v4; int32_t v6 = 1; while (v6 < v1) { // 0x11208 g29 = v6; float64_t v7 = __asm_vldr(v5); // 0x11210 float64_t v8 = __asm_vldr(v3); // 0x11214 __asm_vstr(__asm_vmul_f64(v7, v8), v5); v6++; } // 0x11228 __asm_vmov_f64(__asm_vmov_4(0, (int32_t)v4)); return (int64_t)v1; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x1123c - 0x113a4 // Line range: 5450 - 5483 float64_t encrpytTL(float64_t dInput) { int32_t v1 = g31; // 0x1123c __asm_vpush_5(g7); int64_t v2; // bp-40 g31 = &v2; __asm_vstr(g5, (int32_t)v2); __asm_vcmpe_f64_6(__asm_vldr((int32_t)v2), 0); __asm_vmrs(g1, g9); int32_t v3; v3 = 0; // 0x1126c g6 = __asm_vldr(0x401921fb); float64_t v4 = __asm_vldr((int32_t)v2); // 0x11270 g5 = v4; getYuValue(dInput, (float64_t)(int64_t)g29); uint64_t v5; int32_t v6 = v5; // 0x11278 __asm_vstr(v4, v6); float64_t v7 = __asm_vldr(v6); // 0x1127c __asm_vcmpe_f64(v7, __asm_vldr(0x400921fb)); __asm_vmrs(g1, g9); int32_t v8; if (!g4 && g2 == g3) { float64_t v9 = __asm_vldr(v6); // 0x1128e float64_t v10 = __asm_vldr(0x400921fb); // 0x11292 __asm_vstr(__asm_vsub_f64(v9, v10), v6); if (v3 == 0) { v8 = 1; } else { v8 = 0; } } else { v8 = v3; } int64_t v11 = v5 / 0x100000000; // 0x112ae v2 = v11; float64_t v12 = __asm_vldr((int32_t)v11); // 0x112b8 g5 = v12; ToPow(1.4821969375237396e-323, g29); float64_t v13 = __asm_vmov_f64(v12); // 0x112c0 float64_t v14 = __asm_vdiv_f64(v13, __asm_vmov_f64_2(6.0f)); // 0x112c8 float64_t v15 = __asm_vsub_f64(__asm_vldr((int32_t)v2), v14); // 0x112d0 float64_t v16 = __asm_vldr((int32_t)v2); // 0x112d6 g5 = v16; ToPow(2.4703282292062327e-323, g29); float64_t v17 = __asm_vmov_f64(v16); // 0x112de float64_t v18 = __asm_vldr(0x405e0000); // 0x112e2 float64_t v19 = __asm_vadd_f64(v15, __asm_vdiv_f64(v17, v18)); // 0x112ea float64_t v20 = __asm_vldr((int32_t)v2); // 0x112f0 g5 = v20; ToPow(3.4584595208887258e-323, g29); float64_t v21 = __asm_vmov_f64(v20); // 0x112f8 float64_t v22 = __asm_vldr(0x40b3b000); // 0x112fc float64_t v23 = __asm_vsub_f64(v19, __asm_vdiv_f64(v21, v22)); // 0x11304 float64_t v24 = __asm_vldr((int32_t)v2); // 0x1130a g5 = v24; ToPow(4.4465908125712189e-323, g29); float64_t v25 = __asm_vmov_f64(v24); // 0x11312 float64_t v26 = __asm_vdiv_f64(v25, __asm_vldr(0x41162600)); // 0x1131a __asm_vstr(__asm_vadd_f64(v23, v26), (int32_t)v2); float64_t v27 = __asm_vldr((int32_t)v2); // 0x11328 g5 = v27; ToPow(5.434722104253712e-323, g29); float64_t v28 = __asm_vmov_f64(v27); // 0x11330 float64_t v29 = __asm_vdiv_f64(v28, __asm_vldr(0x418308a8)); // 0x11338 float64_t v30 = __asm_vsub_f64(__asm_vldr((int32_t)v2), v29); // 0x11340 float64_t v31 = __asm_vldr((int32_t)v2); // 0x11346 g5 = v31; ToPow(6.4228533959362051e-323, g29); float64_t v32 = __asm_vmov_f64(v31); // 0x1134e float64_t v33 = __asm_vldr(0x41f7328c); // 0x11352 float64_t v34 = __asm_vadd_f64(v30, __asm_vdiv_f64(v32, v33)); // 0x1135a float64_t v35 = __asm_vldr((int32_t)v2); // 0x11360 g5 = v35; int32_t v36 = (float32_t)ToPow(7.4109846876186982e-323, g29); // r0 float64_t v37 = __asm_vmov_f64(v35); // 0x11368 float64_t v38 = __asm_vdiv_f64(v37, __asm_vldr(0x42730777)); // 0x11370 __asm_vstr(__asm_vsub_f64(v34, v38), (int32_t)v2); if (v8 == 1) { float64_t v39 = __asm_vldr((int32_t)v2); // 0x11382 __asm_vstr(__asm_vneg_f64(v39), (int32_t)v2); } __asm_vmov_f64(__asm_vmov_4((int32_t)(v2 / 0x100000000), (int32_t)v2)); g7 = __asm_vpop_7(v34); g31 = v1; return (int64_t)v36; } // Address range: 0x113a4 - 0x113ac int32_t function_113a4(int32_t result, int32_t a2, int32_t a3) { // 0x113a4 bool v1; // cpsr_c bool v2; // cpsr_z if (v1 == !v2) { // bb return result; } // 0x113a8 bool v3; // cpsr_n if (!v3) { // bb176 int32_t v4; // r4 *(char *)v4 = (char)a3; } // bb177 return result; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x113e8 - 0x115c8 // Line range: 5485 - 5501 float64_t EncrpytLonLatA(float64_t dLon, float64_t dLat) { // 0x113e8 g29 = (float32_t)dLat; int32_t v1 = g30; // 0x113e8 int32_t v2 = g31; // 0x113e8 __asm_vpush_5(g7); int64_t v3; // bp-56 g31 = &v3; float64_t v4; __asm_vstr(g5, (int32_t)(float32_t)v4); __asm_vstr(g6, (int32_t)v3); g30 = v3; float64_t v5 = __asm_vldr((int32_t)(float32_t)v4); // 0x1140a float64_t v6 = __asm_vadd_f64(v5, __asm_vldr(0x4072c000)); // 0x11412 float64_t v7 = __asm_vldr((int32_t)v3); // 0x11416 float64_t v8 = __asm_vadd_f64(v6, __asm_vadd_f64(v7, v7)); // 0x1141e float64_t v9 = __asm_vldr((int32_t)(float32_t)v4); // 0x11422 float64_t v10 = __asm_vldr((int32_t)(float32_t)v4); // 0x11426 float64_t v11 = __asm_vmov_f64(__asm_vmul_f64(v9, v10)); // 0x1142e float64_t v12 = sqrt(dLon); // 0x11432 float64_t v13 = __asm_vmov_f64(__asm_vmov_f64(v11)); // 0x1143a float64_t v14 = sqrt(v12); // 0x1143e float64_t v15 = __asm_vmov_f64(v13); // 0x11442 float64_t v16 = __asm_vmov_f64_2(10.0f); // 0x11446 float64_t v17 = __asm_vadd_f64(v8, __asm_vdiv_f64(v15, v16)); // 0x1144e float64_t v18 = __asm_vldr((int32_t)(float32_t)v4); // 0x11452 float64_t v19 = __asm_vmul_f64(v18, __asm_vldr((int32_t)(float32_t)v4)); // 0x1145a float64_t v20 = __asm_vmov_f64_2(10.0f); // 0x1145e float64_t v21 = __asm_vadd_f64(v17, __asm_vdiv_f64(v19, v20)); // 0x11466 float64_t v22 = __asm_vldr((int32_t)(float32_t)v4); // 0x1146a float64_t v23 = __asm_vmul_f64(v22, __asm_vldr((int32_t)v3)); // 0x11472 float64_t v24 = __asm_vdiv_f64(v23, __asm_vmov_f64_2(10.0f)); // 0x1147a uint64_t v25; int32_t v26 = v25; // 0x11482 __asm_vstr(__asm_vadd_f64(v21, v24), v26); float64_t v27 = __asm_vldr((int32_t)(float32_t)v4); // 0x11486 float64_t v28 = __asm_vmul_f64(v27, __asm_vmov_f64_2(6.0f)); // 0x1148e float64_t v29 = __asm_vldr(0x400921fb); // 0x11492 float64_t v30 = __asm_vmov_f64(__asm_vmul_f64(v28, v29)); // 0x1149a float64_t v31 = sin(v14); // 0x1149e float64_t v32 = __asm_vmov_f64(v30); // 0x114a2 float64_t v33 = __asm_vmul_f64(v32, __asm_vldr(0x402aaaab)); // 0x114aa float64_t v34 = __asm_vadd_f64(v33, __asm_vldr(v26)); // 0x114b2 g7 = v34; float64_t v35 = __asm_vldr((int32_t)(float32_t)v4); // 0x114b6 float64_t v36 = __asm_vadd_f64(v35, v35); // 0x114ba float64_t v37 = __asm_vldr(0x400921fb); // 0x114be float64_t v38 = __asm_vmov_f64(__asm_vmul_f64(v36, v37)); // 0x114c6 g5 = v38; float64_t v39 = encrpytTL(v31); // 0x114ca float64_t v40 = __asm_vmov_f64(v38); // 0x114ce float64_t v41 = __asm_vmul_f64(v40, __asm_vldr(0x402aaaab)); // 0x114d6 __asm_vstr(__asm_vadd_f64(v34, v41), v26); float64_t v42 = __asm_vldr((int32_t)(float32_t)v4); // 0x114e2 float64_t v43 = __asm_vldr(0x400921fb); // 0x114e6 float64_t v44 = __asm_vmov_f64(__asm_vmul_f64(v42, v43)); // 0x114ee float64_t v45 = sin(v39); // 0x114f2 float64_t v46 = __asm_vmov_f64(v44); // 0x114f6 float64_t v47 = __asm_vmul_f64(v46, __asm_vmov_f64_2(20.0f)); // 0x114fe float64_t v48 = __asm_vldr((int32_t)(float32_t)v4); // 0x11502 float64_t v49 = __asm_vmul_f64(v48, __asm_vldr(0x400921fb)); // 0x1150a float64_t v50 = __asm_vmov_f64_2(3.0f); // 0x1150e float64_t v51 = __asm_vmov_f64(__asm_vdiv_f64(v49, v50)); // 0x11516 float64_t v52 = sin(v45); // 0x1151a float64_t v53 = __asm_vmov_f64(v51); // 0x1151e float64_t v54 = __asm_vldr(0x40440000); // 0x11522 float64_t v55 = __asm_vadd_f64(v47, __asm_vmul_f64(v53, v54)); // 0x1152a float64_t v56 = __asm_vadd_f64(v55, v55); // 0x1152e float64_t v57 = __asm_vdiv_f64(v56, __asm_vmov_f64_2(3.0f)); // 0x11536 float64_t v58 = __asm_vldr(v26); // 0x1153a __asm_vstr(__asm_vadd_f64(v58, v57), v26); float64_t v59 = __asm_vldr((int32_t)(float32_t)v4); // 0x11546 float64_t v60 = __asm_vmul_f64(v59, __asm_vldr(0x400921fb)); // 0x1154e float64_t v61 = __asm_vmov_f64_2(12.0f); // 0x11552 float64_t v62 = __asm_vmov_f64(__asm_vdiv_f64(v60, v61)); // 0x1155a float64_t v63 = sin(v52); // 0x1155e float64_t v64 = __asm_vmov_f64(v62); // 0x11562 float64_t v65 = __asm_vmul_f64(v64, __asm_vldr(0x4062c000)); // 0x1156a float64_t v66 = __asm_vldr((int32_t)(float32_t)v4); // 0x1156e float64_t v67 = __asm_vmul_f64(v66, __asm_vldr(0x400921fb)); // 0x11576 float64_t v68 = __asm_vmov_f64_2(30.0f); // 0x1157a float64_t v69 = __asm_vmov_f64(__asm_vdiv_f64(v67, v68)); // 0x11582 int32_t v70 = (float32_t)sin(v63); // r0 float64_t v71 = __asm_vmov_f64(v69); // 0x1158a float64_t v72 = __asm_vldr(0x4072c000); // 0x1158e float64_t v73 = __asm_vadd_f64(v65, __asm_vmul_f64(v71, v72)); // 0x11596 float64_t v74 = __asm_vadd_f64(v73, v73); // 0x1159a float64_t v75 = __asm_vdiv_f64(v74, __asm_vmov_f64_2(3.0f)); // 0x115a2 float64_t v76 = __asm_vldr(v26); // 0x115a6 __asm_vstr(__asm_vadd_f64(v76, v75), v26); __asm_vmov_f64(__asm_vmov_4((int32_t)(v25 / 0x100000000), v26)); g7 = __asm_vpop_7(v65); g30 = v1; g31 = v2; return (int64_t)v70; } // Address range: 0x115d8 - 0x115dc int32_t function_115d8(void) { // 0x115d8 bool v1; // cpsr_c bool v2; // cpsr_z int32_t result; // 0x115d8 if (v1 == !v2) { // bb result = function_174acb0(); } else { // 0x115d8 result = g28; } // 0x115dc return result; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x115f0 - 0x117d4 // Line range: 5503 - 5517 float64_t EncrpytLonLatB(float64_t dLon, float64_t dLat) { // 0x115f0 g29 = (float32_t)dLat; int32_t v1 = g31; // 0x115f0 __asm_vpush_5(g7); int32_t v2; // bp-40 g31 = &v2; float64_t v3; __asm_vstr(g5, (int32_t)(float32_t)v3); __asm_vstr(g6, v2); float64_t v4 = __asm_vldr((int32_t)(float32_t)v3); // 0x11602 float64_t v5 = __asm_vadd_f64(v4, v4); // 0x11606 float64_t v6 = __asm_vsub_f64(v5, __asm_vldr(0x40590000)); // 0x1160e float64_t v7 = __asm_vldr(v2); // 0x11612 float64_t v8 = __asm_vmov_f64_2(3.0f); // 0x11616 float64_t v9 = __asm_vadd_f64(v6, __asm_vmul_f64(v7, v8)); // 0x1161e float64_t v10 = __asm_vldr((int32_t)(float32_t)v3); // 0x11622 float64_t v11 = __asm_vldr((int32_t)(float32_t)v3); // 0x11626 float64_t v12 = __asm_vmov_f64(__asm_vmul_f64(v10, v11)); // 0x1162e float64_t v13 = sqrt(dLon); // 0x11632 float64_t v14 = __asm_vmov_f64(__asm_vmov_f64(v12)); // 0x1163a float64_t v15 = sqrt(v13); // 0x1163e float64_t v16 = __asm_vmov_f64(v14); // 0x11642 float64_t v17 = __asm_vadd_f64(v16, v16); // 0x11646 float64_t v18 = __asm_vmov_f64_2(10.0f); // 0x1164a float64_t v19 = __asm_vadd_f64(v9, __asm_vdiv_f64(v17, v18)); // 0x11652 float64_t v20 = __asm_vldr(v2); // 0x11656 float64_t v21 = __asm_vadd_f64(v20, v20); // 0x1165a float64_t v22 = __asm_vmul_f64(v21, __asm_vldr(v2)); // 0x11662 float64_t v23 = __asm_vmov_f64_2(10.0f); // 0x11666 float64_t v24 = __asm_vadd_f64(v19, __asm_vdiv_f64(v22, v23)); // 0x1166e float64_t v25 = __asm_vldr((int32_t)(float32_t)v3); // 0x11672 float64_t v26 = __asm_vmul_f64(v25, __asm_vldr(v2)); // 0x1167a float64_t v27 = __asm_vdiv_f64(v26, __asm_vmov_f64_2(10.0f)); // 0x11682 uint64_t v28; int32_t v29 = v28; // 0x1168a __asm_vstr(__asm_vadd_f64(v24, v27), v29); float64_t v30 = __asm_vldr((int32_t)(float32_t)v3); // 0x1168e float64_t v31 = __asm_vmul_f64(v30, __asm_vmov_f64_2(6.0f)); // 0x11696 float64_t v32 = __asm_vldr(0x400921fb); // 0x1169a float64_t v33 = __asm_vmov_f64(__asm_vmul_f64(v31, v32)); // 0x116a2 float64_t v34 = sin(v15); // 0x116a6 float64_t v35 = __asm_vmov_f64(v33); // 0x116aa float64_t v36 = __asm_vmul_f64(v35, __asm_vldr(0x402aaaab)); // 0x116b2 float64_t v37 = __asm_vadd_f64(v36, __asm_vldr(v29)); // 0x116ba g7 = v37; float64_t v38 = __asm_vldr((int32_t)(float32_t)v3); // 0x116be float64_t v39 = __asm_vadd_f64(v38, v38); // 0x116c2 float64_t v40 = __asm_vldr(0x400921fb); // 0x116c6 float64_t v41 = __asm_vmov_f64(__asm_vmul_f64(v39, v40)); // 0x116ce g5 = v41; float64_t v42 = encrpytTL(v34); // 0x116d2 float64_t v43 = __asm_vmov_f64(v41); // 0x116d6 float64_t v44 = __asm_vmul_f64(v43, __asm_vldr(0x402aaaab)); // 0x116de __asm_vstr(__asm_vadd_f64(v37, v44), v29); float64_t v45 = __asm_vldr(v2); // 0x116ea float64_t v46 = __asm_vldr(0x400921fb); // 0x116ee float64_t v47 = __asm_vmov_f64(__asm_vmul_f64(v45, v46)); // 0x116f6 float64_t v48 = sin(v42); // 0x116fa float64_t v49 = __asm_vmov_f64(v47); // 0x116fe float64_t v50 = __asm_vmul_f64(v49, __asm_vmov_f64_2(20.0f)); // 0x11706 float64_t v51 = __asm_vldr(v2); // 0x1170a float64_t v52 = __asm_vmul_f64(v51, __asm_vldr(0x400921fb)); // 0x11712 float64_t v53 = __asm_vmov_f64_2(3.0f); // 0x11716 float64_t v54 = __asm_vmov_f64(__asm_vdiv_f64(v52, v53)); // 0x1171e float64_t v55 = sin(v48); // 0x11722 float64_t v56 = __asm_vmov_f64(v54); // 0x11726 float64_t v57 = __asm_vldr(0x40440000); // 0x1172a float64_t v58 = __asm_vadd_f64(v50, __asm_vmul_f64(v56, v57)); // 0x11732 float64_t v59 = __asm_vadd_f64(v58, v58); // 0x11736 float64_t v60 = __asm_vdiv_f64(v59, __asm_vmov_f64_2(3.0f)); // 0x1173e float64_t v61 = __asm_vldr(v29); // 0x11742 __asm_vstr(__asm_vadd_f64(v61, v60), v29); float64_t v62 = __asm_vldr(v2); // 0x1174e float64_t v63 = __asm_vmul_f64(v62, __asm_vldr(0x400921fb)); // 0x11756 float64_t v64 = __asm_vmov_f64_2(12.0f); // 0x1175a float64_t v65 = __asm_vmov_f64(__asm_vdiv_f64(v63, v64)); // 0x11762 float64_t v66 = sin(v55); // 0x11766 float64_t v67 = __asm_vmov_f64(v65); // 0x1176a float64_t v68 = __asm_vmul_f64(v67, __asm_vldr(0x40740000)); // 0x11772 float64_t v69 = __asm_vdiv_f64(v68, __asm_vmov_f64_2(3.0f)); // 0x1177a float64_t v70 = __asm_vadd_f64(v69, __asm_vldr(v29)); // 0x11782 float64_t v71 = __asm_vldr(v2); // 0x11786 float64_t v72 = __asm_vmul_f64(v71, __asm_vldr(0x400921fb)); // 0x1178e float64_t v73 = __asm_vmov_f64_2(30.0f); // 0x11792 float64_t v74 = __asm_vmov_f64(__asm_vdiv_f64(v72, v73)); // 0x1179a int32_t v75 = (float32_t)sin(v66); // r0 float64_t v76 = __asm_vmov_f64(v74); // 0x117a2 float64_t v77 = __asm_vmul_f64(v76, __asm_vldr(0x40840000)); // 0x117aa float64_t v78 = __asm_vdiv_f64(v77, __asm_vmov_f64_2(3.0f)); // 0x117b2 __asm_vstr(__asm_vadd_f64(v70, v78), v29); __asm_vmov_f64(__asm_vmov_4((int32_t)(v28 / 0x100000000), v29)); g3 = (g31 + 28 & -g31) < 0; __asm_vpop_7(v70); g31 = v1; return (int64_t)v75; } // Address range: 0x117d4 - 0x117dc int32_t function_117d4(int32_t result) { // 0x117d4 bool v1; // cpsr_c bool v2; // cpsr_z if (v1 == !v2) { // bb return result; } // 0x117d8 return result; } // Address range: 0x117e8 - 0x117ec int32_t function_117e8(void) { // 0x117e8 bool v1; // cpsr_c bool v2; // cpsr_z int32_t result; // 0x117e8 if (v1 == !v2) { // bb result = function_174aec0(); } else { // 0x117e8 result = g28; } // 0x117ec return result; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x11808 - 0x11874 // Line range: 5519 - 5524 float64_t getZJValue(float64_t dx) { int32_t v1 = g31; // 0x11808 g7 = __asm_vpush_5(g7); float64_t dValue; // bp-32 g31 = &dValue; float64_t v2; __asm_vstr(g5, (int32_t)(float32_t)v2); float64_t v3 = __asm_vldr((int32_t)(float32_t)dValue); // 0x11816 float64_t v4 = __asm_vldr(0x3f91df46); // 0x1181a float64_t v5 = __asm_vmov_f64(__asm_vmul_f64(v3, v4)); // 0x11822 g5 = v5; float64_t v6 = encrpytTL(dx); // 0x11826 float64_t v7 = __asm_vmov_f64(v5); // 0x1182a float64_t v8 = __asm_vmul_f64(v7, __asm_vldr(0x3f7b6a8f)); // 0x11832 g7 = v8; float64_t v9 = __asm_vldr((int32_t)(float32_t)dValue); // 0x11836 float64_t v10 = __asm_vldr(0x3f91df46); // 0x1183a float64_t v11 = __asm_vmov_f64(__asm_vmul_f64(v9, v10)); // 0x11842 g5 = v11; int32_t v12 = (float32_t)encrpytTL(v6); // r0 float64_t v13 = __asm_vmul_f64(v8, __asm_vmov_f64(v11)); // 0x1184e float64_t v14 = __asm_vmov_f64_2(1.0f); // 0x11852 uint64_t v15; int32_t v16 = v15; // 0x1185a __asm_vstr(__asm_vsub_f64(v14, v13), v16); __asm_vmov_f64(__asm_vmov_4((int32_t)(v15 / 0x100000000), v16)); __asm_vpop_7(v8); g31 = v1; return (int64_t)v12; } // Address range: 0x11874 - 0x1187c int32_t function_11874(int32_t result, int32_t a2, uint32_t a3) { // 0x11874 bool v1; // cpsr_c bool v2; // cpsr_z if (v1 == !v2) { // bb return result; } // 0x11878 bool v3; // cpsr_n bool v4; // cpsr_v if (v3 == v4) { // branch -> bb177 } // bb177 return result; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x11888 - 0x11916 // Line range: 5526 - 5535 float64_t EncryptHX(float64_t dX, float64_t dY) { // 0x11888 g29 = (float32_t)dY; int32_t v1 = g30; // 0x11888 int32_t v2 = g31; // 0x11888 g7 = __asm_vpush(g7, g8); float64_t e; // bp-48 g31 = &e; float64_t v3; __asm_vstr(g5, (int32_t)(float32_t)v3); __asm_vstr(g6, (int32_t)(float32_t)e); g30 = (int32_t)*(int64_t *)__asm_adr(156); float64_t v4 = __asm_vldr((int32_t)(float32_t)v3); // 0x118a4 g5 = v4; float64_t v5 = getZJValue(dX); // 0x118a8 float64_t v6 = __asm_vmov_f64(__asm_vmov_f64(v4)); // 0x118b0 float64_t v7 = sqrt(v5); // 0x118b4 uint64_t v8; int32_t v9 = v8; // 0x118b8 __asm_vstr(v6, v9); float64_t v10 = __asm_vldr((int32_t)(float32_t)e); // 0x118bc float64_t v11 = __asm_vmul_f64(v10, __asm_vldr(0x40668000)); // 0x118c4 float64_t v12 = __asm_vldr(0x415854c1); // 0x118c8 float64_t v13 = __asm_vdiv_f64(v12, __asm_vldr(v9)); // 0x118d0 float64_t v14 = __asm_vldr((int32_t)(float32_t)v3); // 0x118d4 float64_t v15 = __asm_vldr(0x3f91df46); // 0x118d8 float64_t v16 = __asm_vmov_f64(__asm_vmul_f64(v14, v15)); // 0x118e0 int32_t v17 = (float32_t)cos(v7); // r0 float64_t v18 = __asm_vmul_f64(v13, __asm_vmov_f64(v16)); // 0x118ec float64_t v19 = __asm_vmul_f64(v18, __asm_vldr(0x400921fb)); // 0x118f4 __asm_vstr(__asm_vdiv_f64(v11, v19), v9); __asm_vmov_f64(__asm_vmov_4((int32_t)(v8 / 0x100000000), v9)); float64_t v20 = __asm_vpop(v11, v13); // 0x11910 g7 = v20; g8 = v20; g30 = v1; g31 = v2; return (int64_t)v17; } // Address range: 0x1193a - 0x1193e int32_t function_1193a(void) { // 0x1193a bool v1; // cpsr_v int32_t result; // 0x1193a if (v1) { // bb result = function_fe3e1926(); } else { // 0x1193a result = g28; } // 0x1193e return result; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x11940 - 0x119a4 // Line range: 5538 - 5547 float64_t EncryptHY(float64_t dX, float64_t dY) { // 0x11940 g29 = (float32_t)dY; int32_t v1 = g31; // 0x11940 g7 = __asm_vpush_5(g7); int32_t v2; // bp-40 g31 = &v2; float64_t v3; __asm_vstr(g5, (int32_t)(float32_t)v3); __asm_vstr(g6, v2); float64_t v4 = __asm_vldr((int32_t)(float32_t)v3); // 0x11952 g5 = v4; float64_t v5 = getZJValue(dX); // 0x11956 uint64_t v6; int32_t v7 = v6; // 0x1195a __asm_vstr(v4, v7); float64_t v8 = __asm_vldr(v2); // 0x1195e float64_t v9 = __asm_vmul_f64(v8, __asm_vldr(0x40668000)); // 0x11966 float64_t v10 = __asm_vmul_f64(v9, __asm_vldr(v7)); // 0x1196e float64_t v11 = __asm_vldr(v7); // 0x11972 int32_t v12 = (float32_t)sqrt(v5); // r0 float64_t v13 = __asm_vmul_f64(v10, __asm_vmov_f64(v11)); // 0x1197e float64_t v14 = __asm_vldr(0x4172fb4e); // 0x11982 __asm_vstr(__asm_vdiv_f64(v13, v14), v7); __asm_vmov_f64(__asm_vmov_4((int32_t)(v6 / 0x100000000), v7)); g7 = __asm_vpop_7(v10); g31 = v1; return (int64_t)v12; } // Address range: 0x119a4 - 0x119ac int32_t function_119a4(int32_t result) { // 0x119a4 bool v1; // cpsr_c bool v2; // cpsr_z if (v1 == !v2) { // bb return result; } // 0x119a8 return result; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x119b8 - 0x11b6a // Line range: 5550 - 5593 int32_t JudgeSD(float64_t wg_lng, float64_t wg_lat) { // 0x119b8 uint64_t v1; int32_t v2 = v1; // 0x119be __asm_vstr(g5, v2); int64_t v3; // bp-72 __asm_vstr(g6, (int32_t)v3); int32_t v4 = (int32_t)&g14; // r4 uint32_t v5 = *(int32_t *)*(int32_t *)((int32_t)&g14 + 92); // 0x119d2 uint32_t v6 = *(int32_t *)&g22; // 0x119d6 bool v7 = v5 == v6; // cpsr_z float64_t v8 = __asm_vcvt_f64_u32(__asm_vmov(v5 - v6)); // 0x119e0 float64_t v9 = __asm_vldr(0x408f4000); // 0x119e4 float64_t v10; __asm_vstr(__asm_vdiv_f64(v8, v9), (int32_t)(float32_t)v10); __asm_vcmpe_f64_6(__asm_vldr((int32_t)(float32_t)v10), 0); __asm_vmrs(g1, g9); if (v5 >= v6 != !v7) { int32_t v11 = *(int32_t *)&g22; // 0x11a06 *(int32_t *)v11 = (int32_t)(float32_t)g23; uint64_t v12 = *(int64_t *)*(int32_t *)(v4 + 96); // 0x11a0e int32_t v13 = *(int32_t *)(v4 + 76); // 0x11a14 *(int32_t *)v13 = (int32_t)(v12 / 0x100000000); *(int32_t *)(v13 + 4) = (int32_t)v12; uint64_t v14 = *(int64_t *)&g25; // 0x11a1e *(int32_t *)*(int32_t *)&g20 = (int32_t)(v14 / 0x100000000); g21 = v14; float64_t v15 = __asm_vldr(*(int32_t *)&g15); // 0x11a2e float64_t v16 = __asm_vadd_f64(v15, __asm_vmov_f64_2(3.0f)); // 0x11a36 __asm_vstr(v16, *(int32_t *)&g15); // 0x11b62 return 0; } float64_t v17 = __asm_vldr((int32_t)(float32_t)v10); // 0x11a44 __asm_vcmpe_f64(v17, __asm_vldr(0x405e0000)); __asm_vmrs(g1, g9); if (v5 <= v6) { // 0x11b62 return 0; } float64_t v18 = __asm_vldr(*(int32_t *)&g15); // 0x11a5c __asm_vcmp_f64(v18, __asm_vmov_f64_2(3.0f)); __asm_vmrs(g1, g9); int32_t result; if (v7) { // 0x11b12 *(int32_t *)*(int32_t *)&g15 = 0; g17 = 0; int64_t * v19 = g24; // 0x11a82 *(int32_t *)v19 = (int32_t)(v1 / 0x100000000); *(int32_t *)((int32_t)v19 + 4) = v2; *(int32_t *)*(int32_t *)&g25 = (int32_t)(v3 / 0x100000000); g26 = v3; float64_t v20 = __asm_vldr((int32_t)g24); // 0x11aa0 float64_t v21 = __asm_vldr(g19); // 0x11aa8 float64_t v22; __asm_vstr(__asm_vsub_f64(v20, v21), (int32_t)(float32_t)v22); float64_t v23 = __asm_vldr(*(int32_t *)&g25); // 0x11ab8 float64_t v24 = __asm_vldr(*(int32_t *)&g20); // 0x11ac0 float64_t v25; __asm_vstr(__asm_vsub_f64(v23, v24), (int32_t)(float32_t)v25); float64_t v26 = __asm_vldr((int32_t)(float32_t)v22); // 0x11acc float64_t v27 = __asm_vmul_f64(v26, __asm_vldr((int32_t)(float32_t)v22)); // 0x11ad4 float64_t v28 = __asm_vldr((int32_t)(float32_t)v25); // 0x11ad8 float64_t v29 = __asm_vmul_f64(v28, __asm_vldr((int32_t)(float32_t)v25)); // 0x11ae0 float64_t v30 = __asm_vmov_f64(__asm_vadd_f64(v27, v29)); // 0x11ae8 sqrt(wg_lng); float64_t v31 = __asm_vmov_f64(v30); // 0x11af0 float64_t v32 = __asm_vldr((int32_t)(float32_t)v10); // 0x11af4 float64_t v33; __asm_vstr(__asm_vdiv_f64(v31, v32), (int32_t)(float32_t)v33); float64_t v34 = __asm_vldr((int32_t)(float32_t)v33); // 0x11b00 __asm_vcmpe_f64(v34, __asm_vldr(0x40a8e200)); __asm_vmrs(g1, g9); result = -1; } else { int32_t v35 = *(int32_t *)&g22; // 0x11b24 *(int32_t *)v35 = (int32_t)(float32_t)g23; uint64_t v36 = *(int64_t *)&g24; // 0x11b2c *(int32_t *)g19 = (int32_t)(v36 / 0x100000000); *(int32_t *)(g19 + 4) = (int32_t)v36; uint64_t v37 = *(int64_t *)&g25; // 0x11b3c *(int32_t *)*(int32_t *)&g20 = (int32_t)(v37 / 0x100000000); g21 = v37; float64_t v38 = __asm_vldr(*(int32_t *)&g15); // 0x11b4c float64_t v39 = __asm_vadd_f64(v38, __asm_vmov_f64_2(3.0f)); // 0x11b54 __asm_vstr(v39, *(int32_t *)&g15); result = 0; } // 0x11b62 return result; } // Address range: 0x11b6c - 0x11b74 int32_t function_11b6c(int32_t result) { // 0x11b6c bool v1; // cpsr_c bool v2; // cpsr_z if (v1 == !v2) { // bb return result; } // 0x11b70 return result; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x11ba8 - 0x11c20 // Line range: 5596 - 5608 float64_t EncryptRn(int32_t wg_time) { int32_t v1 = g31; // 0x11ba8 int32_t v2; // bp-32 g31 = &v2; float64_t v3 = __asm_vcvt_f64_u32(__asm_vmov(wg_time)); // 0x11bb6 g6 = __asm_vldr(0x3fd6d916); float64_t v4 = __asm_vmov_f64(v3); // 0x11bbe g5 = v4; float64_t v5 = getYuValue((float64_t)(int64_t)wg_time, (float64_t)(int64_t)g29); // 0x11bc2 float64_t v6; __asm_vstr(v4, (int32_t)(float32_t)v6); float64_t v7; if (wg_time == 0) { // 0x11bd0 v7 = (float64_t)(*(int64_t *)__asm_adr(100) / 0x100000000); } else { v7 = v6; } float64_t v8 = __asm_vldr((int32_t)(float32_t)v7); // 0x11bda float64_t v9 = __asm_vmul_f64(v8, __asm_vldr(0x41b2b9b0)); // 0x11be2 float64_t v10 = __asm_vldr(0x41bb0c88); // 0x11be6 __asm_vstr(__asm_vadd_f64(v9, v10), (int32_t)(float32_t)v7); g6 = __asm_vmov_f64_2(2.0f); float64_t v11 = __asm_vldr((int32_t)(float32_t)v7); // 0x11bf6 g5 = v11; int32_t v12 = (float32_t)getYuValue(v5, (float64_t)(int64_t)g29); // r0 float64_t v13 = __asm_vmov_f64(v11); // 0x11bfe float64_t v14 = __asm_vmov_f64_2(2.0f); // 0x11c02 __asm_vstr(__asm_vdiv_f64(v13, v14), (int32_t)(float32_t)v7); __asm_vmov_f64(__asm_vmov_4((int32_t)((int64_t)v7 / 0x100000000), (int32_t)(int64_t)v7)); g31 = v1; return (int64_t)v12; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x11c40 - 0x11cba // Line range: 5610 - 5619 void EncrpytIni(int32_t iValue, int32_t uiSJ, int32_t uiLon, int32_t uiLat) { float64_t v1 = __asm_vcvt_f64_u32(__asm_vmov(uiLon)); // 0x11c58 __asm_vstr(v1, g19); float64_t v2 = __asm_vcvt_f64_u32(__asm_vmov(uiLat)); // 0x11c6a __asm_vstr(v2, *(int32_t *)&g20); float32_t v3 = __asm_vmov(uiLon); // 0x11c78 __asm_vstr(__asm_vcvt_f64_u32(v3), (int32_t)g24); float64_t v4 = __asm_vcvt_f64_u32(__asm_vmov(uiLat)); // 0x11c8e __asm_vstr(v4, *(int32_t *)&g25); *(int32_t *)*(int32_t *)&g15 = 0; g17 = 0x40080000; } // From module: /home/anjy/Downloads/navinfo/test.c // Address range: 0x11cd4 - 0x11f74 // Line range: 5621 - 5696 int32_t wgtochina_lb(int32_t wg_flag, int32_t wg_lng, int32_t wg_lat, int32_t wg_heit, int32_t wg_week, int32_t wg_time, int32_t * china_lng, int32_t * china_lat) { int32_t v1 = g31; // 0x11cd4 float64_t v2 = __asm_vpush(g7, g8); // 0x11cd6 g7 = v2; g8 = v2; float64_t dLon; // bp-64 g31 = &dLon; dLon = (int64_t)wg_heit; bool v3 = wg_heit < 0x1388; // cpsr_n int32_t v4; // r0 float64_t v5; float64_t v6; int32_t result; // 0x11f68 if (wg_heit > 0x1388) { // 0x11cf4 *(int32_t *)wg_time = 0; *china_lng = 0; result = -0x6a01; goto lab_0x11f68; } else { float64_t v7 = __asm_vcvt_f64_u32(__asm_vmov(wg_lng)); // 0x11d0c float64_t v8 = __asm_vldr(0x414c2000); // 0x11d10 __asm_vstr(__asm_vdiv_f64(v7, v8), (int32_t)(float32_t)v6); float64_t v9 = __asm_vcvt_f64_u32(__asm_vmov(wg_lat)); // 0x11d22 float64_t v10 = __asm_vldr(0x414c2000); // 0x11d26 __asm_vstr(__asm_vdiv_f64(v9, v10), (int32_t)(float32_t)v5); float64_t v11 = __asm_vldr((int32_t)(float32_t)v6); // 0x11d32 __asm_vcmpe_f64(v11, __asm_vldr(0x40520041)); __asm_vmrs(g1, g9); if (v3) { // 0x11d56 *(int32_t *)wg_time = 0; *china_lng = 0; result = -0x6a01; goto lab_0x11f68; } else { float64_t v12 = __asm_vldr((int32_t)(float32_t)v6); // 0x11d44 __asm_vcmpe_f64(v12, __asm_vldr(0x40613ab5)); __asm_vmrs(g1, g9); float64_t v13 = __asm_vldr((int32_t)(float32_t)v5); // 0x11d68 __asm_vcmpe_f64(v13, __asm_vldr(0x3fea89a0)); __asm_vmrs(g1, g9); if (v3) { // 0x11d8c *(int32_t *)wg_time = 0; *china_lng = 0; result = -0x6a01; goto lab_0x11f68; } else { float64_t v14 = __asm_vldr((int32_t)(float32_t)v5); // 0x11d7a __asm_vcmpe_f64(v14, __asm_vldr(0x404be9de)); __asm_vmrs(g1, g9); if (wg_flag == 0) { // 0x11da4 EncrpytIni(0, wg_week, wg_lng, wg_lat); *(int32_t *)wg_time = wg_lng; *china_lng = wg_lat; result = 0; goto lab_0x11f68; } else { // 0x11dc0 *(int32_t *)(int32_t)(float32_t)g23 = wg_week; float64_t v15 = __asm_vcvt_f64_u32(__asm_vmov(wg_lng)); // 0x11dd0 g6 = __asm_vmov_f64(__asm_vcvt_f64_u32(__asm_vmov(wg_lat))); g5 = __asm_vmov_f64(v15); int32_t v16 = JudgeSD((float64_t)(int64_t)wg_flag, g23); // 0x11de6 v4 = v16; if (v16 == -1) { // bb v4 = __asm_ite(); if (v16 == -1) { // 0x11dfc *(int32_t *)wg_time = 0; *china_lng = 0; result = -0x6a01; goto lab_0x11f68; } else { goto lab_0x11e0e; } } else { goto lab_0x11e0e; } } } } } lab_0x11f68: // 0x11f68 __asm_vpop(g7, g8); g31 = v1; return result; lab_0x11e0e:; float64_t v17 = __asm_vldr((int32_t)(float32_t)v6); // 0x11e0e float64_t v18 = __asm_vsub_f64(v17, __asm_vldr(0x405a4000)); // 0x11e16 float64_t v19 = __asm_vldr((int32_t)(float32_t)v5); // 0x11e1a g6 = __asm_vmov_f64(__asm_vsub_f64(v19, __asm_vldr(0x40418000))); float64_t v20 = __asm_vmov_f64(v18); // 0x11e2a g5 = v20; float64_t v21 = EncrpytLonLatA((float64_t)(int64_t)v4, g23); // 0x11e2e float64_t v22; __asm_vstr(v20, (int32_t)(float32_t)v22); float64_t v23 = __asm_vldr((int32_t)(float32_t)v6); // 0x11e36 float64_t v24 = __asm_vsub_f64(v23, __asm_vldr(0x405a4000)); // 0x11e3e float64_t v25 = __asm_vldr((int32_t)(float32_t)v5); // 0x11e42 g6 = __asm_vmov_f64(__asm_vsub_f64(v25, __asm_vldr(0x40418000))); float64_t v26 = __asm_vmov_f64(v24); // 0x11e52 g5 = v26; float64_t v27 = EncrpytLonLatB(v21, g23); // 0x11e56 int32_t v28; __asm_vstr(v26, v28); g6 = __asm_vldr((int32_t)(float32_t)v5); float64_t v29 = __asm_vldr((int32_t)(float32_t)v6); // 0x11e62 g5 = v29; float64_t v30 = Elev_Inter(v27, g23); // 0x11e66 int32_t v31; __asm_vstr(v29, v31); float64_t v32 = __asm_vldr(v31); // 0x11e6e float64_t v33 = __asm_vmul_f64(v32, __asm_vldr(0x3f50624d)); // 0x11e76 float64_t v34 = __asm_vadd_f64(v33, __asm_vldr((int32_t)(float32_t)v22)); // 0x11e7e g7 = v34; float64_t v35 = __asm_vcvt_f64_u32(__asm_vmov(wg_week)); // 0x11e88 float64_t v36 = __asm_vldr(0x3f91df46); // 0x11e8c float64_t v37 = __asm_vmov_f64(__asm_vmul_f64(v35, v36)); // 0x11e94 g5 = v37; encrpytTL(v30); float64_t v38 = __asm_vmov_f64(v37); // 0x11e9c float64_t v39 = EncryptRn(wg_week); // 0x11ea2 float64_t v40 = __asm_vadd_f64(v38, __asm_vmov_f64(v37)); // 0x11eaa float64_t v41 = __asm_vdiv_f64(v40, __asm_vmov_f64_2(18.0f)); // 0x11eb2 __asm_vstr(__asm_vadd_f64(v34, v41), (int32_t)(float32_t)v22); float64_t v42 = __asm_vldr(v31); // 0x11ebe float64_t v43 = __asm_vmul_f64(v42, __asm_vldr(0x3f50624d)); // 0x11ec6 g7 = __asm_vadd_f64(v43, __asm_vldr(v28)); float64_t v44 = __asm_vcvt_f64_u32(__asm_vmov(wg_week)); // 0x11ed8 float64_t v45 = __asm_vldr(0x3f91df46); // 0x11edc float64_t v46 = __asm_vmov_f64(__asm_vmul_f64(v44, v45)); // 0x11ee4 g5 = v46; encrpytTL(v39); g8 = __asm_vmov_f64(v46); float64_t v47 = EncryptRn(wg_week); // 0x11ef2 float64_t v48 = __asm_vadd_f64(g8, __asm_vmov_f64(v46)); // 0x11efa float64_t v49 = __asm_vdiv_f64(v48, __asm_vmov_f64_2(18.0f)); // 0x11f02 __asm_vstr(__asm_vadd_f64(g7, v49), v28); g6 = __asm_vldr((int32_t)(float32_t)v22); float64_t v50 = __asm_vldr((int32_t)(float32_t)v5); // 0x11f12 g5 = v50; float64_t v51 = EncryptHX(v47, g23); // 0x11f16 float64_t v52 = __asm_vmov_f64(v50); // 0x11f1a float64_t v53 = __asm_vadd_f64(v52, __asm_vldr((int32_t)(float32_t)v6)); // 0x11f22 float64_t v54 = __asm_vmul_f64(v53, __asm_vldr(0x414c2000)); // 0x11f2a int32_t v55 = __asm_vmov_3(__asm_vcvt_u32_f64(v54)); // 0x11f32 *(int32_t *)wg_time = v55; g6 = __asm_vldr(v28); float64_t v56 = __asm_vldr((int32_t)(float32_t)v5); // 0x11f3e g5 = v56; EncryptHY(v51, (float64_t)(int64_t)v55); float64_t v57 = __asm_vmov_f64(v56); // 0x11f46 float64_t v58 = __asm_vadd_f64(v57, __asm_vldr((int32_t)(float32_t)v5)); // 0x11f4e float64_t v59 = __asm_vmul_f64(v58, __asm_vldr(0x414c2000)); // 0x11f56 *china_lng = __asm_vmov_3(__asm_vcvt_u32_f64(v59)); result = 0; goto lab_0x11f68; } // Address range: 0x11f74 - 0x11f7c int32_t function_11f74(int32_t result) { // 0x11f74 bool v1; // cpsr_c bool v2; // cpsr_z if (v1 == !v2) { // bb return result; } // 0x11f78 return result; } // Address range: 0x11f88 - 0x11f8c int32_t function_11f88(void) { // 0x11f88 int32_t result; // r0 return result; } // Address range: 0x11f98 - 0x11f99 int32_t function_11f98(void) { // 0x11f98 return g28; } // Address range: 0x11fb0 - 0x11fb4 int32_t function_11fb0(void) { // 0x11fb0 bool v1; // cpsr_c int32_t result; // 0x11fb2 if (v1) { // bb result = function_11f98(); } else { // 0x11fb0 result = g28; } // 0x11fb4 return result; } // From module: /home/anjy/projs/AD/brain/source/gps_plugin.cpp // Address range: 0x11fc8 - 0x12000 // Line range: 9 - 17 int32_t GpsPlugin_encrypt(int32_t flag, int32_t wgLng, int32_t wgLat, int32_t wgHeight, int32_t wgWeek, int32_t wgTime, int32_t * chinaLng, int32_t * chinaLat) { int32_t v1 = g31; // 0x11fc8 int32_t v2; // bp-32 g31 = &v2; v2 = wgHeight; int32_t result = wgtochina_lb(flag, wgLng, wgLat, wgHeight, wgWeek, wgTime, chinaLng, chinaLat); // 0x11fee g31 = v1; return result; } // Address range: 0x12000 - 0x12034 int32_t __libc_csu_init(int32_t result, int32_t a2, int32_t a3, int32_t a4) { int32_t v1 = _init(result, a2, a3, a4); // 0x12010 if ((0x22eee - (int32_t)&g11) / 4 != 0) { int32_t v2 = &g11; // 0x12020 int32_t v3 = 1; // 0x1201e while (v3 != (0x22eee - (int32_t)&g11) / 4) { // 0x1201e v2 += 4; v3++; } } else { result = v1; } // 0x12030 return result; } // Address range: 0x1203c - 0x1203e int32_t __libc_csu_fini(void) { // 0x1203c int32_t result; // r0 return result; } // Address range: 0x12040 - 0x12048 int32_t _fini(int32_t result, int32_t a2, int32_t a3, int32_t a4) { // 0x12040 return result; } // Address range: 0x23060 - 0x23068 int32_t function_23060(int32_t a1) { // 0x23060 g28 = a1; bool v1; // cpsr_c bool v2; // cpsr_z int32_t v3; // 0x23060 if (v1 == !v2) { // bb v3 = function_23094(); g28 = v3; } else { v3 = a1; } // 0x23062 int32_t result; // 0x23066 if (v1 == (v3 != 0)) { // bb178 result = function_230a8(); } else { result = v3; } // 0x23066 return result; } // Address range: 0x23068 - 0x2306e int32_t __data_start(int32_t result) { // 0x23068 return result; } // Address range: 0x23074 - 0x23075 int32_t function_23074(void) { // 0x23074 int32_t result; // r0 return result; } // Address range: 0x23094 - 0x23095 int32_t function_23094(void) { // 0x23094 return g28; } // Address range: 0x230a8 - 0x230a9 int32_t function_230a8(void) { // 0x230a8 return g28; } // Address range: 0x174acb0 - 0x174acb1 int32_t function_174acb0(void) { // 0x174acb0 return g28; } // Address range: 0x174aec0 - 0x174aec1 int32_t function_174aec0(void) { // 0x174aec0 return g28; } // Address range: 0xfe3e1926 - 0xfe3e1927 int32_t function_fe3e1926(void) { // 0xfe3e1926 return g28; } // --------------------- Meta-Information --------------------- // Detected compiler/packer: gcc (5.4.0) // Detected language: C++ // Detected functions: 61 // Decompilation date: 2020-10-17 23:44:07