void fun_4010a8(int32_t ecx) {
    int32_t ecx2;
    int1_t zf3;
    unsigned char* eax4;
    signed char* eax5;
    signed char al6;
    uint1_t cf7;
    struct s3* eax8;
    signed char al9;
    unsigned char* eax10;
    signed char tmp8_11;
    unsigned char tmp8_12;
    uint1_t cf13;
    struct s4* ebp14;
    unsigned char* eax15;
    struct s5* eax16;
    unsigned char tmp8_17;
    uint1_t cf18;

    ecx2 = ecx - 1;
    if (reinterpret_cast<uint1_t>(!!ecx2) & reinterpret_cast<uint1_t>(!zf3)) {
        __asm__("sti ");
        *eax4 = reinterpret_cast<unsigned char>(reinterpret_cast<signed char>(*eax5 + al6) + cf7);
        *reinterpret_cast<signed char*>(&eax8) = reinterpret_cast<signed char>(al9 + 17);
        eax10 = &eax8->f1;
        tmp8_11 = reinterpret_cast<signed char>(gc7004011 + *reinterpret_cast<signed char*>(&ecx2));
        gc7004011 = tmp8_11;
        tmp8_12 = reinterpret_cast<unsigned char>(*reinterpret_cast<unsigned char*>(&eax10) + 36);
        cf13 = reinterpret_cast<uint1_t>(tmp8_12 < *reinterpret_cast<unsigned char*>(&eax10));
        *reinterpret_cast<unsigned char*>(&eax10) = tmp8_12;
        *eax10 = reinterpret_cast<unsigned char>(reinterpret_cast<unsigned char>(*eax10 + *reinterpret_cast<unsigned char*>(&eax10)) + cf13);
        _puts(eax10, __return_address());
        goto ebp14->f4;
    } else {
__section("SectionForFlashOperations") Native_Profiler::Native_Profiler()
{
    if(s_native_profiler.isOn)
    {
        s_native_profiler.isOn = FALSE;
        s_native_profiler.writtenData = TRUE;
        UINT64 entryTime = Native_Profiler_TimeInMicroseconds() - s_native_profiler.initTime;
        functionAddress = __return_address();

        if(s_native_profiler.useBuffer)
        {
            *s_native_profiler.position++ = functionAddress;
            *s_native_profiler.position++ = (UINT32)(entryTime);
            if((s_native_profiler.position + 2) >= &ProfilerBufferEnd)
            {
                *s_native_profiler.position++ = NATIVE_PROFILER_END_TAG;
                Native_Profiler_Dump();
            }
        }
        else
        {
            UINT32 tempBuffer[2];
            tempBuffer[0] = functionAddress;
            tempBuffer[1] = (UINT32)(entryTime);
            Native_Profiler_WriteToCOM(tempBuffer, 8);
        }
        s_native_profiler.isOn = TRUE;
    }
}
void __libc_csu_fini() {
    int32_t v1;
    int32_t v2;
    int32_t ebp3;
    int32_t v4;
    int32_t ebx5;
    int32_t v6;
    int32_t eax7;
    int32_t ebx8;
    int32_t edx9;

    v1 = reinterpret_cast<int32_t>(__return_address());
    v2 = ebp3;
    v4 = ebx5;
    v6 = eax7;
    ebx8 = -1;
    if (0) {
        do {
            *reinterpret_cast<int32_t*>(ebx8 * 4 + 0x80494a4)(v6);
            edx9 = ebx8;
            --ebx8;
        } while (edx9);
    }
    fun_8048482(edx9, v4, v2, v1);
}
void fun_4017a3() {
    int32_t eax1;
    signed char* eax2;

    eax2 = reinterpret_cast<signed char*>(*reinterpret_cast<int32_t*>(eax1 + 0x4017)(__return_address()));
    *eax2 = reinterpret_cast<signed char>(*eax2 + *reinterpret_cast<signed char*>(&eax2));
}
Beispiel #5
0
void *aos_realloc(void *mem, unsigned int size)
{
    void *tmp = NULL;

#if (RHINO_CONFIG_MM_DEBUG > 0u && RHINO_CONFIG_GCC_RETADDR > 0u)
    if ((size & AOS_UNSIGNED_INT_MSB) == 0) {
        tmp = krhino_mm_realloc(mem, size | AOS_UNSIGNED_INT_MSB);

#ifndef AOS_BINS
#if defined (__CC_ARM)
        krhino_owner_attach(g_kmm_head, tmp, __return_address());
#elif defined (__GNUC__)
        krhino_owner_attach(g_kmm_head, tmp, (size_t)__builtin_return_address(0));
#endif /* __CC_ARM */
#endif
    } else {
        tmp = krhino_mm_realloc(mem, size);
    }

#else
    tmp = krhino_mm_realloc(mem, size);
#endif

    return tmp;
}
void _start() {
    void* esp1;
    int32_t edx2;
    int32_t eax3;

    esp1 = reinterpret_cast<void*>(reinterpret_cast<int32_t>(__zero_stack_offset()) + 4);
    __libc_start_main(main, __return_address(), esp1, __libc_csu_init, __libc_csu_fini, edx2, (reinterpret_cast<uint32_t>(esp1) & 0xfffffff0) - 4 - 4, eax3);
    __asm__("hlt ");
}
void fun_80482a6() {
    int32_t eax1;
    struct s0* ebp2;

    eax1 = *reinterpret_cast<int32_t*>(reinterpret_cast<int32_t>(__return_address()) + 0x12e6 + 20);
    if (eax1) {
        eax1();
    }
    goto ebp2->f4;
}
void fun_8048982(int32_t a1, int32_t a2) {
    int32_t* edx3;
    void* v4;

    edx3 = reinterpret_cast<int32_t*>(reinterpret_cast<int32_t>(*reinterpret_cast<void**>(reinterpret_cast<int32_t>(__return_address()) + 0x1052 + 28)) - 8);
    if (*edx3) {
        v4 = *reinterpret_cast<void**>(reinterpret_cast<int32_t>(__return_address()) + 0x1052 + 28);
        *edx3(v4);
    }
    goto a2;
}
void _init(int32_t a1, void* a2, int32_t a3, int32_t a4, int32_t a5, int32_t a6, int32_t a7) {
    int32_t ebx8;
    int32_t* edx9;
    void* v10;

    fun_8048982(ebx8, __return_address());
    edx9 = reinterpret_cast<int32_t*>(reinterpret_cast<int32_t>(*reinterpret_cast<void**>(ebx8 + 0x1052 + 28)) - 8);
    if (*edx9) {
        v10 = *reinterpret_cast<void**>(ebx8 + 0x1052 + 28);
        *edx9(v10);
    }
    goto a1;
}
Beispiel #10
0
int32_t __alloca(int32_t ecx) {
    int32_t v2;
    void* ecx3;
    uint32_t eax4;
    uint32_t* ecx5;

    v2 = reinterpret_cast<int32_t>(__return_address());
    ecx3 = reinterpret_cast<void*>(reinterpret_cast<int32_t>(__zero_stack_offset()) - 4 + 8);
    while (eax4 >= 0x1000) {
        ecx3 = reinterpret_cast<void*>(reinterpret_cast<int32_t>(ecx3) - 0x1000);
        eax4 = eax4 - 0x1000;
    }
    ecx5 = reinterpret_cast<uint32_t*>(reinterpret_cast<int32_t>(ecx3) - eax4);
    *ecx5 = *ecx5;
    return v2;
}
Beispiel #11
0
void *krhino_mm_alloc(size_t size)
{
    void *tmp;

#if (RHINO_CONFIG_MM_DEBUG > 0u && RHINO_CONFIG_GCC_RETADDR > 0u)
    uint32_t app_malloc = size & AOS_UNSIGNED_INT_MSB;
    size = size & (~AOS_UNSIGNED_INT_MSB);
#endif

    if (size == 0) {
        printf("WARNING, malloc size = 0\r\n");
        return NULL;
    }

    tmp = k_mm_alloc(g_kmm_head, size);
    if (tmp == NULL) {
#if (RHINO_CONFIG_MM_DEBUG > 0)
        static int32_t dumped;
        printf("WARNING, malloc failed!!!!\r\n");
        if (dumped) {
            return tmp;
        }
        dumped = 1;
        dumpsys_mm_info_func(0);
#if (RHINO_CONFIG_MM_LEAKCHECK > 0)
        dump_mmleak();
#endif
        k_err_proc(RHINO_NO_MEM);
#endif
    }

#if (RHINO_CONFIG_USER_HOOK > 0)
    krhino_mm_alloc_hook(tmp, size);
#endif

#if (RHINO_CONFIG_MM_DEBUG > 0u && RHINO_CONFIG_GCC_RETADDR > 0u)
    if (app_malloc == 0) {
#if defined (__CC_ARM)
        krhino_owner_attach(g_kmm_head, tmp, __return_address());
#elif defined (__GNUC__)
        krhino_owner_attach(g_kmm_head, tmp, (size_t)__builtin_return_address(0));
#endif /* __CC_ARM */
    }
#endif

    return tmp;
}
Beispiel #12
0
void *krhino_mm_realloc(void *oldmem, size_t newsize)
{
    void *tmp;

#if (RHINO_CONFIG_MM_DEBUG > 0u && RHINO_CONFIG_GCC_RETADDR > 0u)
    uint32_t app_malloc = newsize & AOS_UNSIGNED_INT_MSB;
    newsize = newsize & (~AOS_UNSIGNED_INT_MSB);
#endif

    tmp = k_mm_realloc(g_kmm_head, oldmem, newsize);

#if (RHINO_CONFIG_MM_DEBUG > 0u && RHINO_CONFIG_GCC_RETADDR > 0u)
    if (app_malloc == 0) {
#if defined (__CC_ARM)
        krhino_owner_attach(g_kmm_head, tmp, __return_address());
#elif defined (__GNUC__)
        krhino_owner_attach(g_kmm_head, tmp, (size_t)__builtin_return_address(0));
#endif /* __CC_ARM */
    }
#endif
    if (tmp == NULL && newsize != 0) {
#if (RHINO_CONFIG_MM_DEBUG > 0)
        static int32_t reallocdumped;
        printf("WARNING, realloc failed!!!!\r\n");
        if (reallocdumped) {
            return tmp;
        }
        reallocdumped = 1;
        dumpsys_mm_info_func(0);
#if (RHINO_CONFIG_MM_LEAKCHECK > 0)
        dump_mmleak();
#endif
        k_err_proc(RHINO_SYS_FATAL_ERR);
#endif
    }
    return tmp;
}
Beispiel #13
0
void _start(int32_t ecx) {
    void* ebp2;
    int32_t edx3;
    int32_t edx4;
    void* edx5;
    int32_t eax6;

    ebp2 = reinterpret_cast<void*>(reinterpret_cast<int32_t>(__zero_stack_offset()) - 4 - 4);
    if (!0) {
        atexit(edx3, 0, 0, __return_address());
    }
    atexit(_fini, edx3, 0, 0);
    edx4 = reinterpret_cast<int32_t>(ebp2) + reinterpret_cast<int32_t>(__return_address()) * 4 + 16;
    environ = edx4;
    edx5 = reinterpret_cast<void*>(reinterpret_cast<int32_t>(ebp2) + 12);
    ___Argv = edx5;
    __fpstart(__return_address(), edx5, edx4, _fini, edx3, 0, 0);
    __fsr(ecx, __return_address(), edx5, edx4, _fini, edx3, 0, 0);
    _init(__return_address(), edx5, edx4, _fini, edx3, 0, 0);
    eax6 = main(__return_address(), edx5, edx4, _fini, edx3, 0, 0);
    exit(eax6, _fini, edx3, 0, 0);
    fun_70(0, eax6, _fini, edx3, 0, 0);
    __asm__("hlt ");
}
Beispiel #14
0
void fun_80489aa(int32_t a1, int32_t a2) {
    void* ecx3;
    int32_t* edx4;

    ecx3 = reinterpret_cast<void*>(reinterpret_cast<int32_t>(*reinterpret_cast<void**>(reinterpret_cast<int32_t>(__return_address()) + 0x102a + 32)) - 16);
    edx4 = reinterpret_cast<int32_t*>(reinterpret_cast<int32_t>(ecx3) - 4);
    if (*edx4) {
        *edx4(ecx3);
    }
    goto a2;
}
Beispiel #15
0
void _fini() {
    int32_t ebx1;

    fun_80489aa(ebx1, __return_address());
}