示例#1
0
function PrintPacketPayload($data, $encode_type, $output_type)
{
    if ($output_type == 1) {
        printf("\n<PRE>\n");
    }
    /* print the packet based on encoding type */
    if ($encode_type == "1") {
        $payload = PrintBase64PacketPayload($data, $output_type);
    } else {
        if ($encode_type == "0") {
            if (isset($_GET['asciiclean']) && $_GET['asciiclean'] == 1 || isset($_COOKIE['asciiclean']) && $_COOKIE['asciiclean'] == "clean" && !isset($_GET['asciiclean'])) {
                // Print clean ascii display
                $payload = PrintCleanHexPacketPayload($data, $output_type);
            } else {
                $payload = PrintHexPacketPayload($data, $output_type);
            }
        } else {
            if ($encode_type == "2") {
                $payload = PrintAsciiPacketPayload($data, $output_type);
            }
        }
    }
    if ($output_type == 1) {
        echo "{$payload}\n</PRE>\n";
    }
    return $payload;
}
示例#2
0
function PrintPacketPayload($data, $encode_type, $output_type)
{
    if ($output_type == 1) {
        printf("\n<PRE class='nowrapspace' style='text-align:left;color:white;background:#545454;padding:6px;margin:0px;font-family:courier,monospace;font-size:13px;'>\n");
    }
    /* print the packet based on encoding type */
    if ($encode_type == "1") {
        $payload = PrintBase64PacketPayload($data, $output_type);
    } else {
        if ($encode_type == "0") {
            if (isset($_GET['asciiclean']) && $_GET['asciiclean'] == 1 || isset($_COOKIE['asciiclean']) && $_COOKIE['asciiclean'] == "clean" && !isset($_GET['asciiclean'])) {
                // Print clean ascii display
                $payload = PrintCleanHexPacketPayload($data, $output_type);
            } else {
                $payload = PrintHexPacketPayload($data, $output_type);
            }
        } else {
            if ($encode_type == "2") {
                $payload = PrintAsciiPacketPayload($data, $output_type);
            }
        }
    }
    if ($output_type == 1) {
        echo "{$payload}\n</PRE>\n";
    }
    return $payload;
}