Sie sind auf Seite 1von 7

void ConnectExt(byte *param_1,undefined4 *param_2)

{
/* 0xd9f0 34 ConnectExt */
FUN_1000d290(param_1,param_2);
return;
}

void __cdecl FUN_1000d290(byte *param_1,undefined4 *param_2)

{
byte bVar1;
void **ppvVar2;
int **_Memory;
void **ppvVar3;
int iVar4;
byte *pbVar5;
undefined4 uVar6;
undefined4 uVar7;
int *piVar8;
char *lpOutputString;
undefined4 this;
undefined4 this_00;
byte *this_01;
undefined4 this_02;
undefined4 this_03;
undefined4 this_04;
undefined4 this_05;
undefined4 this_06;
undefined4 this_07;
undefined4 this_08;
undefined4 this_09;
undefined4 this_10;
undefined4 this_11;
undefined4 this_12;
undefined4 this_13;
byte *pbVar9;
bool bVar10;
undefined4 uVar11;
void **ppvVar12;
undefined4 *puVar13;
undefined4 *local_114;
void **local_110;
int local_10c;
byte *local_108;
char local_104;
int local_103 [31];
char local_84;
int local_83 [31];
uint local_4;

local_4 = DAT_1003d220 ^ (uint)&local_114;


local_114 = param_2;
local_108 = (byte *)0x0;
local_10c = 0;
local_84 = '\0';
FUN_100150e0(local_83,0,0x7f);
local_104 = '\0';
FUN_100150e0(local_103,0,0x7f);
local_110 = FUN_10010cc0((uint *)&DAT_1003738e);
ppvVar2 = FUN_10010cc0((uint *)&DAT_1003738e);
_Memory = (int **)_malloc(0x1488);
ppvVar3 = FUN_10010cc0((uint *)&DAT_100384fc);
if ((((_Memory == (int **)0x0) || (ppvVar3 == (void **)0x0)) || (local_110 ==
(void **)0x0)) ||
(ppvVar2 == (void **)0x0)) {
FUN_10014570(_Memory);
FUN_1000fda0(ppvVar3);
FUN_1000fda0(ppvVar2);
FUN_1000fda0(ppvVar2);
DAT_1003e52c = 0xffffff96;
*local_114 = 0xffffff96;
goto LAB_1000d9d2;
}
if (local_114 == (undefined4 *)0x0) {
FUN_10014570(_Memory);
FUN_1000fda0(ppvVar3);
FUN_1000fda0(ppvVar2);
FUN_1000fda0(ppvVar2);
DAT_1003e52c = 0xffffff96;
*local_114 = 0xffffff96;
goto LAB_1000d9d2;
}
DAT_1003e52c = 0;
*local_114 = 0;
FUN_100150e0((int *)_Memory,0,0x1488);
iVar4 = FUN_10010240((int *)ppvVar3,param_1,(int)&DAT_100384f8);
if (iVar4 == -1) {
DAT_1003e52c = 0xffffff96;
*local_114 = 0xffffff96;
goto LAB_1000d9d2;
}
piVar8 = (int *)FUN_10010eb0(this,(int *)ppvVar3,(byte *)"timeout",30000);
_Memory[0x104] = piVar8;
pbVar5 = FUN_10010e60(this_00,(int *)ppvVar3,(byte *)"protocol");
_Memory[0x103] = (int *)0x2000;
if (pbVar5 != (byte *)0x0) {
pbVar9 = &DAT_100376d8;
this_01 = pbVar5;
do {
bVar1 = *this_01;
bVar10 = bVar1 < *pbVar9;
if (bVar1 != *pbVar9) {
LAB_1000d428:
iVar4 = (1 - (uint)bVar10) - (uint)(bVar10 != false);
goto LAB_1000d42d;
}
if (bVar1 == 0) break;
bVar1 = this_01[1];
bVar10 = bVar1 < pbVar9[1];
if (bVar1 != pbVar9[1]) goto LAB_1000d428;
this_01 = this_01 + 2;
pbVar9 = pbVar9 + 2;
} while (bVar1 != 0);
iVar4 = 0;
LAB_1000d42d:
if (iVar4 == 0) {
puVar13 = local_114;
pbVar5 = FUN_10010e60(this_01,(int *)ppvVar3,(byte *)"passwd");
uVar11 = 0;
ppvVar12 = ppvVar3;
uVar6 = FUN_10010eb0(this_02,(int *)ppvVar3,(byte *)"baudrate",0x1c200);
uVar7 = FUN_10010eb0(this_03,(int *)ppvVar3,(byte *)"deviceid",1);
this_01 = FUN_10010e60(this_04,(int *)ppvVar3,&DAT_10038890);
piVar8 = (int
*)ZEMBPRO_INITExt("plrscomm.dll",this_01,uVar7,uVar6,uVar11,ppvVar12,pbVar5,
puVar13);
_Memory[0x103] = (int *)0x4000;
}
else {
pbVar9 = &DAT_100386d8;
this_01 = pbVar5;
do {
bVar1 = *this_01;
bVar10 = bVar1 < *pbVar9;
if (bVar1 != *pbVar9) {
LAB_1000d4c0:
iVar4 = (1 - (uint)bVar10) - (uint)(bVar10 != false);
goto LAB_1000d4c5;
}
if (bVar1 == 0) break;
bVar1 = this_01[1];
bVar10 = bVar1 < pbVar9[1];
if (bVar1 != pbVar9[1]) goto LAB_1000d4c0;
this_01 = this_01 + 2;
pbVar9 = pbVar9 + 2;
} while (bVar1 != 0);
iVar4 = 0;
LAB_1000d4c5:
ppvVar12 = ppvVar3;
puVar13 = local_114;
if (iVar4 == 0) {
pbVar5 = FUN_10010e60(this_01,(int *)ppvVar3,(byte *)"passwd");
uVar11 = 0;
uVar6 = FUN_10010eb0(this_05,(int *)ppvVar3,(byte *)"baudrate",0x1c200);
uVar7 = FUN_10010eb0(this_06,(int *)ppvVar3,(byte *)"deviceid",1);
this_01 = FUN_10010e60(this_07,(int *)ppvVar3,&DAT_10038890);
lpOutputString = "plrscomm.dll";
LAB_1000d69f:
piVar8 = (int
*)ZEMBPRO_INITExt(lpOutputString,this_01,uVar7,uVar6,uVar11,ppvVar12,pbVar5,
puVar13);
_Memory[0x103] = (int *)0x2000;
}
else {
pbVar9 = &DAT_100386c8;
this_01 = pbVar5;
do {
bVar1 = *this_01;
bVar10 = bVar1 < *pbVar9;
if (bVar1 != *pbVar9) {
LAB_1000d545:
iVar4 = (1 - (uint)bVar10) - (uint)(bVar10 != false);
goto LAB_1000d54a;
}
if (bVar1 == 0) break;
bVar1 = this_01[1];
bVar10 = bVar1 < pbVar9[1];
if (bVar1 != pbVar9[1]) goto LAB_1000d545;
this_01 = this_01 + 2;
pbVar9 = pbVar9 + 2;
} while (bVar1 != 0);
iVar4 = 0;
LAB_1000d54a:
if (iVar4 == 0) {
pbVar5 = FUN_10010e60(local_114,(int *)ppvVar3,(byte *)"passwd");
uVar11 = 0;
uVar7 = 0;
uVar6 = FUN_10010eb0(this_08,(int *)ppvVar3,&DAT_10038890,0x1112);
this_01 = FUN_10010e60(this_09,(int *)ppvVar3,(byte *)"ipaddress");
piVar8 = (int
*)ZEMBPRO_INITExt("plcomms.dll",this_01,uVar6,uVar7,uVar11,ppvVar12,pbVar5,
puVar13);
_Memory[0x103] = (int *)0x20000;
}
else {
pbVar9 = &DAT_10037a20;
this_01 = pbVar5;
do {
bVar1 = *this_01;
bVar10 = bVar1 < *pbVar9;
if (bVar1 != *pbVar9) {
LAB_1000d5d0:
iVar4 = (1 - (uint)bVar10) - (uint)(bVar10 != false);
goto LAB_1000d5d5;
}
if (bVar1 == 0) break;
bVar1 = this_01[1];
bVar10 = bVar1 < pbVar9[1];
if (bVar1 != pbVar9[1]) goto LAB_1000d5d0;
this_01 = this_01 + 2;
pbVar9 = pbVar9 + 2;
} while (bVar1 != 0);
iVar4 = 0;
LAB_1000d5d5:
if (iVar4 != 0) {
this_01 = &DAT_100376d4;
do {
bVar1 = *pbVar5;
bVar10 = bVar1 < *this_01;
if (bVar1 != *this_01) {
LAB_1000d655:
iVar4 = (1 - (uint)bVar10) - (uint)(bVar10 != false);
goto LAB_1000d65a;
}
if (bVar1 == 0) break;
bVar1 = pbVar5[1];
bVar10 = bVar1 < this_01[1];
if (bVar1 != this_01[1]) goto LAB_1000d655;
pbVar5 = pbVar5 + 2;
this_01 = this_01 + 2;
} while (bVar1 != 0);
iVar4 = 0;
LAB_1000d65a:
if (iVar4 != 0) goto LAB_1000d6b3;
pbVar5 = FUN_10010e60(this_01,(int *)ppvVar3,(byte *)"passwd");
uVar11 = 0;
uVar6 = 0;
uVar7 = FUN_10010eb0(this_12,(int *)ppvVar3,&DAT_10038890,0x1112);
this_01 = FUN_10010e60(this_13,(int *)ppvVar3,(byte *)"ipaddress");
lpOutputString = "plusbcomm.dll";
goto LAB_1000d69f;
}
pbVar5 = FUN_10010e60(this_01,(int *)ppvVar3,(byte *)"passwd");
uVar11 = 0;
uVar7 = 0;
uVar6 = FUN_10010eb0(this_10,(int *)ppvVar3,&DAT_10038890,0x1112);
this_01 = FUN_10010e60(this_11,(int *)ppvVar3,(byte *)"ipaddress");
piVar8 = (int
*)ZEMBPRO_INITExt("pltcpcomm.dll",this_01,uVar6,uVar7,uVar11,ppvVar12,pbVar5
,puVar13);
_Memory[0x103] = (int *)0x10000;
}
}
}
*_Memory = piVar8;
}
LAB_1000d6b3:
FUN_1000fda0(ppvVar3);
iVar4 = PullLastError();
_sprintf(&local_84,"EMBUDP_ERROR last error %d\n",iVar4);
FUN_10004260();
if (*_Memory == (int *)0x0) {
_free(_Memory);
FUN_1000fda0(local_110);
FUN_1000fda0(ppvVar2);
}
else {
local_10c = 6;
local_108 = (byte *)0x1000;
ZEMBPRO_READCMDDATA((int)*_Memory,(ushort *)&local_10c,(byte **)(_Memory +
0x11e),&local_108,0,
(int)_Memory[0x104] * 0x1e);
ppvVar3 = local_110;
if (local_10c == 200) {
iVar4 = FUN_10010320((int *)local_110,(byte *)(_Memory + 0x11e));
if (iVar4 == -1) {
DAT_1003e52c = 0xffffff96;
*local_114 = 0xffffff96;
LAB_1000d7a8:
Disconnect(_Memory);
FUN_1000fda0(ppvVar3);
FUN_1000fda0(ppvVar2);
}
else {
local_110 = (void **)0x0;
if (0 < (int)ppvVar3[4]) {
do {
iVar4 = FUN_10010240((int *)ppvVar2,*(byte **)((int)ppvVar3[1] +
(int)local_110 * 4),
(int)&DAT_100384f8);
if (iVar4 == -1) {
DAT_1003e52c = 0xffffff96;
*local_114 = 0xffffff96;
goto LAB_1000d7a8;
}
lpOutputString = FUN_100106f0((int)ppvVar2,0,&local_104,0x80);
if (0 < (int)lpOutputString) {
OutputDebugStringA("rtlog tablename=\r\n");
OutputDebugStringA(&local_104);
OutputDebugStringA((LPCSTR)&lpOutputString_10038750);
iVar4 = __stricmp(&local_104,"realtimelog");
if (iVar4 == 0) {
lpOutputString = FUN_10010620((int)ppvVar2,0);
FUN_10014f91(lpOutputString);
_Memory[0x51e] = (int *)0x1;
lpOutputString = "rtlog 111\r\n";
LAB_1000d911:
OutputDebugStringA(lpOutputString);
}
else {
iVar4 = __stricmp(&local_104,"accessrtlog");
if (iVar4 == 0) {
lpOutputString = FUN_10010620((int)ppvVar2,0);
FUN_10014f91(lpOutputString);
_Memory[0x51e] = (int *)0x2;
lpOutputString = "rtlog 222\r\n";
goto LAB_1000d911;
}
iVar4 = __stricmp(&local_104,"accessrtlog2");
if (iVar4 == 0) {
lpOutputString = FUN_10010620((int)ppvVar2,0);
FUN_10014f91(lpOutputString);
_Memory[0x51e] = (int *)0x3;
lpOutputString = "rtlog 333\r\n";
goto LAB_1000d911;
}
iVar4 = __stricmp(&local_104,"transaction8Bcard");
if (iVar4 == 0) {
lpOutputString = FUN_10010620((int)ppvVar2,0);
FUN_10014f91(lpOutputString);
_Memory[0x51e] = (int *)0x4;
lpOutputString = "rtlog 444\r\n";
goto LAB_1000d911;
}
}
iVar4 = __stricmp(&local_104,"logfmt");
if (iVar4 == 0) {
lpOutputString = FUN_10010620((int)ppvVar2,0);
FUN_10014f91(lpOutputString);
_Memory[0x51f] = (int *)0x1;
OutputDebugStringA("rtlog 555\r\n");
}
OutputDebugStringA("=====\r\n");
}
local_110 = (void **)((int)local_110 + 1);
} while ((int)local_110 < (int)ppvVar3[4]);
}
FUN_1000fda0(ppvVar3);
FUN_1000fda0(ppvVar2);
piVar8 = (int *)CreateMutexA((LPSECURITY_ATTRIBUTES)0x0,0,(LPCSTR)0x0);
_Memory[0x520] = piVar8;
}
}
else {
DAT_1003e52c = 0xffffff95;
*local_114 = 0xffffff95;
Disconnect(_Memory);
FUN_1000fda0(local_110);
FUN_1000fda0(ppvVar2);
}
}
LAB_1000d9d2:
FUN_100151e6();
return;
}

Das könnte Ihnen auch gefallen