Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Apache
: 172.26.7.228 | : 3.141.19.115
Cant Read [ /etc/named.conf ]
5.6.40-24+ubuntu18.04.1+deb.sury.org+1
www-data
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
html /
stph /
libgd-gd-2.2.3 /
src /
[ HOME SHELL ]
Name
Size
Permission
Action
msinttypes
[ DIR ]
drwxr-xr-x
CMakeLists.txt
3.23
KB
-rwxr-xr-x
COPYING
2.25
KB
-rwxr-xr-x
Makefile.am
1.96
KB
-rwxr-xr-x
annotate.c
4.38
KB
-rwxr-xr-x
bdftogd
3.91
KB
-rwxr-xr-x
bmp.h
2.39
KB
-rwxr-xr-x
circletexttest.c
1.49
KB
-rwxr-xr-x
config.h.cmake
3.58
KB
-rwxr-xr-x
demoin.png
9.79
KB
-rwxr-xr-x
depcomp
11.84
KB
-rwxr-xr-x
entities.h
4.81
KB
-rwxr-xr-x
entities.html
41.11
KB
-rwxr-xr-x
entities.tcl
1.35
KB
-rwxr-xr-x
fontconfigtest.c
1.34
KB
-rwxr-xr-x
fontsizetest.c
2.3
KB
-rwxr-xr-x
fontwheeltest.c
3.23
KB
-rwxr-xr-x
gd.c
89.58
KB
-rwxr-xr-x
gd.h
50.14
KB
-rwxr-xr-x
gd2copypal.c
1.25
KB
-rwxr-xr-x
gd2time.c
1.19
KB
-rwxr-xr-x
gd2togif.c
939
B
-rwxr-xr-x
gd2topng.c
1.38
KB
-rwxr-xr-x
gd_bmp.c
25.78
KB
-rwxr-xr-x
gd_color.c
798
B
-rwxr-xr-x
gd_color.h
189
B
-rwxr-xr-x
gd_color_map.c
22.71
KB
-rwxr-xr-x
gd_color_map.h
478
B
-rwxr-xr-x
gd_color_map_test.c
570
B
-rwxr-xr-x
gd_color_match.c
1.49
KB
-rwxr-xr-x
gd_crop.c
5.75
KB
-rwxr-xr-x
gd_errors.h
1.47
KB
-rwxr-xr-x
gd_filename.c
6.41
KB
-rwxr-xr-x
gd_filter.c
21
KB
-rwxr-xr-x
gd_gd.c
7.1
KB
-rwxr-xr-x
gd_gd2.c
25.85
KB
-rwxr-xr-x
gd_gif_in.c
14.79
KB
-rwxr-xr-x
gd_gif_out.c
41
KB
-rwxr-xr-x
gd_intern.h
1.95
KB
-rwxr-xr-x
gd_interpolation.c
59.19
KB
-rwxr-xr-x
gd_io.c
3.42
KB
-rwxr-xr-x
gd_io.h
3.05
KB
-rwxr-xr-x
gd_io_dp.c
7.95
KB
-rwxr-xr-x
gd_io_file.c
2.41
KB
-rwxr-xr-x
gd_io_ss.c
2.66
KB
-rwxr-xr-x
gd_io_stream.cxx
4.11
KB
-rwxr-xr-x
gd_io_stream.h
3.63
KB
-rwxr-xr-x
gd_jpeg.c
34.5
KB
-rwxr-xr-x
gd_matrix.c
7.93
KB
-rwxr-xr-x
gd_nnquant.c
15
KB
-rwxr-xr-x
gd_nnquant.h
527
B
-rwxr-xr-x
gd_png.c
30.58
KB
-rwxr-xr-x
gd_rotate.c
12.25
KB
-rwxr-xr-x
gd_security.c
692
B
-rwxr-xr-x
gd_ss.c
1.27
KB
-rwxr-xr-x
gd_tga.c
8.61
KB
-rwxr-xr-x
gd_tga.h
1.66
KB
-rwxr-xr-x
gd_tiff.c
25.85
KB
-rwxr-xr-x
gd_topal.c
55.18
KB
-rwxr-xr-x
gd_transform.c
1.48
KB
-rwxr-xr-x
gd_version.c
827
B
-rwxr-xr-x
gd_wbmp.c
6.54
KB
-rwxr-xr-x
gd_webp.c
4.25
KB
-rwxr-xr-x
gd_xbm.c
5.68
KB
-rwxr-xr-x
gdcache.c
5.14
KB
-rwxr-xr-x
gdcache.h
2.83
KB
-rwxr-xr-x
gdcmpgif.c
1.86
KB
-rwxr-xr-x
gddemo.c
5.42
KB
-rwxr-xr-x
gdfontg.c
109.84
KB
-rwxr-xr-x
gdfontg.h
553
B
-rwxr-xr-x
gdfontl.c
104.83
KB
-rwxr-xr-x
gdfontl.h
551
B
-rwxr-xr-x
gdfontmb.c
76.33
KB
-rwxr-xr-x
gdfontmb.h
519
B
-rwxr-xr-x
gdfonts.c
66.55
KB
-rwxr-xr-x
gdfonts.h
515
B
-rwxr-xr-x
gdfontt.c
36.82
KB
-rwxr-xr-x
gdfontt.h
546
B
-rwxr-xr-x
gdft.c
49.23
KB
-rwxr-xr-x
gdfx.c
13.52
KB
-rwxr-xr-x
gdfx.h
2.34
KB
-rwxr-xr-x
gdhelpers.c
1.51
KB
-rwxr-xr-x
gdhelpers.h
2.31
KB
-rwxr-xr-x
gdkanji.c
11.97
KB
-rwxr-xr-x
gdparttopng.c
1.23
KB
-rwxr-xr-x
gdpp.cxx
6.43
KB
-rwxr-xr-x
gdpp.h
50.94
KB
-rwxr-xr-x
gdtables.c
4.67
KB
-rwxr-xr-x
gdtest.c
10.27
KB
-rwxr-xr-x
gdtestft.c
5.54
KB
-rwxr-xr-x
gdtopng.c
1.01
KB
-rwxr-xr-x
gdxpm.c
4.64
KB
-rwxr-xr-x
gifanimtest.c
682
B
-rwxr-xr-x
giftogd2.c
1.12
KB
-rwxr-xr-x
jisx0208.h
73.71
KB
-rwxr-xr-x
pngtogd.c
1.03
KB
-rwxr-xr-x
pngtogd2.c
1.23
KB
-rwxr-xr-x
snprintf.c
585
B
-rwxr-xr-x
testac.c
4.14
KB
-rwxr-xr-x
testtr.c
1.33
KB
-rwxr-xr-x
wbmp.c
6.18
KB
-rwxr-xr-x
wbmp.h
1.2
KB
-rwxr-xr-x
webpng.c
6.44
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : gdkanji.c
/* gdkanji.c (Kanji code converter) */ /* written by Masahito Yamaga (ma@yama-ga.com) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include "gd.h" #include "gdhelpers.h" #include "gd_errors.h" #ifdef HAVE_ERRNO_H #include <errno.h> #endif #include <stdarg.h> #if defined(HAVE_ICONV_H) #include <iconv.h> #endif #ifndef HAVE_ICONV_T_DEF typedef void *iconv_t; #endif #ifndef HAVE_ICONV #define ICONV_CONST /**/ iconv_t iconv_open (const char *, const char *); size_t iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *); int iconv_close (iconv_t); iconv_t iconv_open (const char *tocode, const char *fromcode) { (void)tocode; (void)fromcode; return (iconv_t) (-1); } size_t iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t * inbytesleft, char **outbuf, size_t * outbytesleft) { (void)cd; (void)inbuf; (void)inbytesleft; (void)outbuf; (void)outbytesleft; return 0; } int iconv_close (iconv_t cd) { (void)cd; return 0; } #endif /* !HAVE_ICONV */ #define LIBNAME "any2eucjp()" #if defined(__MSC__) || defined(__BORLANDC__) || defined(__TURBOC__) || defined(_Windows) || defined(MSDOS) #ifndef SJISPRE #define SJISPRE 1 #endif #endif #ifdef TRUE #undef TRUE #endif #ifdef FALSE #undef FALSE #endif #define TRUE 1 #define FALSE 0 #define NEW 1 #define OLD 2 #define ESCI 3 #define NEC 4 #define EUC 5 #define SJIS 6 #define EUCORSJIS 7 #define ASCII 8 #define NEWJISSTR "JIS7" #define OLDJISSTR "jis" #define EUCSTR "eucJP" #define SJISSTR "SJIS" #define ESC 27 #define SS2 142 /* DetectKanjiCode() derived from DetectCodeType() by Ken Lunde. */ static int DetectKanjiCode (unsigned char *str) { static int whatcode = ASCII; int oldcode = ASCII; int c, i; char *lang = NULL; c = '\1'; i = 0; if (whatcode != EUCORSJIS && whatcode != ASCII) { oldcode = whatcode; whatcode = ASCII; } while ((whatcode == EUCORSJIS || whatcode == ASCII) && c != '\0') { if ((c = str[i++]) != '\0') { if (c == ESC) { c = str[i++]; if (c == '$') { c = str[i++]; if (c == 'B') whatcode = NEW; else if (c == '@') whatcode = OLD; } else if (c == '(') { c = str[i++]; if (c == 'I') whatcode = ESCI; } else if (c == 'K') whatcode = NEC; } else if ((c >= 129 && c <= 141) || (c >= 143 && c <= 159)) whatcode = SJIS; else if (c == SS2) { c = str[i++]; if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160) || (c >= 224 && c <= 252)) whatcode = SJIS; else if (c >= 161 && c <= 223) whatcode = EUCORSJIS; } else if (c >= 161 && c <= 223) { c = str[i++]; if (c >= 240 && c <= 254) whatcode = EUC; else if (c >= 161 && c <= 223) whatcode = EUCORSJIS; else if (c >= 224 && c <= 239) { whatcode = EUCORSJIS; while (c >= 64 && c != '\0' && whatcode == EUCORSJIS) { if (c >= 129) { if (c <= 141 || (c >= 143 && c <= 159)) whatcode = SJIS; else if (c >= 253 && c <= 254) whatcode = EUC; } c = str[i++]; } } else if (c <= 159) whatcode = SJIS; } else if (c >= 240 && c <= 254) whatcode = EUC; else if (c >= 224 && c <= 239) { c = str[i++]; if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160)) whatcode = SJIS; else if (c >= 253 && c <= 254) whatcode = EUC; else if (c >= 161 && c <= 252) whatcode = EUCORSJIS; } } } #ifdef DEBUG if (whatcode == ASCII) gd_error_ex(GD_DEBUG, "Kanji code not included."); else if (whatcode == EUCORSJIS) gd_error_ex(GD_DEBUG, "Kanji code not detected."); else gd_error_ex(GD_DEBUG, "Kanji code detected at %d byte.", i); #endif if (whatcode == EUCORSJIS && oldcode != ASCII) whatcode = oldcode; if (whatcode == EUCORSJIS) { if (getenv ("LC_ALL")) lang = getenv ("LC_ALL"); else if (getenv ("LC_CTYPE")) lang = getenv ("LC_CTYPE"); else if (getenv ("LANG")) lang = getenv ("LANG"); if (lang) { if (strcmp (lang, "ja_JP.SJIS") == 0 || #ifdef hpux strcmp (lang, "japanese") == 0 || #endif strcmp (lang, "ja_JP.mscode") == 0 || strcmp (lang, "ja_JP.PCK") == 0) whatcode = SJIS; else if (strncmp (lang, "ja", 2) == 0) #ifdef SJISPRE whatcode = SJIS; #else whatcode = EUC; #endif } } if (whatcode == EUCORSJIS) #ifdef SJISPRE whatcode = SJIS; #else whatcode = EUC; #endif return whatcode; } /* SJIStoJIS() is sjis2jis() by Ken Lunde. */ static void SJIStoJIS (int *p1, int *p2) { register unsigned char c1 = *p1; register unsigned char c2 = *p2; register int adjust = c2 < 159; register int rowOffset = c1 < 160 ? 112 : 176; register int cellOffset = adjust ? (31 + (c2 > 127)) : 126; *p1 = ((c1 - rowOffset) << 1) - adjust; *p2 -= cellOffset; } /* han2zen() was derived from han2zen() written by Ken Lunde. */ #define IS_DAKU(c) ((c >= 182 && c <= 196) || (c >= 202 && c <= 206) || (c == 179)) #define IS_HANDAKU(c) (c >= 202 && c <= 206) static void han2zen (int *p1, int *p2) { int c = *p1; int daku = FALSE; int handaku = FALSE; int mtable[][2] = { {129, 66}, {129, 117}, {129, 118}, {129, 65}, {129, 69}, {131, 146}, {131, 64}, {131, 66}, {131, 68}, {131, 70}, {131, 72}, {131, 131}, {131, 133}, {131, 135}, {131, 98}, {129, 91}, {131, 65}, {131, 67}, {131, 69}, {131, 71}, {131, 73}, {131, 74}, {131, 76}, {131, 78}, {131, 80}, {131, 82}, {131, 84}, {131, 86}, {131, 88}, {131, 90}, {131, 92}, {131, 94}, {131, 96}, {131, 99}, {131, 101}, {131, 103}, {131, 105}, {131, 106}, {131, 107}, {131, 108}, {131, 109}, {131, 110}, {131, 113}, {131, 116}, {131, 119}, {131, 122}, {131, 125}, {131, 126}, {131, 128}, {131, 129}, {131, 130}, {131, 132}, {131, 134}, {131, 136}, {131, 137}, {131, 138}, {131, 139}, {131, 140}, {131, 141}, {131, 143}, {131, 147}, {129, 74}, {129, 75} }; if (*p2 == 222 && IS_DAKU (*p1)) daku = TRUE; /* Daku-ten */ else if (*p2 == 223 && IS_HANDAKU (*p1)) handaku = TRUE; /* Han-daku-ten */ *p1 = mtable[c - 161][0]; *p2 = mtable[c - 161][1]; if (daku) { if ((*p2 >= 74 && *p2 <= 103) || (*p2 >= 110 && *p2 <= 122)) (*p2)++; else if (*p2 == 131 || *p2 == 69) *p2 = 148; } else if (handaku && *p2 >= 110 && *p2 <= 122) (*p2) += 2; } /* Recast strcpy to handle unsigned chars used below. */ #define ustrcpy(A,B) (strcpy((char*)(A),(const char*)(B))) #define ustrncpy(A,B, maxsize) (strncpy((char*)(A),(const char*)(B), maxsize)) static void do_convert (unsigned char **to_p, unsigned char **from_p, const char *code) { unsigned char *to = *to_p; unsigned char *from = *from_p; #ifdef HAVE_ICONV iconv_t cd; size_t from_len, to_len; if ((cd = iconv_open (EUCSTR, code)) == (iconv_t) - 1) { gd_error ("iconv_open() error"); #ifdef HAVE_ERRNO_H if (errno == EINVAL) gd_error ("invalid code specification: \"%s\" or \"%s\"", EUCSTR, code); #endif ustrcpy (to, from); return; } from_len = strlen ((const char *)from) + 1; to_len = BUFSIZ; if ((int) (iconv (cd, (char **)from_p, &from_len, (char **)to_p, &to_len)) == -1) { #ifdef HAVE_ERRNO_H if (errno == EINVAL) gd_error ("invalid end of input string"); else if (errno == EILSEQ) gd_error ("invalid code in input string"); else if (errno == E2BIG) gd_error ("output buffer overflow at do_convert()"); else #endif gd_error ("something happen"); ustrcpy (to, from); return; } if (iconv_close (cd) != 0) { gd_error ("iconv_close() error"); } #else int p1, p2, i, j; int jisx0208 = FALSE; int hankaku = FALSE; j = 0; if (strcmp (code, NEWJISSTR) == 0 || strcmp (code, OLDJISSTR) == 0) { for (i = 0; from[i] != '\0' && j < BUFSIZ; i++) { if (from[i] == ESC) { i++; if (from[i] == '$') { jisx0208 = TRUE; hankaku = FALSE; i++; } else if (from[i] == '(') { jisx0208 = FALSE; i++; if (from[i] == 'I') /* Hankaku Kana */ hankaku = TRUE; else hankaku = FALSE; } } else { if (jisx0208) to[j++] = from[i] + 128; else if (hankaku) { to[j++] = SS2; to[j++] = from[i] + 128; } else to[j++] = from[i]; } } } else if (strcmp (code, SJISSTR) == 0) { for (i = 0; from[i] != '\0' && j < BUFSIZ; i++) { p1 = from[i]; if (p1 < 127) to[j++] = p1; else if ((p1 >= 161) && (p1 <= 223)) { /* Hankaku Kana */ to[j++] = SS2; to[j++] = p1; } else { p2 = from[++i]; SJIStoJIS (&p1, &p2); to[j++] = p1 + 128; to[j++] = p2 + 128; } } } else { gd_error ("invalid code specification: \"%s\"", code); return; } if (j >= BUFSIZ) { gd_error ("output buffer overflow at do_convert()"); ustrcpy (to, from); } else to[j] = '\0'; #endif /* HAVE_ICONV */ } static int do_check_and_conv (unsigned char *to, unsigned char *from) { static unsigned char tmp[BUFSIZ]; unsigned char *tmp_p = &tmp[0]; int p1, p2, i, j; int kanji = TRUE; int copy_string = FALSE; switch (DetectKanjiCode (from)) { case NEW: gd_error_ex(GD_DEBUG, "Kanji code is New JIS."); do_convert (&tmp_p, &from, NEWJISSTR); break; case OLD: gd_error_ex(GD_DEBUG, "Kanji code is Old JIS."); do_convert (&tmp_p, &from, OLDJISSTR); break; case ESCI: gd_error_ex(GD_DEBUG, "This string includes Hankaku-Kana (jisx0201) escape sequence [ESC] + ( + I."); do_convert (&tmp_p, &from, NEWJISSTR); break; case NEC: gd_error_ex(GD_DEBUG, "Kanji code is NEC Kanji."); gd_error("cannot convert NEC Kanji."); copy_string = TRUE; kanji = FALSE; break; case EUC: gd_error_ex(GD_DEBUG, "Kanji code is EUC."); copy_string = TRUE; break; case SJIS: gd_error_ex(GD_DEBUG, "Kanji code is SJIS."); do_convert (&tmp_p, &from, SJISSTR); break; case EUCORSJIS: gd_error_ex(GD_DEBUG, "Kanji code is EUC or SJIS."); copy_string = TRUE; kanji = FALSE; break; case ASCII: gd_error_ex(GD_DEBUG, "This is ASCII string."); copy_string = TRUE; kanji = FALSE; break; default: gd_error_ex(GD_DEBUG, "This string includes unknown code."); copy_string = TRUE; kanji = FALSE; break; } if (copy_string) { ustrncpy (tmp, from, BUFSIZ); tmp[BUFSIZ-1] = '\0'; } /* Hankaku Kana ---> Zenkaku Kana */ if (kanji) { j = 0; for (i = 0; tmp[i] != '\0' && j < BUFSIZ; i++) { if (tmp[i] == SS2) { p1 = tmp[++i]; if (tmp[i + 1] == SS2) { p2 = tmp[i + 2]; if (p2 == 222 || p2 == 223) i += 2; else p2 = 0; } else p2 = 0; han2zen (&p1, &p2); SJIStoJIS (&p1, &p2); to[j++] = p1 + 128; to[j++] = p2 + 128; } else to[j++] = tmp[i]; } if (j >= BUFSIZ) { gd_error("output buffer overflow at Hankaku --> Zenkaku"); ustrcpy (to, tmp); } else to[j] = '\0'; } else ustrcpy (to, tmp); return kanji; } int any2eucjp (unsigned char *dest, unsigned char *src, unsigned int dest_max) { static unsigned char tmp_dest[BUFSIZ]; int ret; if (strlen ((const char *) src) >= BUFSIZ) { gd_error("input string too large"); return -1; } if (dest_max > BUFSIZ) { gd_error ("invalid maximum size of destination\nit should be less than %d.", BUFSIZ); return -1; } ret = do_check_and_conv (tmp_dest, src); if (strlen ((const char *) tmp_dest) >= dest_max) { gd_error("output buffer overflow"); ustrcpy (dest, src); return -1; } ustrcpy (dest, tmp_dest); return ret; } #if 0 unsigned int strwidth (unsigned char *s) { unsigned char *t; unsigned int i; t = (unsigned char *) gdMalloc (BUFSIZ); any2eucjp (t, s, BUFSIZ); i = strlen (t); gdFree (t); return i; } #ifdef DEBUG int main () { unsigned char input[BUFSIZ]; unsigned char *output; unsigned char *str; int c, i = 0; while ((c = fgetc (stdin)) != '\n' && i < BUFSIZ) input[i++] = c; input[i] = '\0'; printf ("input : %d bytes\n", strlen ((const char *) input)); printf ("output: %d bytes\n", strwidth (input)); output = (unsigned char *) gdMalloc (BUFSIZ); any2eucjp (output, input, BUFSIZ); str = output; while (*str != '\0') putchar (*(str++)); putchar ('\n'); gdFree (output); return 0; } #endif #endif
Close