Skip to content

Instantly share code, notes, and snippets.

@puppykitten
Created January 28, 2018 01:21
Show Gist options
  • Save puppykitten/c4d63c708c1b03146c6f744c0c5510c3 to your computer and use it in GitHub Desktop.
Save puppykitten/c4d63c708c1b03146c6f744c0c5510c3 to your computer and use it in GitHub Desktop.
v3 = argc;
v4 = argv;
__android_log_print(4LL, "TLC_SERVER", "tlc_cerver main starts");
if ( v3 == 1 )
{
__android_log_print(4LL, "TLC_SERVER", "service name was not provided: defaulting to CCM");
strncpy(&service_name, aCCM, 31LL);
}
else
{
if ( v3 != 2 )
{
v6 = -1;
__android_log_print(6LL, "TLC_SERVER", "usage: tlc_server <CCM|DCM|ESECOMM|TUI|PUF>");
goto LABEL_15;
}
v5 = v4[1];
if ( (unsigned __int64)strnlen(v4[1], 32LL) > 0x1F )
{
v6 = -1;
__android_log_print(6LL, "TLC_SERVER", "too long g_service_name");
goto LABEL_15;
}
strncpy(&service_name, v5, 31LL);
__android_log_print(4LL, "TLC_SERVER", "Service Name = %s", &service_name);
if ( (unsigned int)strcmp("CCM", &service_name)
&& (unsigned int)strcmp("DCM", &service_name)
&& (unsigned int)strcmp("ESECOMM", &service_name)
&& (unsigned int)strcmp("TUI", &service_name)
&& (unsigned int)strcmp("PUF", &service_name) )
{
v6 = -1;
__android_log_print(6LL, "TLC_SERVER", "Only 'CCM', 'DCM', 'ESECOMM', 'TUI', and 'PUF' are supported");
goto LABEL_15;
}
}
v28 = 0LL;
v29 = 0LL;
v30 = 0LL;
v31 = 0LL;
v32 = 0LL;
v33 = 0LL;
v34 = 0LL;
v35 = 0LL;
if ( (unsigned int)strcmp(&service_name, "CCM") )
{
if ( (unsigned int)strcmp(&service_name, "DCM") )
{
if ( (unsigned int)strcmp(&service_name, "ESECOMM") )
{
if ( (unsigned int)strcmp(&service_name, "TUI") )
{
if ( (unsigned int)strcmp(&service_name, "PUF") )
{
LABEL_14:
v6 = -1;
__android_log_print(6LL, "TLC_SERVER", "fill_comm_data failed!");
goto LABEL_15;
}
strncpy(&v28, "libtlc_tz_puf_km.so", 31LL);
strncpy(&v32, "puf_get_comm_data", 31LL);
}
else
{
strncpy(&v28, "libtlc_tima_tui.so", 31LL);
strncpy(&v32, "tui_get_comm_data", 31LL);
}
}
else
{
strncpy(&v28, "libtlc_tz_esecomm.so", 31LL);
strncpy(&v32, "esecomm_get_comm_data", 31LL);
}
}
else
{
strncpy(&v28, "libtlc_tz_dcm.so", 31LL);
strncpy(&v32, "dcm_get_comm_data", 31LL);
}
}
else
{
strncpy(&v28, "libtlc_tz_ccm.so", 31LL);
strncpy(&v32, "ccm_get_comm_data", 31LL);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment