void build_iptable_cmd(int param_1,int param_2)
{
char *pcVar1;
undefined4 uVar2;
char *__s;
int iVar3;
int iVar4;
char local_a8 [132];
__s = local_a8;
iVar3 = 0;
iVar4 = param_2;
do {
if (*(int *)(param_2 + 8) <= iVar3) {
if ((*(uint *)(param_2 + 0xc) & 1) != 0) {
uVar2 = 0x41;
if (param_1 == 0) {
uVar2 = 0x44;
}
lrgbin_system("iptables -t nat -%c %s -p udp -m mport --ports %s -j DNAT --to-destination %s"
,uVar2,param_2 + 0x20,local_a8,param_2 + 0x10) //possible issue identified - semgrep
}
if ((*(uint *)(param_2 + 0xc) & 2) != 0) {
uVar2 = 0x41;
if (param_1 == 0) {
uVar2 = 0x44;
}
lrgbin_system("iptables -t nat -%c %s -p tcp -m mport --ports %s -j DNAT --to-destination %s"
,uVar2,param_2 + 0x20,local_a8,param_2 + 0x10) //possible issue identified - semgrep
}
return;
}
sprintf(__s,"%d",(uint)*(ushort *)(iVar4 + 0x40)) //possible issue identified - semgrep
pcVar1 = __s;
do {
__s = pcVar1;
pcVar1 = __s + 1;
} while (*__s != '\0');
if (*(int *)(iVar4 + 0x40) < 0) {
*__s = ':';
LAB_00400c60:
__s = __s + 1;
}
else if (iVar3 + 1 < *(int *)(param_2 + 8)) {
*__s = ',';
goto LAB_00400c60;
}
iVar3 = iVar3 + 1;
iVar4 = iVar4 + 4;
} while( true );
}