Created
October 6, 2017 14:39
-
-
Save parsibox/92587ac203482466faee6be477b468d2 to your computer and use it in GitHub Desktop.
connect with uap protocol to USSDC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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