Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
set_time_limit(0);umask(23);chdir(__DIR__);require_once(__DIR__ ."/functions.php");array_..
Decoded Output download
<? set_time_limit(0);umask(23);chdir(__DIR__);require_once(__DIR__ ."/functions.php");array_shift($_SERVER["argv"]);parse_str(implode("&",$_SERVER["argv"]),$_3922c901e0b28c5dadecb3206eb4b6e7);$_f31403c3aff4b6cf3e01ad5b8a639a26=$_3922c901e0b28c5dadecb3206eb4b6e7['--generator-id']?$_3922c901e0b28c5dadecb3206eb4b6e7['--generator-id']:1;$_17660b42bc80e4b67b16398ff96c4983=0;$_8b7ccc66e6c1430f4f8f6386943d47c5=getenv("tvcas_ident");$GLOBALS["pid_file"]=false;$_46b4496d0d72737b7435373345c71782=(getenv("tvcas_emmg_guard")=== false?true:false);if(!$_46b4496d0d72737b7435373345c71782){unset($GLOBALS["pid_file"]);}openlog("emmg" .(($_8b7ccc66e6c1430f4f8f6386943d47c5 === false?"":"_" .$_8b7ccc66e6c1430f4f8f6386943d47c5)) ."_" .$_f31403c3aff4b6cf3e01ad5b8a639a26,LOG_ODELAY|LOG_PID,LOG_LOCAL0);posix_setsid();if($_46b4496d0d72737b7435373345c71782){if($GLOBALS["pid_file"]=== false){$GLOBALS["pid_file"]="/var/run/" .(($_8b7ccc66e6c1430f4f8f6386943d47c5 === false?"":$_8b7ccc66e6c1430f4f8f6386943d47c5 ."_")) ."emmg_" .$_f31403c3aff4b6cf3e01ad5b8a639a26 .".pid";}else{}if(is_file($GLOBALS["pid_file"])){exit();}if(@file_put_contents($GLOBALS["pid_file"],@posix_getpid())=== false){exit();}else{}putenv("tvcas_emmg_guard=42");while(true){$GLOBALS["main_pid"]=pcntl_fork();if($GLOBALS["main_pid"]==-1){}if($GLOBALS["main_pid"]== 0){posix_setsid();pcntl_exec(__FILE__,$_SERVER["argv"]);}while(true){if(pcntl_wait($_70c91ec8ae73da6e0d06a23b77284d6f,WNOHANG)!= 0){break;}sleep(1);}sleep(10);}}$_bd2f6b7099f63c13661505878c997822="UPDATE `tvcas_emmg` SET `reload`='0', `touch_version`='0', `touch_time`='0' WHERE `id`='" .$_f31403c3aff4b6cf3e01ad5b8a639a26 ."'";if(!_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822))exit();$_bd2f6b7099f63c13661505878c997822="SELECT `id`, `network_id`, `host`, `port`, `protocol_version`, `packet_mode`, `bandwidth`, `repetition`, `period`, `period_messages`, `channel_test_delay`, `stream_test_delay`, `timeout`, `client_id`, `version`, `uid` FROM `tvcas_emmg` WHERE `status`='1' AND `d_id`='0' AND `id`='" .$_f31403c3aff4b6cf3e01ad5b8a639a26 ."'";if(!($_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822)))exit();if(mysql_num_rows($_c2effa87aba581049d65f293b1f8e656)== 0)exit;$_8a931fbb2920df84e4fedb38ec3bbbae=array("config"=> mysql_fetch_assoc($_c2effa87aba581049d65f293b1f8e656),"slots"=> (int)$_abe27c8cb6f0b93676f1d1d982f46f73["slot_cnt"],"state"=> 0,"status"=> array("channel_time_open"=> 0,"stream_time_open"=> 0,"error_time_last"=> 0,"error_count"=> 0,"datagram_time_last"=> 0,"datagram_count"=> 0,"queue_size"=> 0),"keys"=> array(),"pair"=> array(),"type"=> array(),"cache"=> array(),"cache_max_id"=> 0,"queue"=> array(),"delay"=> array(),"reload"=>0);$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["period"]*= 86400;$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["period_messages"]*= 86400;if($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["repetition"]<60){$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["repetition"]=60;}if($_8a931fbb2920df84e4fedb38ec3bbbae["slots"]== 0){$_8a931fbb2920df84e4fedb38ec3bbbae["slots"]=128;}if(!_8a86f278e26806deefa5cd6557438559(0,$_8a931fbb2920df84e4fedb38ec3bbbae))exit();if(!_de311db2b4eb4bcfb81ddc79dc7b02d6(0,$_8a931fbb2920df84e4fedb38ec3bbbae))exit();$GLOBALS["pid_main"]=posix_getpid();$GLOBALS["pid_connect"]=0;$GLOBALS["cache_reload"]=false;$GLOBALS["queue_reload"]=false;_1f868f50d8d475e1b390495be9d1d011();$GLOBALS["pid_connect"]=pcntl_fork();switch($GLOBALS["pid_connect"]){case-1:exit();case 0:if(!_5e4dd7abba14aded68d6e912032ac235($_8a931fbb2920df84e4fedb38ec3bbbae)){exit();}exit();}_2b4fabe9bad96db3a125946ffb479132("UPDATE `tvcas_emmg` SET `version`='1', `touch_version`='1' WHERE `id`='{$_f31403c3aff4b6cf3e01ad5b8a639a26}';");while(true){$_bd2f6b7099f63c13661505878c997822="UPDATE `tvcas_emmg` SET `touch_version`='{$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["version"]}', `touch_time`='" .time() ."' WHERE `id`='{$_f31403c3aff4b6cf3e01ad5b8a639a26}';";if(!_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822))break;sleep(60);}exit();function _8a86f278e26806deefa5cd6557438559($_62aa51fe8b897e07600b8eb2bfa74c3d,&$_8a931fbb2920df84e4fedb38ec3bbbae){$_213c632926e015ddc9a75dc57e727ac8=&$_8a931fbb2920df84e4fedb38ec3bbbae["keys"];$_296926ff383ae099cfa5ef4a0bc94c69=&$_8a931fbb2920df84e4fedb38ec3bbbae["pair"];$_de495d8c7de2fce304eb3d492bb32da8=&$_8a931fbb2920df84e4fedb38ec3bbbae["type"];$_bd2f6b7099f63c13661505878c997822="SELECT `serial_no`,`key`,`pair`,`type` FROM `tvcas_smartcards`;";$_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822);$_55b80204d943f74052c7abe56a28a90d=mysql_num_rows($_c2effa87aba581049d65f293b1f8e656);while($_90ed64522525df53df98e39a88d8ad5e=mysql_fetch_assoc($_c2effa87aba581049d65f293b1f8e656)){$_213c632926e015ddc9a75dc57e727ac8[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]]=$_90ed64522525df53df98e39a88d8ad5e["key"];$_296926ff383ae099cfa5ef4a0bc94c69[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]]=$_90ed64522525df53df98e39a88d8ad5e['pair'];$_de495d8c7de2fce304eb3d492bb32da8[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]]=$_90ed64522525df53df98e39a88d8ad5e['type'];}return true;}function _de311db2b4eb4bcfb81ddc79dc7b02d6($_62aa51fe8b897e07600b8eb2bfa74c3d,&$_8a931fbb2920df84e4fedb38ec3bbbae){$_213c632926e015ddc9a75dc57e727ac8=&$_8a931fbb2920df84e4fedb38ec3bbbae["keys"];$_296926ff383ae099cfa5ef4a0bc94c69=&$_8a931fbb2920df84e4fedb38ec3bbbae["pair"];$_de495d8c7de2fce304eb3d492bb32da8=&$_8a931fbb2920df84e4fedb38ec3bbbae["type"];$_2b9a37da9dade0edc57c38140bf3cc66=&$_8a931fbb2920df84e4fedb38ec3bbbae["cache"];$_d373938f402134d5a887690afd06ec2d=time();$_55b80204d943f74052c7abe56a28a90d=0;$_9c48841bce53d0fc75472484b7b9d87f=microtime(true);$_0fc190f972a3ec935d138bda6d0fb601=0;$_05d8bae6c454bfa2329007d5f7e2ec09=$_9c48841bce53d0fc75472484b7b9d87f;$_6fb8fa40c6d7ac19907993fb27baff98=microtime(true)-$_9c48841bce53d0fc75472484b7b9d87f;$_bd2f6b7099f63c13661505878c997822="SELECT * FROM `tvcas_smartcards` WHERE `edit`>" .($_d373938f402134d5a887690afd06ec2d-86400*7) ." OR (`start`<{$_d373938f402134d5a887690afd06ec2d} AND `finish`>{$_d373938f402134d5a887690afd06ec2d}) ORDER BY `edit` DESC;";$_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822);$_55b80204d943f74052c7abe56a28a90d=mysql_num_rows($_c2effa87aba581049d65f293b1f8e656);if($_55b80204d943f74052c7abe56a28a90d>0){while($_90ed64522525df53df98e39a88d8ad5e=mysql_fetch_assoc($_c2effa87aba581049d65f293b1f8e656)){$_90ed64522525df53df98e39a88d8ad5e['subscription_id']=0;if(!($_a8c88481163515e743ebbc01f351b86f=_e4a33c3dec83ec46bc55e3283aea5274($_62aa51fe8b897e07600b8eb2bfa74c3d,$_90ed64522525df53df98e39a88d8ad5e["serial_no"],$_90ed64522525df53df98e39a88d8ad5e['access_criteria'],$_213c632926e015ddc9a75dc57e727ac8[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]],$_296926ff383ae099cfa5ef4a0bc94c69[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]],$_de495d8c7de2fce304eb3d492bb32da8[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]],$_90ed64522525df53df98e39a88d8ad5e["start"],$_90ed64522525df53df98e39a88d8ad5e["finish"]))){continue;}if(!_a8301363198582b31050be7f824d3fb7($_8a931fbb2920df84e4fedb38ec3bbbae,$_a8c88481163515e743ebbc01f351b86f,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af)){continue;}$_2b9a37da9dade0edc57c38140bf3cc66[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]][$_90ed64522525df53df98e39a88d8ad5e["subscription_id"]]=pack("CLL",1,0,$_90ed64522525df53df98e39a88d8ad5e["finish"]) .$_a0878c824dfc65ce99ee5cceef69f126;if(++$_0fc190f972a3ec935d138bda6d0fb601%1000 == 0){$_6fb8fa40c6d7ac19907993fb27baff98=microtime(true)-$_05d8bae6c454bfa2329007d5f7e2ec09;$_05d8bae6c454bfa2329007d5f7e2ec09=microtime(true);}}}return true;}function _fa8f781a9dab45ff6985f860a04c24d6($_62aa51fe8b897e07600b8eb2bfa74c3d,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f){$_2b9a37da9dade0edc57c38140bf3cc66=&$_8a931fbb2920df84e4fedb38ec3bbbae["cache"];if(!isset($_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f])){$_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f]=array();}$_4939f0c763f91fdfed90e16924685111=&$_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f];$_d373938f402134d5a887690afd06ec2d=time();$_cd125632541fe3d0eb4f8e91513510a7=microtime(true);$_1465503b3c941ae041056c3eda84341c=0;$_f91b7255380327ff1ccea8735a607a68=0;foreach($_2b9a37da9dade0edc57c38140bf3cc66 as $_5f4b03ac7c0c99ec375648a0b2276ec3 => $_0ee80250908b20cbd55e64cd12f4d972){$_be8a07e5811e9481bffee972d7bafc25=array();$_d1e289d4aafde6cc87fd53837ff17035=0;$_7cbdcfc4e6a1292fa281756374656d05=0;krsort($_0ee80250908b20cbd55e64cd12f4d972);foreach($_0ee80250908b20cbd55e64cd12f4d972 as $_335f5638c854ec613eabec77e622cb57 => $_8dff77644a666b4f45bd68532d31ebde){$_e962e5723de7cb0c3a26b79a0c94df1f=unpack("Ca/Lp/Lt",$_8dff77644a666b4f45bd68532d31ebde);if($_e962e5723de7cb0c3a26b79a0c94df1f["t"]<$_d373938f402134d5a887690afd06ec2d){unset($_2b9a37da9dade0edc57c38140bf3cc66[$_5f4b03ac7c0c99ec375648a0b2276ec3][$_335f5638c854ec613eabec77e622cb57]);continue;}if($_d373938f402134d5a887690afd06ec2d<$_e962e5723de7cb0c3a26b79a0c94df1f["p"]){continue;}if($_e962e5723de7cb0c3a26b79a0c94df1f["a"]== 4 && 16<++$_7cbdcfc4e6a1292fa281756374656d05){unset($_2b9a37da9dade0edc57c38140bf3cc66[$_5f4b03ac7c0c99ec375648a0b2276ec3][$_335f5638c854ec613eabec77e622cb57]);continue;}$_be8a07e5811e9481bffee972d7bafc25[++$_d1e289d4aafde6cc87fd53837ff17035]=&$_2b9a37da9dade0edc57c38140bf3cc66[$_5f4b03ac7c0c99ec375648a0b2276ec3][$_335f5638c854ec613eabec77e622cb57];}if(!@$_d1e289d4aafde6cc87fd53837ff17035){$_f5b87977765c51f5bc5e427cfbf3c496=0;$_d1e289d4aafde6cc87fd53837ff17035=0;}if($_d1e289d4aafde6cc87fd53837ff17035!=0 and($_f5b87977765c51f5bc5e427cfbf3c496=(100/@$_d1e289d4aafde6cc87fd53837ff17035)%100)== 0){$_f5b87977765c51f5bc5e427cfbf3c496=17;}else{$_1465503b3c941ae041056c3eda84341c=0;}foreach($_be8a07e5811e9481bffee972d7bafc25 as $_335f5638c854ec613eabec77e622cb57 => $_8dff77644a666b4f45bd68532d31ebde){$_4939f0c763f91fdfed90e16924685111[$_1465503b3c941ae041056c3eda84341c%100*1000000+$_f91b7255380327ff1ccea8735a607a68]=&$_be8a07e5811e9481bffee972d7bafc25[$_335f5638c854ec613eabec77e622cb57];$_1465503b3c941ae041056c3eda84341c += $_f5b87977765c51f5bc5e427cfbf3c496;$_f91b7255380327ff1ccea8735a607a68++;}}ksort($_4939f0c763f91fdfed90e16924685111);if(($_9c679ee588c79363e5ab56a8268b4935=count($_4939f0c763f91fdfed90e16924685111))== 0){if(!($_a8c88481163515e743ebbc01f351b86f=_e4a33c3dec83ec46bc55e3283aea5274($_62aa51fe8b897e07600b8eb2bfa74c3d,2199999999,'FFFFFFFF','1234567890A0B1C21234567890A0B1C2',0,0,time()-86400,time()+300))){return false;}if(!_a8301363198582b31050be7f824d3fb7($_8a931fbb2920df84e4fedb38ec3bbbae,$_a8c88481163515e743ebbc01f351b86f,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af)){return false;}$_4939f0c763f91fdfed90e16924685111[]=pack("CLL",0,0,0) .$_a0878c824dfc65ce99ee5cceef69f126;$_9c679ee588c79363e5ab56a8268b4935=1;}$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["queue_size"]=$_9c679ee588c79363e5ab56a8268b4935;$_8a931fbb2920df84e4fedb38ec3bbbae["delay"][$_80ec94da3475f8096b59f5e5e6f49e3f]=(int)($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["repetition"]/$_9c679ee588c79363e5ab56a8268b4935*1000000);if(10000000<$_8a931fbb2920df84e4fedb38ec3bbbae["delay"][$_80ec94da3475f8096b59f5e5e6f49e3f]){$_8a931fbb2920df84e4fedb38ec3bbbae["delay"][$_80ec94da3475f8096b59f5e5e6f49e3f]=10000000;}$_6fb8fa40c6d7ac19907993fb27baff98=microtime(true)-$_cd125632541fe3d0eb4f8e91513510a7;return true;}function _430b95668ef615764a1e43e2e01a8169(&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_80ec94da3475f8096b59f5e5e6f49e3f,$_0d86f0dea505b92b26ae39288027d246,&$_87797b59aeab8d99233cfdd381df59b6,&$_ef8cbc9cb734afe54356ff14e136202a){$_4939f0c763f91fdfed90e16924685111=&$_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f];if(($_f0eba9a21ae7d12ac38c215d06ea090e=current($_4939f0c763f91fdfed90e16924685111))=== false){if($_0d86f0dea505b92b26ae39288027d246 != $_80ec94da3475f8096b59f5e5e6f49e3f){unset($_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f]);$_80ec94da3475f8096b59f5e5e6f49e3f=$_0d86f0dea505b92b26ae39288027d246;return _430b95668ef615764a1e43e2e01a8169($_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f,$_0d86f0dea505b92b26ae39288027d246,$_87797b59aeab8d99233cfdd381df59b6,$_ef8cbc9cb734afe54356ff14e136202a);}if(($_f0eba9a21ae7d12ac38c215d06ea090e=reset($_4939f0c763f91fdfed90e16924685111))=== false){return false;}}next($_4939f0c763f91fdfed90e16924685111);$_87797b59aeab8d99233cfdd381df59b6=substr($_f0eba9a21ae7d12ac38c215d06ea090e,9);$_ef8cbc9cb734afe54356ff14e136202a=strlen($_87797b59aeab8d99233cfdd381df59b6);return true;}function _d5d3b76a6825afb10b681aa8413bf434($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,2 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["packet_mode"]);if(($_6d1c7b3de0f582ef2e88d3ca30b5558d=_fd28f480a79251368fa29f0c68d6111f($_f9a7277e6a44b78ae9aadcc98214656d,19,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}_ebbaf9d5394fed4c871dadc2af8144d4((int) $_74f81bb92104f38a0274005786d91a0a ." S",$_6d1c7b3de0f582ef2e88d3ca30b5558d);if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@socket_send($_74f81bb92104f38a0274005786d91a0a,$_6d1c7b3de0f582ef2e88d3ca30b5558d,@strlen($_6d1c7b3de0f582ef2e88d3ca30b5558d),0))=== false){return false;}return true;}function _420e5d359e95c13df71d72e8048323bf($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["channel_time_open"]=time();return true;}function _8baabb2cc96a710e452965c6e96d9192($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_time_last"]=time();$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_count"]++;return true;}function _ffc5635aa054409e95a27a23ea09d9fc($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,4 => 1,8 => 1,7 => 0);if(($_6d1c7b3de0f582ef2e88d3ca30b5558d=_fd28f480a79251368fa29f0c68d6111f($_f9a7277e6a44b78ae9aadcc98214656d,275,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}_ebbaf9d5394fed4c871dadc2af8144d4((int) $_74f81bb92104f38a0274005786d91a0a ." S",$_6d1c7b3de0f582ef2e88d3ca30b5558d);if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@socket_send($_74f81bb92104f38a0274005786d91a0a,$_6d1c7b3de0f582ef2e88d3ca30b5558d,@strlen($_6d1c7b3de0f582ef2e88d3ca30b5558d),0))=== false){return false;}return true;}function _e58b2cd50abe1f18b5c8643ddd0cf403($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["stream_time_open"]=time();return true;}function _eba35ba1f5c413c0504895855e8bf4a7($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_time_last"]=time();$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_count"]++;return true;}function _5b1d2b9c38f151963025446faccd85b2($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){return true;}function _461164dbbcb192c7ce99b3d4e8a616e5($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126){if(($_225c258c4b6824b94ac05a09c5ab03d0=_7c62937caf595c68036f40a57081ac88($_a0878c824dfc65ce99ee5cceef69f126,$_f9a7277e6a44b78ae9aadcc98214656d,$_e9536e3e4c1124db4e57dbfae62cb40b,$_d7d8dce8a14bc703f55f15735959cc79))=== false){return false;}_ebbaf9d5394fed4c871dadc2af8144d4((int) $_74f81bb92104f38a0274005786d91a0a ." R",$_a0878c824dfc65ce99ee5cceef69f126);switch($_e9536e3e4c1124db4e57dbfae62cb40b){case 18:return _d5d3b76a6825afb10b681aa8413bf434($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 19:return _420e5d359e95c13df71d72e8048323bf($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 21:return _8baabb2cc96a710e452965c6e96d9192($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 20:return _269bfb6d71c5c765c3f1ac3e7f80fd2e($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 274:return _ffc5635aa054409e95a27a23ea09d9fc($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 275:return _e58b2cd50abe1f18b5c8643ddd0cf403($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 278:return _eba35ba1f5c413c0504895855e8bf4a7($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 276:return _c167e2b101ca413710cd9743f59fa24c($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 280:return _5b1d2b9c38f151963025446faccd85b2($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);}return true;}function _5a7c9cf3fe1b3046f51b0a3b26d6a926(&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_a0878c824dfc65ce99ee5cceef69f126,&$_a0ba494fa24777d6fd79b9f5bb2127af){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,2 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["packet_mode"]);if(($_a0878c824dfc65ce99ee5cceef69f126=_fd28f480a79251368fa29f0c68d6111f($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["protocol_version"],17,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}$_a0ba494fa24777d6fd79b9f5bb2127af=strlen($_a0878c824dfc65ce99ee5cceef69f126);return true;}function _35adbe974f2f5958e82bd93228987147(&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_a0878c824dfc65ce99ee5cceef69f126,&$_a0ba494fa24777d6fd79b9f5bb2127af){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,4 => 1,8 => 1,7 => 0);if(($_a0878c824dfc65ce99ee5cceef69f126=_fd28f480a79251368fa29f0c68d6111f($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["protocol_version"],273,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}$_a0ba494fa24777d6fd79b9f5bb2127af=strlen($_a0878c824dfc65ce99ee5cceef69f126);return true;}function _1d52bd338924fd49d851789520ef2cb8(&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_a0878c824dfc65ce99ee5cceef69f126,&$_a0ba494fa24777d6fd79b9f5bb2127af){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,4 => 1,6 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["bandwidth"]);if(($_a0878c824dfc65ce99ee5cceef69f126=_fd28f480a79251368fa29f0c68d6111f($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["protocol_version"],279,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}$_a0ba494fa24777d6fd79b9f5bb2127af=strlen($_a0878c824dfc65ce99ee5cceef69f126);return true;}function _a8301363198582b31050be7f824d3fb7(&$_8a931fbb2920df84e4fedb38ec3bbbae,$_a8c88481163515e743ebbc01f351b86f,&$_a0878c824dfc65ce99ee5cceef69f126,&$_a0ba494fa24777d6fd79b9f5bb2127af){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,4 => 1,8 => 1,5 => $_a8c88481163515e743ebbc01f351b86f);if(($_a0878c824dfc65ce99ee5cceef69f126=_fd28f480a79251368fa29f0c68d6111f($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["protocol_version"],529,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}$_a0ba494fa24777d6fd79b9f5bb2127af=strlen($_a0878c824dfc65ce99ee5cceef69f126);return true;}function _b2c3275d0434901c3ae55c60cdc2b5c1($_23ae0ed12fd6e27db699a140cb96cd98,&$_87797b59aeab8d99233cfdd381df59b6,$_cfa0c5e98d0f2b508733844fc5fdf0b0,$_ff2499ad35eab0450eaa8b8bc10e9c7d,$_ce693f96d2dc67655d7f961f5d794e12){if(($_f0eba9a21ae7d12ac38c215d06ea090e=@socket_select($_02428b3bb2059759968e1785e2321e32=array($_23ae0ed12fd6e27db699a140cb96cd98),$_02428b3bb2059759968e1785e2321e32=NULL,$_02428b3bb2059759968e1785e2321e32=NULL,$_ce693f96d2dc67655d7f961f5d794e12))=== false || $_f0eba9a21ae7d12ac38c215d06ea090e == 0){return $_f0eba9a21ae7d12ac38c215d06ea090e;}return@socket_recv($_23ae0ed12fd6e27db699a140cb96cd98,$_87797b59aeab8d99233cfdd381df59b6,$_cfa0c5e98d0f2b508733844fc5fdf0b0,$_ff2499ad35eab0450eaa8b8bc10e9c7d);}function _a972d5daa86deb3d6dad1412c467b557($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae){if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@_b2c3275d0434901c3ae55c60cdc2b5c1($_74f81bb92104f38a0274005786d91a0a,$_87797b59aeab8d99233cfdd381df59b6,5,MSG_WAITALL,$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["timeout"]))=== false)return false;if($_cfa0c5e98d0f2b508733844fc5fdf0b0 == 0)return false;if($_cfa0c5e98d0f2b508733844fc5fdf0b0 != 5)return false;$_1465503b3c941ae041056c3eda84341c=unpack("Cprotocol_version/nmessage_type/nmessage_length",$_87797b59aeab8d99233cfdd381df59b6);$_239ec37c56516612346ceb7bbf98939a=(int) $_1465503b3c941ae041056c3eda84341c["message_length"];$_a0878c824dfc65ce99ee5cceef69f126=$_87797b59aeab8d99233cfdd381df59b6;while(1){if($_239ec37c56516612346ceb7bbf98939a == 0)break;if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=_b2c3275d0434901c3ae55c60cdc2b5c1($_74f81bb92104f38a0274005786d91a0a,$_87797b59aeab8d99233cfdd381df59b6,$_239ec37c56516612346ceb7bbf98939a,0,$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["timeout"]))=== false)break;if($_cfa0c5e98d0f2b508733844fc5fdf0b0 == 0)break;$_a0878c824dfc65ce99ee5cceef69f126 .= $_87797b59aeab8d99233cfdd381df59b6;$_239ec37c56516612346ceb7bbf98939a -= $_cfa0c5e98d0f2b508733844fc5fdf0b0;}if(!_461164dbbcb192c7ce99b3d4e8a616e5($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126))return false;if(in_array($_1465503b3c941ae041056c3eda84341c["message_type"],array(19,275))&&!_40645d1e35cbf2e1436dec61bffec9b8($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae)){}return true;}function _07bf894bda3acab0f8591c8dce7004be($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_80ec94da3475f8096b59f5e5e6f49e3f,&$_0d86f0dea505b92b26ae39288027d246){if($GLOBALS["cache_reload"]){$GLOBALS["cache_reload"]=false;if(!_de311db2b4eb4bcfb81ddc79dc7b02d6((int) $_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae))exit();}if($GLOBALS["queue_reload"]){$GLOBALS["queue_reload"]=false;if($_0d86f0dea505b92b26ae39288027d246 != $_80ec94da3475f8096b59f5e5e6f49e3f)unset($_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_0d86f0dea505b92b26ae39288027d246]);$_0d86f0dea505b92b26ae39288027d246++;if(!_fa8f781a9dab45ff6985f860a04c24d6((int) $_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_0d86f0dea505b92b26ae39288027d246))return false;}if(!_430b95668ef615764a1e43e2e01a8169($_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f,$_0d86f0dea505b92b26ae39288027d246,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af))return false;if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@socket_send($_74f81bb92104f38a0274005786d91a0a,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af,0))=== false)return false;usleep($_8a931fbb2920df84e4fedb38ec3bbbae["delay"][$_80ec94da3475f8096b59f5e5e6f49e3f]);$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_time_last"]=time();$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_count"]++;return true;}function _5e4dd7abba14aded68d6e912032ac235(&$_8a931fbb2920df84e4fedb38ec3bbbae,$_adb28025d0312998f37b260dba457ade=0){if($_adb28025d0312998f37b260dba457ade==0){if(!($_74f81bb92104f38a0274005786d91a0a=@socket_create(AF_INET,SOCK_STREAM,SOL_TCP)))return false;if(!@socket_connect($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["host"],$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["port"])){@socket_close($_74f81bb92104f38a0274005786d91a0a);return false;}}$_a43cb4c6b077e82361271903a753c5bd=false;while(1){switch($_8a931fbb2920df84e4fedb38ec3bbbae["state"]){case 0:if(!_5a7c9cf3fe1b3046f51b0a3b26d6a926($_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af))break 2;$_8a931fbb2920df84e4fedb38ec3bbbae["state"]=1;break;case 1:if(!_35adbe974f2f5958e82bd93228987147($_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af))break 2;$_8a931fbb2920df84e4fedb38ec3bbbae["state"]=2;break;case 2:if(!_1d52bd338924fd49d851789520ef2cb8($_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af))break 2;$_8a931fbb2920df84e4fedb38ec3bbbae["state"]=3;break;case 3:$_a43cb4c6b077e82361271903a753c5bd=true;break 2;}_ebbaf9d5394fed4c871dadc2af8144d4((int) $_74f81bb92104f38a0274005786d91a0a ." S",$_a0878c824dfc65ce99ee5cceef69f126);if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@socket_send($_74f81bb92104f38a0274005786d91a0a,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af,0))=== false)break;if(!_a972d5daa86deb3d6dad1412c467b557($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae))break;}if(!$_a43cb4c6b077e82361271903a753c5bd){@socket_close($_74f81bb92104f38a0274005786d91a0a);return false;}$_80ec94da3475f8096b59f5e5e6f49e3f=0;$_0d86f0dea505b92b26ae39288027d246=0;if(!_fa8f781a9dab45ff6985f860a04c24d6((int) $_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f)){@socket_close($_74f81bb92104f38a0274005786d91a0a);return false;}$_a80bb28d1e3651d456be1f48e293975f=array($_74f81bb92104f38a0274005786d91a0a);$_a82b6290f25c29687c4bf9e712714beb=array($_74f81bb92104f38a0274005786d91a0a);$_1465503b3c941ae041056c3eda84341c=time();$_f91b7255380327ff1ccea8735a607a68=time();$_be8a07e5811e9481bffee972d7bafc25=time();while(1){$_7d75b7fd4f9473aa24330952e3cfb008=$_a80bb28d1e3651d456be1f48e293975f;$_bd4a96274913fe894643d4b748fc5250=$_a82b6290f25c29687c4bf9e712714beb;if(($_f0eba9a21ae7d12ac38c215d06ea090e=@socket_select($_7d75b7fd4f9473aa24330952e3cfb008,$_bd4a96274913fe894643d4b748fc5250,$_02428b3bb2059759968e1785e2321e32=NULL,1))=== false)break;if($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["repetition"]<= time()-$_be8a07e5811e9481bffee972d7bafc25){$GLOBALS["queue_reload"]=true;$_be8a07e5811e9481bffee972d7bafc25=time();}if($_f0eba9a21ae7d12ac38c215d06ea090e<1){if(10<time()-$_1465503b3c941ae041056c3eda84341c){_40645d1e35cbf2e1436dec61bffec9b8($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae);$_1465503b3c941ae041056c3eda84341c=time();}if($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["timeout"]<time()-$_f91b7255380327ff1ccea8735a607a68)break;continue;}foreach($_7d75b7fd4f9473aa24330952e3cfb008 as $_ee038a7e290ea4a8147959fd3dd71505 => $_19519c2218dc53beabac55418f7b5185){if(!_a972d5daa86deb3d6dad1412c467b557($_19519c2218dc53beabac55418f7b5185,$_8a931fbb2920df84e4fedb38ec3bbbae))break 2;$_f91b7255380327ff1ccea8735a607a68=time();}foreach($_bd4a96274913fe894643d4b748fc5250 as $_ee038a7e290ea4a8147959fd3dd71505 => $_19519c2218dc53beabac55418f7b5185){if(!_07bf894bda3acab0f8591c8dce7004be($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f,$_0d86f0dea505b92b26ae39288027d246))break 2;$_f91b7255380327ff1ccea8735a607a68=time();if(10<time()-$_1465503b3c941ae041056c3eda84341c){_40645d1e35cbf2e1436dec61bffec9b8($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae);$_1465503b3c941ae041056c3eda84341c=time();}}$_bd2f6b7099f63c13661505878c997822="SELECT `reload`, `version` FROM `tvcas_emmg` WHERE `id`='{$_8a931fbb2920df84e4fedb38ec3bbbae['config']['id']}';";$_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822);$_90ed64522525df53df98e39a88d8ad5e=mysql_fetch_assoc($_c2effa87aba581049d65f293b1f8e656);if($_90ed64522525df53df98e39a88d8ad5e['reload']){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_count"]=0;$_bd2f6b7099f63c13661505878c997822="UPDATE `tvcas_emmg` SET `reload`='0', `datagram_count`=0 WHERE `id`='{$_8a931fbb2920df84e4fedb38ec3bbbae['config']['id']}';";_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822);_8a86f278e26806deefa5cd6557438559(0,$_8a931fbb2920df84e4fedb38ec3bbbae);_de311db2b4eb4bcfb81ddc79dc7b02d6(0,$_8a931fbb2920df84e4fedb38ec3bbbae);_5e4dd7abba14aded68d6e912032ac235($_8a931fbb2920df84e4fedb38ec3bbbae,1);}}@socket_close($_74f81bb92104f38a0274005786d91a0a);return false;}function _40645d1e35cbf2e1436dec61bffec9b8($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae){$_bd2f6b7099f63c13661505878c997822="update `tvcas_emmg` set" ." `channel_time_open`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["channel_time_open"] ."'," ." `stream_time_open`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["stream_time_open"] ."'," ." `error_time_last`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_time_last"] ."'," ." `error_count`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_count"] ."'," ." `datagram_time_last`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_time_last"] ."'," ." `datagram_count`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_count"] ."'," ." `queue_size`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["queue_size"] ."'" ." where `id`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["id"] ."'";if(!_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822)){_1f868f50d8d475e1b390495be9d1d011();return false;}return true;}function _32f552bd5e87e6ce714ec8a64e4b2da3($_9c392375ccc0b79f45a1a9462c9dcdbe,$_aea8b817a197d80ea051953710f097f6){$_bd2f6b7099f63c13661505878c997822="update `tvcas_smartcards` set `subscription_slot" .(int) $_aea8b817a197d80ea051953710f097f6 ."` = (@subscription_slot := `subscription_slot" .(int) $_aea8b817a197d80ea051953710f097f6 ."`) + 1 where `serial_no`='" .$_9c392375ccc0b79f45a1a9462c9dcdbe ."'";if(!_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822)){return false;}$_bd2f6b7099f63c13661505878c997822="select @subscription_slot";if(!($_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822))){return false;}if(mysql_num_rows($_c2effa87aba581049d65f293b1f8e656)== 0){return 0;}list($_32698bc3876917998e1966fabcdce4f0)=mysql_fetch_row($_c2effa87aba581049d65f293b1f8e656);return $_32698bc3876917998e1966fabcdce4f0;} ?>
Did this file decode correctly?
Original Code
set_time_limit(0);umask(23);chdir(__DIR__);require_once(__DIR__ ."/functions.php");array_shift($_SERVER["argv"]);parse_str(implode("&",$_SERVER["argv"]),$_3922c901e0b28c5dadecb3206eb4b6e7);$_f31403c3aff4b6cf3e01ad5b8a639a26=$_3922c901e0b28c5dadecb3206eb4b6e7['--generator-id']?$_3922c901e0b28c5dadecb3206eb4b6e7['--generator-id']:1;$_17660b42bc80e4b67b16398ff96c4983=0;$_8b7ccc66e6c1430f4f8f6386943d47c5=getenv("tvcas_ident");$GLOBALS["pid_file"]=false;$_46b4496d0d72737b7435373345c71782=(getenv("tvcas_emmg_guard")=== false?true:false);if(!$_46b4496d0d72737b7435373345c71782){unset($GLOBALS["pid_file"]);}openlog("emmg" .(($_8b7ccc66e6c1430f4f8f6386943d47c5 === false?"":"_" .$_8b7ccc66e6c1430f4f8f6386943d47c5)) ."_" .$_f31403c3aff4b6cf3e01ad5b8a639a26,LOG_ODELAY|LOG_PID,LOG_LOCAL0);posix_setsid();if($_46b4496d0d72737b7435373345c71782){if($GLOBALS["pid_file"]=== false){$GLOBALS["pid_file"]="/var/run/" .(($_8b7ccc66e6c1430f4f8f6386943d47c5 === false?"":$_8b7ccc66e6c1430f4f8f6386943d47c5 ."_")) ."emmg_" .$_f31403c3aff4b6cf3e01ad5b8a639a26 .".pid";}else{}if(is_file($GLOBALS["pid_file"])){exit();}if(@file_put_contents($GLOBALS["pid_file"],@posix_getpid())=== false){exit();}else{}putenv("tvcas_emmg_guard=42");while(true){$GLOBALS["main_pid"]=pcntl_fork();if($GLOBALS["main_pid"]==-1){}if($GLOBALS["main_pid"]== 0){posix_setsid();pcntl_exec(__FILE__,$_SERVER["argv"]);}while(true){if(pcntl_wait($_70c91ec8ae73da6e0d06a23b77284d6f,WNOHANG)!= 0){break;}sleep(1);}sleep(10);}}$_bd2f6b7099f63c13661505878c997822="UPDATE `tvcas_emmg` SET `reload`='0', `touch_version`='0', `touch_time`='0' WHERE `id`='" .$_f31403c3aff4b6cf3e01ad5b8a639a26 ."'";if(!_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822))exit();$_bd2f6b7099f63c13661505878c997822="SELECT `id`, `network_id`, `host`, `port`, `protocol_version`, `packet_mode`, `bandwidth`, `repetition`, `period`, `period_messages`, `channel_test_delay`, `stream_test_delay`, `timeout`, `client_id`, `version`, `uid` FROM `tvcas_emmg` WHERE `status`='1' AND `d_id`='0' AND `id`='" .$_f31403c3aff4b6cf3e01ad5b8a639a26 ."'";if(!($_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822)))exit();if(mysql_num_rows($_c2effa87aba581049d65f293b1f8e656)== 0)exit;$_8a931fbb2920df84e4fedb38ec3bbbae=array("config"=> mysql_fetch_assoc($_c2effa87aba581049d65f293b1f8e656),"slots"=> (int)$_abe27c8cb6f0b93676f1d1d982f46f73["slot_cnt"],"state"=> 0,"status"=> array("channel_time_open"=> 0,"stream_time_open"=> 0,"error_time_last"=> 0,"error_count"=> 0,"datagram_time_last"=> 0,"datagram_count"=> 0,"queue_size"=> 0),"keys"=> array(),"pair"=> array(),"type"=> array(),"cache"=> array(),"cache_max_id"=> 0,"queue"=> array(),"delay"=> array(),"reload"=>0);$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["period"]*= 86400;$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["period_messages"]*= 86400;if($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["repetition"]<60){$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["repetition"]=60;}if($_8a931fbb2920df84e4fedb38ec3bbbae["slots"]== 0){$_8a931fbb2920df84e4fedb38ec3bbbae["slots"]=128;}if(!_8a86f278e26806deefa5cd6557438559(0,$_8a931fbb2920df84e4fedb38ec3bbbae))exit();if(!_de311db2b4eb4bcfb81ddc79dc7b02d6(0,$_8a931fbb2920df84e4fedb38ec3bbbae))exit();$GLOBALS["pid_main"]=posix_getpid();$GLOBALS["pid_connect"]=0;$GLOBALS["cache_reload"]=false;$GLOBALS["queue_reload"]=false;_1f868f50d8d475e1b390495be9d1d011();$GLOBALS["pid_connect"]=pcntl_fork();switch($GLOBALS["pid_connect"]){case-1:exit();case 0:if(!_5e4dd7abba14aded68d6e912032ac235($_8a931fbb2920df84e4fedb38ec3bbbae)){exit();}exit();}_2b4fabe9bad96db3a125946ffb479132("UPDATE `tvcas_emmg` SET `version`='1', `touch_version`='1' WHERE `id`='{$_f31403c3aff4b6cf3e01ad5b8a639a26}';");while(true){$_bd2f6b7099f63c13661505878c997822="UPDATE `tvcas_emmg` SET `touch_version`='{$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["version"]}', `touch_time`='" .time() ."' WHERE `id`='{$_f31403c3aff4b6cf3e01ad5b8a639a26}';";if(!_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822))break;sleep(60);}exit();function _8a86f278e26806deefa5cd6557438559($_62aa51fe8b897e07600b8eb2bfa74c3d,&$_8a931fbb2920df84e4fedb38ec3bbbae){$_213c632926e015ddc9a75dc57e727ac8=&$_8a931fbb2920df84e4fedb38ec3bbbae["keys"];$_296926ff383ae099cfa5ef4a0bc94c69=&$_8a931fbb2920df84e4fedb38ec3bbbae["pair"];$_de495d8c7de2fce304eb3d492bb32da8=&$_8a931fbb2920df84e4fedb38ec3bbbae["type"];$_bd2f6b7099f63c13661505878c997822="SELECT `serial_no`,`key`,`pair`,`type` FROM `tvcas_smartcards`;";$_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822);$_55b80204d943f74052c7abe56a28a90d=mysql_num_rows($_c2effa87aba581049d65f293b1f8e656);while($_90ed64522525df53df98e39a88d8ad5e=mysql_fetch_assoc($_c2effa87aba581049d65f293b1f8e656)){$_213c632926e015ddc9a75dc57e727ac8[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]]=$_90ed64522525df53df98e39a88d8ad5e["key"];$_296926ff383ae099cfa5ef4a0bc94c69[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]]=$_90ed64522525df53df98e39a88d8ad5e['pair'];$_de495d8c7de2fce304eb3d492bb32da8[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]]=$_90ed64522525df53df98e39a88d8ad5e['type'];}return true;}function _de311db2b4eb4bcfb81ddc79dc7b02d6($_62aa51fe8b897e07600b8eb2bfa74c3d,&$_8a931fbb2920df84e4fedb38ec3bbbae){$_213c632926e015ddc9a75dc57e727ac8=&$_8a931fbb2920df84e4fedb38ec3bbbae["keys"];$_296926ff383ae099cfa5ef4a0bc94c69=&$_8a931fbb2920df84e4fedb38ec3bbbae["pair"];$_de495d8c7de2fce304eb3d492bb32da8=&$_8a931fbb2920df84e4fedb38ec3bbbae["type"];$_2b9a37da9dade0edc57c38140bf3cc66=&$_8a931fbb2920df84e4fedb38ec3bbbae["cache"];$_d373938f402134d5a887690afd06ec2d=time();$_55b80204d943f74052c7abe56a28a90d=0;$_9c48841bce53d0fc75472484b7b9d87f=microtime(true);$_0fc190f972a3ec935d138bda6d0fb601=0;$_05d8bae6c454bfa2329007d5f7e2ec09=$_9c48841bce53d0fc75472484b7b9d87f;$_6fb8fa40c6d7ac19907993fb27baff98=microtime(true)-$_9c48841bce53d0fc75472484b7b9d87f;$_bd2f6b7099f63c13661505878c997822="SELECT * FROM `tvcas_smartcards` WHERE `edit`>" .($_d373938f402134d5a887690afd06ec2d-86400*7) ." OR (`start`<{$_d373938f402134d5a887690afd06ec2d} AND `finish`>{$_d373938f402134d5a887690afd06ec2d}) ORDER BY `edit` DESC;";$_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822);$_55b80204d943f74052c7abe56a28a90d=mysql_num_rows($_c2effa87aba581049d65f293b1f8e656);if($_55b80204d943f74052c7abe56a28a90d>0){while($_90ed64522525df53df98e39a88d8ad5e=mysql_fetch_assoc($_c2effa87aba581049d65f293b1f8e656)){$_90ed64522525df53df98e39a88d8ad5e['subscription_id']=0;if(!($_a8c88481163515e743ebbc01f351b86f=_e4a33c3dec83ec46bc55e3283aea5274($_62aa51fe8b897e07600b8eb2bfa74c3d,$_90ed64522525df53df98e39a88d8ad5e["serial_no"],$_90ed64522525df53df98e39a88d8ad5e['access_criteria'],$_213c632926e015ddc9a75dc57e727ac8[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]],$_296926ff383ae099cfa5ef4a0bc94c69[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]],$_de495d8c7de2fce304eb3d492bb32da8[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]],$_90ed64522525df53df98e39a88d8ad5e["start"],$_90ed64522525df53df98e39a88d8ad5e["finish"]))){continue;}if(!_a8301363198582b31050be7f824d3fb7($_8a931fbb2920df84e4fedb38ec3bbbae,$_a8c88481163515e743ebbc01f351b86f,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af)){continue;}$_2b9a37da9dade0edc57c38140bf3cc66[$_90ed64522525df53df98e39a88d8ad5e["serial_no"]][$_90ed64522525df53df98e39a88d8ad5e["subscription_id"]]=pack("CLL",1,0,$_90ed64522525df53df98e39a88d8ad5e["finish"]) .$_a0878c824dfc65ce99ee5cceef69f126;if(++$_0fc190f972a3ec935d138bda6d0fb601%1000 == 0){$_6fb8fa40c6d7ac19907993fb27baff98=microtime(true)-$_05d8bae6c454bfa2329007d5f7e2ec09;$_05d8bae6c454bfa2329007d5f7e2ec09=microtime(true);}}}return true;}function _fa8f781a9dab45ff6985f860a04c24d6($_62aa51fe8b897e07600b8eb2bfa74c3d,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f){$_2b9a37da9dade0edc57c38140bf3cc66=&$_8a931fbb2920df84e4fedb38ec3bbbae["cache"];if(!isset($_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f])){$_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f]=array();}$_4939f0c763f91fdfed90e16924685111=&$_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f];$_d373938f402134d5a887690afd06ec2d=time();$_cd125632541fe3d0eb4f8e91513510a7=microtime(true);$_1465503b3c941ae041056c3eda84341c=0;$_f91b7255380327ff1ccea8735a607a68=0;foreach($_2b9a37da9dade0edc57c38140bf3cc66 as $_5f4b03ac7c0c99ec375648a0b2276ec3 => $_0ee80250908b20cbd55e64cd12f4d972){$_be8a07e5811e9481bffee972d7bafc25=array();$_d1e289d4aafde6cc87fd53837ff17035=0;$_7cbdcfc4e6a1292fa281756374656d05=0;krsort($_0ee80250908b20cbd55e64cd12f4d972);foreach($_0ee80250908b20cbd55e64cd12f4d972 as $_335f5638c854ec613eabec77e622cb57 => $_8dff77644a666b4f45bd68532d31ebde){$_e962e5723de7cb0c3a26b79a0c94df1f=unpack("Ca/Lp/Lt",$_8dff77644a666b4f45bd68532d31ebde);if($_e962e5723de7cb0c3a26b79a0c94df1f["t"]<$_d373938f402134d5a887690afd06ec2d){unset($_2b9a37da9dade0edc57c38140bf3cc66[$_5f4b03ac7c0c99ec375648a0b2276ec3][$_335f5638c854ec613eabec77e622cb57]);continue;}if($_d373938f402134d5a887690afd06ec2d<$_e962e5723de7cb0c3a26b79a0c94df1f["p"]){continue;}if($_e962e5723de7cb0c3a26b79a0c94df1f["a"]== 4 && 16<++$_7cbdcfc4e6a1292fa281756374656d05){unset($_2b9a37da9dade0edc57c38140bf3cc66[$_5f4b03ac7c0c99ec375648a0b2276ec3][$_335f5638c854ec613eabec77e622cb57]);continue;}$_be8a07e5811e9481bffee972d7bafc25[++$_d1e289d4aafde6cc87fd53837ff17035]=&$_2b9a37da9dade0edc57c38140bf3cc66[$_5f4b03ac7c0c99ec375648a0b2276ec3][$_335f5638c854ec613eabec77e622cb57];}if(!@$_d1e289d4aafde6cc87fd53837ff17035){$_f5b87977765c51f5bc5e427cfbf3c496=0;$_d1e289d4aafde6cc87fd53837ff17035=0;}if($_d1e289d4aafde6cc87fd53837ff17035!=0 and($_f5b87977765c51f5bc5e427cfbf3c496=(100/@$_d1e289d4aafde6cc87fd53837ff17035)%100)== 0){$_f5b87977765c51f5bc5e427cfbf3c496=17;}else{$_1465503b3c941ae041056c3eda84341c=0;}foreach($_be8a07e5811e9481bffee972d7bafc25 as $_335f5638c854ec613eabec77e622cb57 => $_8dff77644a666b4f45bd68532d31ebde){$_4939f0c763f91fdfed90e16924685111[$_1465503b3c941ae041056c3eda84341c%100*1000000+$_f91b7255380327ff1ccea8735a607a68]=&$_be8a07e5811e9481bffee972d7bafc25[$_335f5638c854ec613eabec77e622cb57];$_1465503b3c941ae041056c3eda84341c += $_f5b87977765c51f5bc5e427cfbf3c496;$_f91b7255380327ff1ccea8735a607a68++;}}ksort($_4939f0c763f91fdfed90e16924685111);if(($_9c679ee588c79363e5ab56a8268b4935=count($_4939f0c763f91fdfed90e16924685111))== 0){if(!($_a8c88481163515e743ebbc01f351b86f=_e4a33c3dec83ec46bc55e3283aea5274($_62aa51fe8b897e07600b8eb2bfa74c3d,2199999999,'FFFFFFFF','1234567890A0B1C21234567890A0B1C2',0,0,time()-86400,time()+300))){return false;}if(!_a8301363198582b31050be7f824d3fb7($_8a931fbb2920df84e4fedb38ec3bbbae,$_a8c88481163515e743ebbc01f351b86f,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af)){return false;}$_4939f0c763f91fdfed90e16924685111[]=pack("CLL",0,0,0) .$_a0878c824dfc65ce99ee5cceef69f126;$_9c679ee588c79363e5ab56a8268b4935=1;}$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["queue_size"]=$_9c679ee588c79363e5ab56a8268b4935;$_8a931fbb2920df84e4fedb38ec3bbbae["delay"][$_80ec94da3475f8096b59f5e5e6f49e3f]=(int)($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["repetition"]/$_9c679ee588c79363e5ab56a8268b4935*1000000);if(10000000<$_8a931fbb2920df84e4fedb38ec3bbbae["delay"][$_80ec94da3475f8096b59f5e5e6f49e3f]){$_8a931fbb2920df84e4fedb38ec3bbbae["delay"][$_80ec94da3475f8096b59f5e5e6f49e3f]=10000000;}$_6fb8fa40c6d7ac19907993fb27baff98=microtime(true)-$_cd125632541fe3d0eb4f8e91513510a7;return true;}function _430b95668ef615764a1e43e2e01a8169(&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_80ec94da3475f8096b59f5e5e6f49e3f,$_0d86f0dea505b92b26ae39288027d246,&$_87797b59aeab8d99233cfdd381df59b6,&$_ef8cbc9cb734afe54356ff14e136202a){$_4939f0c763f91fdfed90e16924685111=&$_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f];if(($_f0eba9a21ae7d12ac38c215d06ea090e=current($_4939f0c763f91fdfed90e16924685111))=== false){if($_0d86f0dea505b92b26ae39288027d246 != $_80ec94da3475f8096b59f5e5e6f49e3f){unset($_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_80ec94da3475f8096b59f5e5e6f49e3f]);$_80ec94da3475f8096b59f5e5e6f49e3f=$_0d86f0dea505b92b26ae39288027d246;return _430b95668ef615764a1e43e2e01a8169($_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f,$_0d86f0dea505b92b26ae39288027d246,$_87797b59aeab8d99233cfdd381df59b6,$_ef8cbc9cb734afe54356ff14e136202a);}if(($_f0eba9a21ae7d12ac38c215d06ea090e=reset($_4939f0c763f91fdfed90e16924685111))=== false){return false;}}next($_4939f0c763f91fdfed90e16924685111);$_87797b59aeab8d99233cfdd381df59b6=substr($_f0eba9a21ae7d12ac38c215d06ea090e,9);$_ef8cbc9cb734afe54356ff14e136202a=strlen($_87797b59aeab8d99233cfdd381df59b6);return true;}function _d5d3b76a6825afb10b681aa8413bf434($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,2 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["packet_mode"]);if(($_6d1c7b3de0f582ef2e88d3ca30b5558d=_fd28f480a79251368fa29f0c68d6111f($_f9a7277e6a44b78ae9aadcc98214656d,19,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}_ebbaf9d5394fed4c871dadc2af8144d4((int) $_74f81bb92104f38a0274005786d91a0a ." S",$_6d1c7b3de0f582ef2e88d3ca30b5558d);if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@socket_send($_74f81bb92104f38a0274005786d91a0a,$_6d1c7b3de0f582ef2e88d3ca30b5558d,@strlen($_6d1c7b3de0f582ef2e88d3ca30b5558d),0))=== false){return false;}return true;}function _420e5d359e95c13df71d72e8048323bf($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["channel_time_open"]=time();return true;}function _8baabb2cc96a710e452965c6e96d9192($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_time_last"]=time();$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_count"]++;return true;}function _ffc5635aa054409e95a27a23ea09d9fc($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,4 => 1,8 => 1,7 => 0);if(($_6d1c7b3de0f582ef2e88d3ca30b5558d=_fd28f480a79251368fa29f0c68d6111f($_f9a7277e6a44b78ae9aadcc98214656d,275,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}_ebbaf9d5394fed4c871dadc2af8144d4((int) $_74f81bb92104f38a0274005786d91a0a ." S",$_6d1c7b3de0f582ef2e88d3ca30b5558d);if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@socket_send($_74f81bb92104f38a0274005786d91a0a,$_6d1c7b3de0f582ef2e88d3ca30b5558d,@strlen($_6d1c7b3de0f582ef2e88d3ca30b5558d),0))=== false){return false;}return true;}function _e58b2cd50abe1f18b5c8643ddd0cf403($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["stream_time_open"]=time();return true;}function _eba35ba1f5c413c0504895855e8bf4a7($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_time_last"]=time();$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_count"]++;return true;}function _5b1d2b9c38f151963025446faccd85b2($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0){return true;}function _461164dbbcb192c7ce99b3d4e8a616e5($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126){if(($_225c258c4b6824b94ac05a09c5ab03d0=_7c62937caf595c68036f40a57081ac88($_a0878c824dfc65ce99ee5cceef69f126,$_f9a7277e6a44b78ae9aadcc98214656d,$_e9536e3e4c1124db4e57dbfae62cb40b,$_d7d8dce8a14bc703f55f15735959cc79))=== false){return false;}_ebbaf9d5394fed4c871dadc2af8144d4((int) $_74f81bb92104f38a0274005786d91a0a ." R",$_a0878c824dfc65ce99ee5cceef69f126);switch($_e9536e3e4c1124db4e57dbfae62cb40b){case 18:return _d5d3b76a6825afb10b681aa8413bf434($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 19:return _420e5d359e95c13df71d72e8048323bf($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 21:return _8baabb2cc96a710e452965c6e96d9192($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 20:return _269bfb6d71c5c765c3f1ac3e7f80fd2e($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 274:return _ffc5635aa054409e95a27a23ea09d9fc($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 275:return _e58b2cd50abe1f18b5c8643ddd0cf403($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 278:return _eba35ba1f5c413c0504895855e8bf4a7($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 276:return _c167e2b101ca413710cd9743f59fa24c($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);case 280:return _5b1d2b9c38f151963025446faccd85b2($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_f9a7277e6a44b78ae9aadcc98214656d,$_225c258c4b6824b94ac05a09c5ab03d0);}return true;}function _5a7c9cf3fe1b3046f51b0a3b26d6a926(&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_a0878c824dfc65ce99ee5cceef69f126,&$_a0ba494fa24777d6fd79b9f5bb2127af){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,2 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["packet_mode"]);if(($_a0878c824dfc65ce99ee5cceef69f126=_fd28f480a79251368fa29f0c68d6111f($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["protocol_version"],17,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}$_a0ba494fa24777d6fd79b9f5bb2127af=strlen($_a0878c824dfc65ce99ee5cceef69f126);return true;}function _35adbe974f2f5958e82bd93228987147(&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_a0878c824dfc65ce99ee5cceef69f126,&$_a0ba494fa24777d6fd79b9f5bb2127af){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,4 => 1,8 => 1,7 => 0);if(($_a0878c824dfc65ce99ee5cceef69f126=_fd28f480a79251368fa29f0c68d6111f($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["protocol_version"],273,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}$_a0ba494fa24777d6fd79b9f5bb2127af=strlen($_a0878c824dfc65ce99ee5cceef69f126);return true;}function _1d52bd338924fd49d851789520ef2cb8(&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_a0878c824dfc65ce99ee5cceef69f126,&$_a0ba494fa24777d6fd79b9f5bb2127af){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,4 => 1,6 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["bandwidth"]);if(($_a0878c824dfc65ce99ee5cceef69f126=_fd28f480a79251368fa29f0c68d6111f($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["protocol_version"],279,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}$_a0ba494fa24777d6fd79b9f5bb2127af=strlen($_a0878c824dfc65ce99ee5cceef69f126);return true;}function _a8301363198582b31050be7f824d3fb7(&$_8a931fbb2920df84e4fedb38ec3bbbae,$_a8c88481163515e743ebbc01f351b86f,&$_a0878c824dfc65ce99ee5cceef69f126,&$_a0ba494fa24777d6fd79b9f5bb2127af){$_ed5735cd359e50dee1e39cd210cbae50=array(1 => $_8a931fbb2920df84e4fedb38ec3bbbae["config"]["client_id"],3 => 1&65535,4 => 1,8 => 1,5 => $_a8c88481163515e743ebbc01f351b86f);if(($_a0878c824dfc65ce99ee5cceef69f126=_fd28f480a79251368fa29f0c68d6111f($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["protocol_version"],529,$_ed5735cd359e50dee1e39cd210cbae50))=== false){return false;}$_a0ba494fa24777d6fd79b9f5bb2127af=strlen($_a0878c824dfc65ce99ee5cceef69f126);return true;}function _b2c3275d0434901c3ae55c60cdc2b5c1($_23ae0ed12fd6e27db699a140cb96cd98,&$_87797b59aeab8d99233cfdd381df59b6,$_cfa0c5e98d0f2b508733844fc5fdf0b0,$_ff2499ad35eab0450eaa8b8bc10e9c7d,$_ce693f96d2dc67655d7f961f5d794e12){if(($_f0eba9a21ae7d12ac38c215d06ea090e=@socket_select($_02428b3bb2059759968e1785e2321e32=array($_23ae0ed12fd6e27db699a140cb96cd98),$_02428b3bb2059759968e1785e2321e32=NULL,$_02428b3bb2059759968e1785e2321e32=NULL,$_ce693f96d2dc67655d7f961f5d794e12))=== false || $_f0eba9a21ae7d12ac38c215d06ea090e == 0){return $_f0eba9a21ae7d12ac38c215d06ea090e;}return@socket_recv($_23ae0ed12fd6e27db699a140cb96cd98,$_87797b59aeab8d99233cfdd381df59b6,$_cfa0c5e98d0f2b508733844fc5fdf0b0,$_ff2499ad35eab0450eaa8b8bc10e9c7d);}function _a972d5daa86deb3d6dad1412c467b557($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae){if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@_b2c3275d0434901c3ae55c60cdc2b5c1($_74f81bb92104f38a0274005786d91a0a,$_87797b59aeab8d99233cfdd381df59b6,5,MSG_WAITALL,$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["timeout"]))=== false)return false;if($_cfa0c5e98d0f2b508733844fc5fdf0b0 == 0)return false;if($_cfa0c5e98d0f2b508733844fc5fdf0b0 != 5)return false;$_1465503b3c941ae041056c3eda84341c=unpack("Cprotocol_version/nmessage_type/nmessage_length",$_87797b59aeab8d99233cfdd381df59b6);$_239ec37c56516612346ceb7bbf98939a=(int) $_1465503b3c941ae041056c3eda84341c["message_length"];$_a0878c824dfc65ce99ee5cceef69f126=$_87797b59aeab8d99233cfdd381df59b6;while(1){if($_239ec37c56516612346ceb7bbf98939a == 0)break;if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=_b2c3275d0434901c3ae55c60cdc2b5c1($_74f81bb92104f38a0274005786d91a0a,$_87797b59aeab8d99233cfdd381df59b6,$_239ec37c56516612346ceb7bbf98939a,0,$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["timeout"]))=== false)break;if($_cfa0c5e98d0f2b508733844fc5fdf0b0 == 0)break;$_a0878c824dfc65ce99ee5cceef69f126 .= $_87797b59aeab8d99233cfdd381df59b6;$_239ec37c56516612346ceb7bbf98939a -= $_cfa0c5e98d0f2b508733844fc5fdf0b0;}if(!_461164dbbcb192c7ce99b3d4e8a616e5($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126))return false;if(in_array($_1465503b3c941ae041056c3eda84341c["message_type"],array(19,275))&&!_40645d1e35cbf2e1436dec61bffec9b8($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae)){}return true;}function _07bf894bda3acab0f8591c8dce7004be($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae,&$_80ec94da3475f8096b59f5e5e6f49e3f,&$_0d86f0dea505b92b26ae39288027d246){if($GLOBALS["cache_reload"]){$GLOBALS["cache_reload"]=false;if(!_de311db2b4eb4bcfb81ddc79dc7b02d6((int) $_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae))exit();}if($GLOBALS["queue_reload"]){$GLOBALS["queue_reload"]=false;if($_0d86f0dea505b92b26ae39288027d246 != $_80ec94da3475f8096b59f5e5e6f49e3f)unset($_8a931fbb2920df84e4fedb38ec3bbbae["queue"][$_0d86f0dea505b92b26ae39288027d246]);$_0d86f0dea505b92b26ae39288027d246++;if(!_fa8f781a9dab45ff6985f860a04c24d6((int) $_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_0d86f0dea505b92b26ae39288027d246))return false;}if(!_430b95668ef615764a1e43e2e01a8169($_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f,$_0d86f0dea505b92b26ae39288027d246,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af))return false;if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@socket_send($_74f81bb92104f38a0274005786d91a0a,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af,0))=== false)return false;usleep($_8a931fbb2920df84e4fedb38ec3bbbae["delay"][$_80ec94da3475f8096b59f5e5e6f49e3f]);$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_time_last"]=time();$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_count"]++;return true;}function _5e4dd7abba14aded68d6e912032ac235(&$_8a931fbb2920df84e4fedb38ec3bbbae,$_adb28025d0312998f37b260dba457ade=0){if($_adb28025d0312998f37b260dba457ade==0){if(!($_74f81bb92104f38a0274005786d91a0a=@socket_create(AF_INET,SOCK_STREAM,SOL_TCP)))return false;if(!@socket_connect($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["host"],$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["port"])){@socket_close($_74f81bb92104f38a0274005786d91a0a);return false;}}$_a43cb4c6b077e82361271903a753c5bd=false;while(1){switch($_8a931fbb2920df84e4fedb38ec3bbbae["state"]){case 0:if(!_5a7c9cf3fe1b3046f51b0a3b26d6a926($_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af))break 2;$_8a931fbb2920df84e4fedb38ec3bbbae["state"]=1;break;case 1:if(!_35adbe974f2f5958e82bd93228987147($_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af))break 2;$_8a931fbb2920df84e4fedb38ec3bbbae["state"]=2;break;case 2:if(!_1d52bd338924fd49d851789520ef2cb8($_8a931fbb2920df84e4fedb38ec3bbbae,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af))break 2;$_8a931fbb2920df84e4fedb38ec3bbbae["state"]=3;break;case 3:$_a43cb4c6b077e82361271903a753c5bd=true;break 2;}_ebbaf9d5394fed4c871dadc2af8144d4((int) $_74f81bb92104f38a0274005786d91a0a ." S",$_a0878c824dfc65ce99ee5cceef69f126);if(($_cfa0c5e98d0f2b508733844fc5fdf0b0=@socket_send($_74f81bb92104f38a0274005786d91a0a,$_a0878c824dfc65ce99ee5cceef69f126,$_a0ba494fa24777d6fd79b9f5bb2127af,0))=== false)break;if(!_a972d5daa86deb3d6dad1412c467b557($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae))break;}if(!$_a43cb4c6b077e82361271903a753c5bd){@socket_close($_74f81bb92104f38a0274005786d91a0a);return false;}$_80ec94da3475f8096b59f5e5e6f49e3f=0;$_0d86f0dea505b92b26ae39288027d246=0;if(!_fa8f781a9dab45ff6985f860a04c24d6((int) $_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f)){@socket_close($_74f81bb92104f38a0274005786d91a0a);return false;}$_a80bb28d1e3651d456be1f48e293975f=array($_74f81bb92104f38a0274005786d91a0a);$_a82b6290f25c29687c4bf9e712714beb=array($_74f81bb92104f38a0274005786d91a0a);$_1465503b3c941ae041056c3eda84341c=time();$_f91b7255380327ff1ccea8735a607a68=time();$_be8a07e5811e9481bffee972d7bafc25=time();while(1){$_7d75b7fd4f9473aa24330952e3cfb008=$_a80bb28d1e3651d456be1f48e293975f;$_bd4a96274913fe894643d4b748fc5250=$_a82b6290f25c29687c4bf9e712714beb;if(($_f0eba9a21ae7d12ac38c215d06ea090e=@socket_select($_7d75b7fd4f9473aa24330952e3cfb008,$_bd4a96274913fe894643d4b748fc5250,$_02428b3bb2059759968e1785e2321e32=NULL,1))=== false)break;if($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["repetition"]<= time()-$_be8a07e5811e9481bffee972d7bafc25){$GLOBALS["queue_reload"]=true;$_be8a07e5811e9481bffee972d7bafc25=time();}if($_f0eba9a21ae7d12ac38c215d06ea090e<1){if(10<time()-$_1465503b3c941ae041056c3eda84341c){_40645d1e35cbf2e1436dec61bffec9b8($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae);$_1465503b3c941ae041056c3eda84341c=time();}if($_8a931fbb2920df84e4fedb38ec3bbbae["config"]["timeout"]<time()-$_f91b7255380327ff1ccea8735a607a68)break;continue;}foreach($_7d75b7fd4f9473aa24330952e3cfb008 as $_ee038a7e290ea4a8147959fd3dd71505 => $_19519c2218dc53beabac55418f7b5185){if(!_a972d5daa86deb3d6dad1412c467b557($_19519c2218dc53beabac55418f7b5185,$_8a931fbb2920df84e4fedb38ec3bbbae))break 2;$_f91b7255380327ff1ccea8735a607a68=time();}foreach($_bd4a96274913fe894643d4b748fc5250 as $_ee038a7e290ea4a8147959fd3dd71505 => $_19519c2218dc53beabac55418f7b5185){if(!_07bf894bda3acab0f8591c8dce7004be($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae,$_80ec94da3475f8096b59f5e5e6f49e3f,$_0d86f0dea505b92b26ae39288027d246))break 2;$_f91b7255380327ff1ccea8735a607a68=time();if(10<time()-$_1465503b3c941ae041056c3eda84341c){_40645d1e35cbf2e1436dec61bffec9b8($_74f81bb92104f38a0274005786d91a0a,$_8a931fbb2920df84e4fedb38ec3bbbae);$_1465503b3c941ae041056c3eda84341c=time();}}$_bd2f6b7099f63c13661505878c997822="SELECT `reload`, `version` FROM `tvcas_emmg` WHERE `id`='{$_8a931fbb2920df84e4fedb38ec3bbbae['config']['id']}';";$_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822);$_90ed64522525df53df98e39a88d8ad5e=mysql_fetch_assoc($_c2effa87aba581049d65f293b1f8e656);if($_90ed64522525df53df98e39a88d8ad5e['reload']){$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_count"]=0;$_bd2f6b7099f63c13661505878c997822="UPDATE `tvcas_emmg` SET `reload`='0', `datagram_count`=0 WHERE `id`='{$_8a931fbb2920df84e4fedb38ec3bbbae['config']['id']}';";_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822);_8a86f278e26806deefa5cd6557438559(0,$_8a931fbb2920df84e4fedb38ec3bbbae);_de311db2b4eb4bcfb81ddc79dc7b02d6(0,$_8a931fbb2920df84e4fedb38ec3bbbae);_5e4dd7abba14aded68d6e912032ac235($_8a931fbb2920df84e4fedb38ec3bbbae,1);}}@socket_close($_74f81bb92104f38a0274005786d91a0a);return false;}function _40645d1e35cbf2e1436dec61bffec9b8($_74f81bb92104f38a0274005786d91a0a,&$_8a931fbb2920df84e4fedb38ec3bbbae){$_bd2f6b7099f63c13661505878c997822="update `tvcas_emmg` set" ." `channel_time_open`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["channel_time_open"] ."'," ." `stream_time_open`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["stream_time_open"] ."'," ." `error_time_last`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_time_last"] ."'," ." `error_count`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["error_count"] ."'," ." `datagram_time_last`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_time_last"] ."'," ." `datagram_count`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["datagram_count"] ."'," ." `queue_size`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["status"]["queue_size"] ."'" ." where `id`='" .$_8a931fbb2920df84e4fedb38ec3bbbae["config"]["id"] ."'";if(!_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822)){_1f868f50d8d475e1b390495be9d1d011();return false;}return true;}function _32f552bd5e87e6ce714ec8a64e4b2da3($_9c392375ccc0b79f45a1a9462c9dcdbe,$_aea8b817a197d80ea051953710f097f6){$_bd2f6b7099f63c13661505878c997822="update `tvcas_smartcards` set `subscription_slot" .(int) $_aea8b817a197d80ea051953710f097f6 ."` = (@subscription_slot := `subscription_slot" .(int) $_aea8b817a197d80ea051953710f097f6 ."`) + 1 where `serial_no`='" .$_9c392375ccc0b79f45a1a9462c9dcdbe ."'";if(!_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822)){return false;}$_bd2f6b7099f63c13661505878c997822="select @subscription_slot";if(!($_c2effa87aba581049d65f293b1f8e656=_2b4fabe9bad96db3a125946ffb479132($_bd2f6b7099f63c13661505878c997822))){return false;}if(mysql_num_rows($_c2effa87aba581049d65f293b1f8e656)== 0){return 0;}list($_32698bc3876917998e1966fabcdce4f0)=mysql_fetch_row($_c2effa87aba581049d65f293b1f8e656);return $_32698bc3876917998e1966fabcdce4f0;} ?>
Function Calls
umask | 1 |
set_time_limit | 1 |
Stats
MD5 | 5a4c1f4a750b967cb105e48cedd49f27 |
Eval Count | 0 |
Decode Time | 305 ms |