403Webshell
Server IP : 103.119.228.120  /  Your IP : 18.225.254.81
Web Server : Apache
System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : nobody ( 99)
PHP Version : 5.6.40
Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime
MySQL : ON |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /bin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /bin/bdftogd
#!/usr/bin/perl -w

#
# Simple convertor from bdf to gd font format.
#
# Author: Jan Pazdziora, adelton@fi.muni.cz, http://www.fi.muni.cz/~adelton/
# at Faculty of Informatics, Masaryk University in Brno, Czech Republic.
#
# Example of use:
# fstobdf -s fontserverhost:7100 -fn 8x16 | ./bdftogd FontLarge gdfontl
#

use strict;

my $VERSION = '0.60';
my $now = localtime;

if (@ARGV != 2)
	{ die "usage: bdftogd fontname filename, eg. bdftogd FontLarge gdfontl\n"; }

my $gdname = shift;
$gdname = 'gd' . $gdname unless $gdname =~ /^gd/i;

my $filename = shift;
$filename = 'gd' . $filename unless $filename =~ /^gd/i;

if (-f "$filename.c") { die "File $filename.c already exists, won't overwrite\n"; }
if (-f "$filename.h") { die "File $filename.h already exists, won't overwrite\n"; }

my ($width, $height);
my (@data, @left, @bottom);
my ($globalleft, $globaltop);

my ($minchar, $maxchar);

my ($copyright, $fontdef);

my $currentchar;
my $gobitmap = 0;


while (<>)
	{
	chomp;
	s/\r$//;
	my ($tag, $value) = split / /, $_, 2;
	die "Font is not fixed width\n"
			if $tag eq 'SPACING' and not $value =~ /[CM]/i;
	
	$currentchar = $value if $tag eq 'ENCODING';
	$minchar = $currentchar if not defined $minchar
		or $currentchar < $minchar;
	$maxchar = $currentchar if not defined $maxchar
		or $currentchar > $maxchar;
	
	if ($tag eq 'ENDCHAR')
		{
		$gobitmap = 0;
		my $bottom = $globaltop - $bottom[$currentchar];
		

		if ($bottom > 0)
			{ $data[$currentchar] = substr $data[$currentchar], 0, length($data[$currentchar]) - $bottom * $width; }
		else
			{ $data[$currentchar] .= '0' x (-$bottom * $width); }
		}

	if ($tag eq 'FONTBOUNDINGBOX')
		{
		my ($tag, $wid, $hei, $left, $top) = split / /;
		if (defined $top)
			{
			$globalleft = $left;
			$globaltop = $top;
			$height = $hei;
			$width = $wid;
			}
		}
	if ($tag eq 'FONT' and not defined $fontdef)
		{ $fontdef = $value; }
	if ($tag eq 'COPYRIGHT' and not defined $copyright)
		{ $copyright = $value; }
	
	if ($tag eq 'BBX')
		{
		my ($tag, $wid, $hei, $left, $bottom) = split / /;
		if (defined $bottom)
			{
			$left[$currentchar] = $left;
			$bottom[$currentchar] = $bottom;
			}
		}

	if ($gobitmap)
		{
		my $value = pack 'H*', $_;
		my $bits = unpack 'B*', $value;
		$bits = ('0' x $left[$currentchar]) . $bits;
		$bits .= '0' x ($width - length $bits);
		$bits = substr $bits, 0, $width;
		$data[$currentchar] .= $bits;
		}
	
	if ($tag eq 'BITMAP')
		{
		$gobitmap = 1;
		$data[$currentchar] = '';
		}
	}

my $info = <<"EOF";
/*
	This is a header file for gd font, generated using
	bdftogd version $VERSION by Jan Pazdziora, adelton\@fi.muni.cz
	from bdf font
	$fontdef
	at $now.
EOF

if (defined $copyright)
	{
	$info .= <<"EOF";
	The original bdf was holding following copyright:
	$copyright
 */
EOF
	}
else
	{
	$info .= <<"EOF";
	No copyright info was found in the original bdf.
 */
EOF
	}

open FILEC, "> $filename.c" or die "Error writing $filename.c: $!\n";
open FILEH, "> $filename.h" or die "Error writing $filename.h: $!\n";
print FILEC <<"EOF";

$info

#include "$filename.h"

char ${gdname}Data[] = {
EOF

$minchar = 0 unless defined $minchar;
$maxchar = 255 unless defined $maxchar;
for (my $i = $minchar; $i <= $maxchar; $i++)
	{
	$data[$i] = '' unless defined $data[$i];
	$data[$i] = '0' x ($width * $height - length $data[$i]) . $data[$i];
	
	print FILEC "/* Char $i */\n";
	for my $line (0 .. $height - 1)
		{ print FILEC join ',', split(//, substr($data[$i], $line * $width, $width)), "\n"; }

	print FILEC "\n";

	next;
	
	for my $line (0 .. $height - 1)
		{ print substr($data[$i], $line * $width, $width), "\n"; }
	}

my $capdef = "\U_${filename}_H_";

print FILEC <<"EOF";

};

gdFont ${gdname}Rep = {
	@{[ $maxchar - $minchar + 1]},
	$minchar,
	$width,
	$height,
	${gdname}Data
};

gdFontPtr ${gdname} = &${gdname}Rep;

/* This file has not been truncated. */

EOF


close FILEC;

print FILEH <<"EOF";

#ifndef $capdef
#define $capdef 1

$info

#include "gd.h"

extern gdFontPtr $gdname;

#endif

EOF

1;


Youez - 2016 - github.com/yon3zu
LinuXploit