Skip to content

Instantly share code, notes, and snippets.

@parsibox
Created October 6, 2017 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parsibox/92587ac203482466faee6be477b468d2 to your computer and use it in GitHub Desktop.
Save parsibox/92587ac203482466faee6be477b468d2 to your computer and use it in GitHub Desktop.
connect with uap protocol to USSDC
<?
function printHex($pdu){
$ar=unpack("C*",$pdu);
foreach($ar as $v){
$s=dechex($v);
if(strlen($s)<2)$s="0$s";
print "$s ";
}
print "\n";
}
function getString(&$ar, $maxlen=255 , $i=0){
$s="";
do{
$c=array_shift($ar);
if($c!=0)$s.=chr($c);
$i++;
}while($i<$maxlen && $c!=0);
return $s;
}
$command =0x00000065;
$login = 'xxxxx';
$pass = 'yyyy';
printHex( pack("LLLLLa11a9a13L", 57 , $command , null , 0xFFFFFFFF , 0xFFFFFFFF , $login , $pass , null ,0x10 ));
//printHex( pack("a11", $login ));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment