Created
May 3, 2023 15:46
-
-
Save mouseos/f303aabac3f3ea21c6ffeef1fac756d8 to your computer and use it in GitHub Desktop.
clova desk /bin/keyeventをretdecでデコンパイル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// This file was generated by the Retargetable Decompiler | |
// Website: https://retdec.com | |
// | |
#include <dirent.h> | |
#include <fcntl.h> | |
#include <pthread.h> | |
#include <signal.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stropts.h> | |
#include <sys/socket.h> | |
#include <unistd.h> | |
// ----------------- Float Types Definitions ------------------ | |
typedef double float64_t; | |
typedef long double float128_t; | |
// ------------------------ Structures ------------------------ | |
struct ProgramVars { | |
int32_t e0; | |
}; | |
struct _IO_FILE { | |
int32_t e0; | |
}; | |
struct _TYPEDEF_sigset_t { | |
int32_t e0[1]; | |
}; | |
struct __dirstream { | |
int32_t e0; | |
}; | |
struct dirent { | |
int32_t e0; | |
int32_t e1; | |
int16_t e2; | |
char e3; | |
char e4[256]; | |
}; | |
struct pollfd { | |
int32_t e0; | |
int16_t e1; | |
int16_t e2; | |
}; | |
struct sigaction { | |
void (*e0)(int32_t); | |
int32_t e1; | |
void (*e2)(); | |
struct _TYPEDEF_sigset_t e3; | |
}; | |
struct sockaddr { | |
int64_t e0; | |
char e1[14]; | |
}; | |
// ------------------- Function Prototypes -------------------- | |
int64_t entry_point(void); | |
void function_1478(struct ProgramVars * vars, void (*atfork_prepare)(), void (*atfork_parent)(), void (*atfork_child)(), char ** apple); | |
int32_t function_1488(void (*func)(int64_t *), int64_t * arg, int64_t * dso_handle); | |
int64_t function_1498(int64_t a1, int64_t a2, int64_t a3, int64_t a4); | |
int64_t function_14a8(int64_t * a1, int64_t * a2, int64_t a3); | |
int32_t function_14b8(char * file, int32_t oflag, ...); | |
int32_t function_14c8(int32_t prio, char * tag, char * fmt, ...); | |
int64_t function_14d8(int64_t a1, int64_t * a2, int64_t a3, int64_t a4); | |
int32_t function_14e8(int32_t fd); | |
void function_14f8(void); | |
struct _IO_FILE * function_1508(char * filename, char * modes); | |
int32_t function_1518(struct _IO_FILE * stream, char * format, ...); | |
int32_t function_1528(struct _IO_FILE * stream); | |
void function_1538(void); | |
int64_t function_1548(char * a1, char * a2); | |
int64_t function_1558(char * a1, int64_t * a2, int64_t * a3); | |
int32_t function_1568(char * s1, char * s2); | |
int32_t * function_1578(void); | |
char * function_1588(int32_t errnum); | |
int32_t function_1598(char * path, char * arg, ...); | |
int32_t function_15a8(char * s, int32_t n, int32_t flag, int32_t slen, char * format, ...); | |
int64_t function_15b8(int64_t a1); | |
int32_t function_15c8(int32_t useconds); | |
int64_t function_15d8(int64_t a1, int64_t * a2); | |
int64_t function_15e8(int64_t a1, int64_t a2, int64_t a3); | |
int64_t function_15f8(int64_t a1); | |
int64_t * function_1608(int64_t * s, int32_t c, int32_t n); | |
char * function_1618(char * haystack, char * needle); | |
int32_t function_1628(struct _TYPEDEF_sigset_t * set, int32_t signo); | |
int32_t function_1638(int32_t sig, struct sigaction * act, struct sigaction * oact); | |
int32_t function_1648(int64_t * mutex); | |
int32_t function_1658(int32_t fd, int64_t * buf, int32_t n, int32_t flags); | |
int32_t function_1668(int64_t * mutex); | |
int64_t * function_1678(int32_t size); | |
void function_1688(int64_t * ptr); | |
char * function_1698(char * name); | |
int32_t function_16a8(char * nptr, char ** endptr, int32_t base); | |
int32_t function_16b8(int32_t fd, int32_t n); | |
int32_t function_16c8(int32_t fd, struct sockaddr * addr, int32_t * addr_len); | |
int32_t function_16d8(int64_t * mutex, int64_t * mutexattr); | |
int32_t function_16e8(int32_t fd, int32_t request, ...); | |
int64_t * function_16f8(int64_t * ptr, int32_t size); | |
char * function_1708(char * s); | |
int32_t function_1718(int32_t fd, int64_t * buf, int32_t nbytes, int32_t buflen); | |
char * function_1728(char * dest, char * src, int32_t n); | |
int32_t function_1738(char * string, int32_t maxlen); | |
int64_t * function_1748(int64_t * dest, int64_t * src, int32_t n); | |
struct __dirstream * function_1758(char * name); | |
struct dirent * function_1768(struct __dirstream * dirp); | |
int32_t function_1778(struct __dirstream * dirp); | |
int64_t * function_1788(int32_t nmemb, int32_t size); | |
int32_t function_1798(void); | |
int32_t function_17a8(int32_t fd, char * name, int32_t mask); | |
int32_t function_17b8(struct pollfd * fds, int32_t nfds, int32_t timeout, int64_t fdslen); | |
int64_t function_17c8(int64_t * a1); | |
int64_t function_1824(void); | |
int64_t function_184c(void); | |
int64_t function_1880(void); | |
int64_t function_18b8(void); | |
int64_t function_1ed8(void); | |
int64_t function_1f5c(void); | |
int64_t function_228c(void); | |
// --------------------- Global Variables --------------------- | |
void (*g1)(int64_t *) = NULL; // 0x1000 | |
char * g2 = "1"; // 0x2e90 | |
int64_t g3 = 0x7069772d2d000030; // 0x2ea1 | |
int64_t g4 = 0x5f657069772d2d00; // 0x2ea3 | |
void (*g5)() = (void (*)())0x2a20; // 0x4df8 | |
int64_t g6; // 0x4e10 | |
int32_t * g7 = (int32_t *)0x5018; // 0x4e20 | |
int32_t g8 = 80; // 0x4e21 | |
int32_t * g9 = (int32_t *)0x501c; // 0x4e28 | |
int64_t g10 = 0; // 0x5000 | |
int32_t g11 = 0; // 0x5021 | |
int32_t g12 = 0; // 0x5022 | |
int32_t g13 = 0; // 0x5024 | |
int32_t g14 = 0; // 0x5027 | |
int64_t g15 = 0; // 0x5029 | |
int32_t g16; | |
// ------- Dynamically Linked Functions Without Header -------- | |
int32_t __android_log_print(int32_t a1, char * a2, char * a3, ...); | |
int32_t __cxa_atexit(void (*a1)(int64_t *), int64_t * a2, int64_t * a3); | |
int32_t * __errno(void); | |
void __libc_init(struct ProgramVars * a1, void (*a2)(), void (*a3)(), void (*a4)(), char ** a5); | |
int32_t __poll_chk(struct pollfd * a1, int32_t a2, int32_t a3, int64_t a4); | |
int32_t __read_chk(int32_t a1, int64_t * a2, int32_t a3, int32_t a4); | |
int64_t __register_atfork(int64_t a1, int64_t a2, int64_t a3, int64_t a4); | |
int32_t __snprintf_chk(char * a1, int32_t a2, int32_t a3, int32_t a4, char * a5, ...); | |
void __stack_chk_fail(void); | |
int64_t __write_chk(int64_t a1, int64_t * a2, int64_t a3, int64_t a4); | |
int32_t inotify_add_watch(int32_t a1, char * a2, int32_t a3); | |
int32_t inotify_init(void); | |
int64_t mixer_close(int64_t a1); | |
int64_t mixer_ctl_set_value(int64_t a1, int64_t a2, int64_t a3); | |
int64_t mixer_get_ctl_by_name(int64_t a1, int64_t * a2); | |
int64_t mixer_open(int64_t a1); | |
int64_t property_get(char * a1, int64_t * a2, int64_t * a3); | |
int64_t property_set(char * a1, char * a2); | |
int64_t SpecialCharacterFilter(int64_t * a1, int64_t * a2, int64_t a3); | |
// ------------------------ Functions ------------------------- | |
// Address range: 0x1478 - 0x1488 | |
void function_1478(struct ProgramVars * vars, void (*atfork_prepare)(), void (*atfork_parent)(), void (*atfork_child)(), char ** apple) { | |
// 0x1478 | |
__libc_init(vars, atfork_prepare, atfork_parent, atfork_child, apple); | |
} | |
// Address range: 0x1488 - 0x1498 | |
int32_t function_1488(void (*func)(int64_t *), int64_t * arg, int64_t * dso_handle) { | |
// 0x1488 | |
return __cxa_atexit(func, arg, dso_handle); | |
} | |
// Address range: 0x1498 - 0x14a8 | |
int64_t function_1498(int64_t a1, int64_t a2, int64_t a3, int64_t a4) { | |
// 0x1498 | |
return __register_atfork(a1, a2, a3, a4); | |
} | |
// Address range: 0x14a8 - 0x14b8 | |
int64_t function_14a8(int64_t * a1, int64_t * a2, int64_t a3) { | |
// 0x14a8 | |
return SpecialCharacterFilter(a1, a2, a3); | |
} | |
// Address range: 0x14b8 - 0x14c8 | |
int32_t function_14b8(char * file, int32_t oflag, ...) { | |
// 0x14b8 | |
return open(file, oflag); | |
} | |
// Address range: 0x14c8 - 0x14d8 | |
int32_t function_14c8(int32_t prio, char * tag, char * fmt, ...) { | |
// 0x14c8 | |
return __android_log_print(prio, tag, fmt); | |
} | |
// Address range: 0x14d8 - 0x14e8 | |
int64_t function_14d8(int64_t a1, int64_t * a2, int64_t a3, int64_t a4) { | |
// 0x14d8 | |
return __write_chk(a1, a2, a3, a4); | |
} | |
// Address range: 0x14e8 - 0x14f8 | |
int32_t function_14e8(int32_t fd) { | |
// 0x14e8 | |
return close(fd); | |
} | |
// Address range: 0x14f8 - 0x1508 | |
void function_14f8(void) { | |
// 0x14f8 | |
__stack_chk_fail(); | |
} | |
// Address range: 0x1508 - 0x1518 | |
struct _IO_FILE * function_1508(char * filename, char * modes) { | |
// 0x1508 | |
return fopen(filename, modes); | |
} | |
// Address range: 0x1518 - 0x1528 | |
int32_t function_1518(struct _IO_FILE * stream, char * format, ...) { | |
// 0x1518 | |
return fprintf(stream, format); | |
} | |
// Address range: 0x1528 - 0x1538 | |
int32_t function_1528(struct _IO_FILE * stream) { | |
// 0x1528 | |
return fclose(stream); | |
} | |
// Address range: 0x1538 - 0x1548 | |
void function_1538(void) { | |
// 0x1538 | |
sync(); | |
} | |
// Address range: 0x1548 - 0x1558 | |
int64_t function_1548(char * a1, char * a2) { | |
// 0x1548 | |
return property_set(a1, a2); | |
} | |
// Address range: 0x1558 - 0x1568 | |
int64_t function_1558(char * a1, int64_t * a2, int64_t * a3) { | |
// 0x1558 | |
return property_get(a1, a2, a3); | |
} | |
// Address range: 0x1568 - 0x1578 | |
int32_t function_1568(char * s1, char * s2) { | |
// 0x1568 | |
return strcmp(s1, s2); | |
} | |
// Address range: 0x1578 - 0x1588 | |
int32_t * function_1578(void) { | |
// 0x1578 | |
return __errno(); | |
} | |
// Address range: 0x1588 - 0x1598 | |
char * function_1588(int32_t errnum) { | |
// 0x1588 | |
return strerror(errnum); | |
} | |
// Address range: 0x1598 - 0x15a8 | |
int32_t function_1598(char * path, char * arg, ...) { | |
// 0x1598 | |
return execl(path, arg); | |
} | |
// Address range: 0x15a8 - 0x15b8 | |
int32_t function_15a8(char * s, int32_t n, int32_t flag, int32_t slen, char * format, ...) { | |
// 0x15a8 | |
return __snprintf_chk(s, n, flag, slen, format); | |
} | |
// Address range: 0x15b8 - 0x15c8 | |
int64_t function_15b8(int64_t a1) { | |
// 0x15b8 | |
return mixer_open(a1); | |
} | |
// Address range: 0x15c8 - 0x15d8 | |
int32_t function_15c8(int32_t useconds) { | |
// 0x15c8 | |
return usleep(useconds); | |
} | |
// Address range: 0x15d8 - 0x15e8 | |
int64_t function_15d8(int64_t a1, int64_t * a2) { | |
// 0x15d8 | |
return mixer_get_ctl_by_name(a1, a2); | |
} | |
// Address range: 0x15e8 - 0x15f8 | |
int64_t function_15e8(int64_t a1, int64_t a2, int64_t a3) { | |
// 0x15e8 | |
return mixer_ctl_set_value(a1, a2, a3); | |
} | |
// Address range: 0x15f8 - 0x1608 | |
int64_t function_15f8(int64_t a1) { | |
// 0x15f8 | |
return mixer_close(a1); | |
} | |
// Address range: 0x1608 - 0x1618 | |
int64_t * function_1608(int64_t * s, int32_t c, int32_t n) { | |
// 0x1608 | |
return memset(s, c, n); | |
} | |
// Address range: 0x1618 - 0x1628 | |
char * function_1618(char * haystack, char * needle) { | |
// 0x1618 | |
return strstr(haystack, needle); | |
} | |
// Address range: 0x1628 - 0x1638 | |
int32_t function_1628(struct _TYPEDEF_sigset_t * set, int32_t signo) { | |
// 0x1628 | |
return sigaddset(set, signo); | |
} | |
// Address range: 0x1638 - 0x1648 | |
int32_t function_1638(int32_t sig, struct sigaction * act, struct sigaction * oact) { | |
// 0x1638 | |
return sigaction(sig, act, oact); | |
} | |
// Address range: 0x1648 - 0x1658 | |
int32_t function_1648(int64_t * mutex) { | |
// 0x1648 | |
return pthread_mutex_lock(mutex); | |
} | |
// Address range: 0x1658 - 0x1668 | |
int32_t function_1658(int32_t fd, int64_t * buf, int32_t n, int32_t flags) { | |
// 0x1658 | |
return send(fd, buf, n, flags); | |
} | |
// Address range: 0x1668 - 0x1678 | |
int32_t function_1668(int64_t * mutex) { | |
// 0x1668 | |
return pthread_mutex_unlock(mutex); | |
} | |
// Address range: 0x1678 - 0x1688 | |
int64_t * function_1678(int32_t size) { | |
// 0x1678 | |
return malloc(size); | |
} | |
// Address range: 0x1688 - 0x1698 | |
void function_1688(int64_t * ptr) { | |
// 0x1688 | |
free(ptr); | |
} | |
// Address range: 0x1698 - 0x16a8 | |
char * function_1698(char * name) { | |
// 0x1698 | |
return getenv(name); | |
} | |
// Address range: 0x16a8 - 0x16b8 | |
int32_t function_16a8(char * nptr, char ** endptr, int32_t base) { | |
// 0x16a8 | |
return strtol(nptr, endptr, base); | |
} | |
// Address range: 0x16b8 - 0x16c8 | |
int32_t function_16b8(int32_t fd, int32_t n) { | |
// 0x16b8 | |
return listen(fd, n); | |
} | |
// Address range: 0x16c8 - 0x16d8 | |
int32_t function_16c8(int32_t fd, struct sockaddr * addr, int32_t * addr_len) { | |
// 0x16c8 | |
return accept(fd, addr, addr_len); | |
} | |
// Address range: 0x16d8 - 0x16e8 | |
int32_t function_16d8(int64_t * mutex, int64_t * mutexattr) { | |
// 0x16d8 | |
return pthread_mutex_init(mutex, mutexattr); | |
} | |
// Address range: 0x16e8 - 0x16f8 | |
int32_t function_16e8(int32_t fd, int32_t request, ...) { | |
// 0x16e8 | |
return ioctl(fd, request); | |
} | |
// Address range: 0x16f8 - 0x1708 | |
int64_t * function_16f8(int64_t * ptr, int32_t size) { | |
// 0x16f8 | |
return realloc(ptr, size); | |
} | |
// Address range: 0x1708 - 0x1718 | |
char * function_1708(char * s) { | |
// 0x1708 | |
return strdup(s); | |
} | |
// Address range: 0x1718 - 0x1728 | |
int32_t function_1718(int32_t fd, int64_t * buf, int32_t nbytes, int32_t buflen) { | |
// 0x1718 | |
return __read_chk(fd, buf, nbytes, buflen); | |
} | |
// Address range: 0x1728 - 0x1738 | |
char * function_1728(char * dest, char * src, int32_t n) { | |
// 0x1728 | |
return strncpy(dest, src, n); | |
} | |
// Address range: 0x1738 - 0x1748 | |
int32_t function_1738(char * string, int32_t maxlen) { | |
// 0x1738 | |
return strnlen(string, maxlen); | |
} | |
// Address range: 0x1748 - 0x1758 | |
int64_t * function_1748(int64_t * dest, int64_t * src, int32_t n) { | |
// 0x1748 | |
return memmove(dest, src, n); | |
} | |
// Address range: 0x1758 - 0x1768 | |
struct __dirstream * function_1758(char * name) { | |
// 0x1758 | |
return opendir(name); | |
} | |
// Address range: 0x1768 - 0x1778 | |
struct dirent * function_1768(struct __dirstream * dirp) { | |
// 0x1768 | |
return readdir(dirp); | |
} | |
// Address range: 0x1778 - 0x1788 | |
int32_t function_1778(struct __dirstream * dirp) { | |
// 0x1778 | |
return closedir(dirp); | |
} | |
// Address range: 0x1788 - 0x1798 | |
int64_t * function_1788(int32_t nmemb, int32_t size) { | |
// 0x1788 | |
return calloc(nmemb, size); | |
} | |
// Address range: 0x1798 - 0x17a8 | |
int32_t function_1798(void) { | |
// 0x1798 | |
return inotify_init(); | |
} | |
// Address range: 0x17a8 - 0x17b8 | |
int32_t function_17a8(int32_t fd, char * name, int32_t mask) { | |
// 0x17a8 | |
return inotify_add_watch(fd, name, mask); | |
} | |
// Address range: 0x17b8 - 0x17c8 | |
int32_t function_17b8(struct pollfd * fds, int32_t nfds, int32_t timeout, int64_t fdslen) { | |
// 0x17b8 | |
return __poll_chk(fds, nfds, timeout, fdslen); | |
} | |
// Address range: 0x17c8 - 0x181c | |
int64_t function_17c8(int64_t * a1) { | |
int64_t v1 = *(int64_t *)0x4de0; // bp-16, 0x17e0 | |
int64_t v2; // 0x17c8 | |
__libc_init((struct ProgramVars *)a1, NULL, g5, (void (*)())&v1, (char **)v2); | |
return &g16; | |
} | |
// Address range: 0x181c - 0x1824 | |
int64_t entry_point(void) { | |
// 0x181c | |
int64_t v1; // 0x181c | |
return function_17c8(&v1); | |
} | |
// Address range: 0x1824 - 0x184c | |
int64_t function_1824(void) { | |
// 0x1824 | |
int64_t result; // 0x1824 | |
return result; | |
} | |
// Address range: 0x184c - 0x1880 | |
int64_t function_184c(void) { | |
// 0x184c | |
int64_t v1; // 0x184c | |
int32_t result = __cxa_atexit((void (*)(int64_t *))((int64_t)&g1 + 2084), (int64_t *)v1, &g10); // 0x1870 | |
return result; | |
} | |
// Address range: 0x1880 - 0x18b8 | |
int64_t function_1880(void) { | |
// 0x1880 | |
int64_t v1; // 0x1880 | |
return __register_atfork(v1, v1, v1, (int64_t)&g10); | |
} | |
// Address range: 0x18b8 - 0x1ed8 | |
int64_t function_18b8(void) { | |
float128_t v1 = *(float128_t *)"/sys/devices/soc.0/qpnp-power-on-1/timer_reset"; // 0x18e4 | |
int64_t v2 = (float64_t)v1; // bp-104, 0x1900 | |
int64_t v3 = 0; // bp-152, 0x1910 | |
int32_t fd = open((char *)SpecialCharacterFilter(&v2, &v3, 47), O_RDWR); // 0x191c | |
if (fd < 0) { | |
// 0x19a0 | |
return __android_log_print(6, "KeyEvent", "Factory Reset File open Error"); | |
} | |
int64_t v4; // 0x18b8 | |
int64_t v5; // 0x18b8 | |
if ((uint64_t)v5 % 2 == 0) { | |
// 0x1964 | |
__android_log_print(4, "KeyEvent", "Timer Reset ON"); | |
v4 = &g3; | |
} else { | |
// 0x1934 | |
__android_log_print(4, "KeyEvent", "Timer Reset OFF"); | |
v4 = (int64_t)&g2; | |
} | |
// 0x197c | |
__write_chk((int64_t)fd, (int64_t *)v4, 1, 2); | |
// 0x19a0 | |
return close(fd); | |
} | |
// Address range: 0x1ed8 - 0x1f5c | |
int64_t function_1ed8(void) { | |
int64_t * mem = malloc(4); // 0x1ef4 | |
if (mem == NULL) { | |
// 0x1f28 | |
__android_log_print(6, "KeyEvent", "notify_keyword_detected: buffer malloc() failed"); | |
// 0x1f4c | |
return 0xffffffff; | |
} | |
// 0x1f00 | |
int64_t v1; // 0x1ed8 | |
*(int32_t *)mem = (int32_t)v1; | |
int64_t result = 0xffffffff; // 0x1f14 | |
if ((int32_t)(int64_t)mem >= 0) { | |
// 0x1f18 | |
free(mem); | |
result = 0; | |
} | |
// 0x1f4c | |
return result; | |
} | |
// Address range: 0x1f5c - 0x228c | |
int64_t function_1f5c(void) { | |
// 0x1f5c | |
__android_log_print(3, "KeyEvent", "broadcast_init()"); | |
int64_t v1 = *(int64_t *)*(int64_t *)0x4e18; // 0x1fb4 | |
int64_t name; // bp-128, 0x1f5c | |
__snprintf_chk((char *)&name, 64, 0, 64, "ANDROID_SOCKET_%s", (char *)v1); | |
char * env_val = getenv((char *)&name); // 0x1fcc | |
if (env_val == NULL) { | |
// 0x2060 | |
__android_log_print(6, "KeyEvent", (char *)(int64_t)"android_get_control_socket() failed"); | |
// 0x2078 | |
return 0xffffffff; | |
} | |
int32_t * err_num = __errno(); // 0x1fd8 | |
*err_num = 0; | |
int32_t str_as_l = strtol(env_val, NULL, 10); // 0x1ff0 | |
if (str_as_l < 0 | *err_num != 0) { | |
// 0x2060 | |
__android_log_print(6, "KeyEvent", (char *)(int64_t)"android_get_control_socket() failed"); | |
// 0x2078 | |
return 0xffffffff; | |
} | |
// 0x2004 | |
if (listen(str_as_l, 128) != 0) { | |
// 0x2014 | |
strerror(*err_num); | |
__android_log_print(6, "KeyEvent", "listen() failed - errno:%d, %s"); | |
close(str_as_l); | |
// 0x2078 | |
return 0xffffffff; | |
} | |
int64_t addr_len = 110; // bp-244, 0x20a4 | |
int64_t addr; // bp-240, 0x1f5c | |
int32_t accepted_sock_fd = accept(str_as_l, (struct sockaddr *)&addr, (int32_t *)&addr_len); // 0x20a8 | |
if (accepted_sock_fd < 0) { | |
// 0x2060 | |
__android_log_print(6, "KeyEvent", (char *)(int64_t)"accept() failed"); | |
// 0x2078 | |
return 0xffffffff; | |
} | |
// 0x20b4 | |
if (pthread_mutex_init((int64_t *)g6, NULL) < 0) { | |
// 0x2060 | |
__android_log_print(6, "KeyEvent", (char *)(int64_t)"pthread_mutex_init() failed"); | |
// 0x2078 | |
return 0xffffffff; | |
} | |
// 0x20d0 | |
__android_log_print(3, "KeyEvent", "broadcast_init() OK"); | |
// 0x2078 | |
return accepted_sock_fd; | |
} | |
// Address range: 0x228c - 0x2e0c | |
int64_t function_228c(void) { | |
// 0x228c | |
int32_t v1; // 0x228c | |
if (*(char *)&g13 == 1) { | |
// 0x22bc | |
if (*(char *)&g14 % 2 == 0) { | |
int32_t * v2 = g9; // 0x232c | |
*(char *)&g14 = 1; | |
*g7 = (int32_t)&g8; | |
*v2 = 1 << 4 * (int32_t)(int64_t)g7 | (int32_t)(int64_t)v2; | |
v1 = &g8; | |
goto lab_0x23a0; | |
} else { | |
goto lab_0x22c8; | |
} | |
} else { | |
goto lab_0x22c8; | |
} | |
lab_0x22c8:; | |
// 0x22c8 | |
int32_t v3; // 0x228c | |
if (*(char *)&g12 == 1) { | |
// 0x22d8 | |
v3 = 2; | |
if (*(char *)&g14 % 2 == 0) { | |
goto lab_0x2370; | |
} else { | |
goto lab_0x22e4; | |
} | |
} else { | |
goto lab_0x22e4; | |
} | |
lab_0x22e4: | |
// 0x22e4 | |
if (*(char *)&g11 == 1) { | |
// 0x22f4 | |
v3 = 3; | |
if (*(char *)&g14 % 2 == 0) { | |
goto lab_0x2370; | |
} else { | |
goto lab_0x2300; | |
} | |
} else { | |
goto lab_0x2300; | |
} | |
lab_0x23a0: | |
// 0x23a0 | |
if (v1 != 8) { | |
// 0x245c | |
int64_t result; // 0x228c | |
return result; | |
} | |
// 0x23a8 | |
int64_t str; // bp-42, 0x228c | |
property_get("ro.product.name", &str, &g4); | |
int32_t strcmp_rc = strcmp((char *)&str, "if_s700n"); // 0x23cc | |
int64_t result2 = strcmp_rc; // 0x23f0 | |
if ((strcmp_rc == 0 ? 0x13312123 : 0) == ((int64_t)g9 & 0xffffffff)) { | |
// 0x23f4 | |
int64_t v4; // bp-44, 0x228c | |
property_get("sys.infr.usb", &v4, &g3); | |
*(char *)&g15 = (char)v4; | |
int64_t v5 = v4 % 256 == 49 ? (int64_t)&g3 : (int64_t)&g2; | |
result2 = property_set("sys.infr.usb", (char *)v5); | |
} | |
// 0x2440 | |
*g9 = 0; | |
*g7 = 0; | |
// 0x245c | |
return result2; | |
lab_0x2370:; | |
int32_t * v6 = g9; // 0x2378 | |
*(char *)&g14 = 1; | |
*g7 = (int32_t)&g8; | |
*v6 = v3 << 4 * (int32_t)(int64_t)g7 | (int32_t)(int64_t)v6; | |
v1 = &g8; | |
goto lab_0x23a0; | |
lab_0x2300: | |
// 0x2300 | |
*(char *)&g14 = 0; | |
v1 = *(int32_t *)&g7; | |
goto lab_0x23a0; | |
} | |
// --------------------- Meta-Information --------------------- | |
// Detected compiler/packer: gold (1.11) | |
// Detected functions: 62 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment