├── .gitignore ├── pe.old ├── BE_ALL.C ├── BE_ALL_S.C ├── BE_NONE.C ├── BE_NOSSH.C ├── BE_NOS_S.C ├── BUILDSCR ├── CHARSET │ ├── CHARSET.H │ ├── ENUM.C │ ├── FROMUCS.C │ ├── INTERNAL.H │ ├── LOCALENC.C │ ├── MACENC.C │ ├── MIMEENC.C │ ├── README │ ├── SBCS.C │ ├── SBCS.DAT │ ├── SBCSDAT.C │ ├── SBCSGEN.PL │ ├── SLOOKUP.C │ ├── TOUCS.C │ ├── UTF8.C │ └── XENC.C ├── CMDGEN.C ├── CMDLINE.C ├── CONFIG.C ├── CONTRIB │ ├── CYGTERMD │ │ ├── MAIN.C │ │ ├── MAKEFILE │ │ ├── MALLOC.C │ │ ├── MALLOC.H │ │ ├── PTY.C │ │ ├── PTY.H │ │ ├── README │ │ ├── SEL.C │ │ ├── SEL.H │ │ ├── TELNET.C │ │ └── TELNET.H │ └── KH2REG.PY ├── CPROXY.C ├── DIALOG.C ├── DIALOG.H ├── DOC │ ├── BLURB.BUT │ ├── CHM.BUT │ ├── CHM.CSS │ ├── CONFIG.BUT │ ├── ERRORS.BUT │ ├── FAQ.BUT │ ├── FEEDBACK.BUT │ ├── GS.BUT │ ├── INDEX.BUT │ ├── INTRO.BUT │ ├── LICENCE.BUT │ ├── MAKEFILE │ ├── MAN-PG.BUT │ ├── MAN-PL.BUT │ ├── MAN-PSCP.BUT │ ├── MAN-PSFT.BUT │ ├── MAN-PTEL.BUT │ ├── MAN-PTER.BUT │ ├── MAN-PUTT.BUT │ ├── MANCFG.BUT │ ├── MANPAGES.BUT │ ├── PAGEANT.BUT │ ├── PGPKEYS.BUT │ ├── PLINK.BUT │ ├── PSCP.BUT │ ├── PSFTP.BUT │ ├── PUBKEY.BUT │ ├── SITE.BUT │ ├── SSHNAMES.BUT │ ├── UDP.BUT │ ├── USING.BUT │ └── VIDS.BUT ├── ICONS │ ├── CICON.PL │ ├── ICON.PL │ ├── MAKEFILE │ └── MKICON.PY ├── IMPORT.C ├── INT64.C ├── INT64.H ├── LDISC.C ├── LDISC.H ├── LDISCUCS.C ├── LICENCE ├── LOGGING.C ├── MACOSX │ ├── INFO.PLI │ ├── MAKEFILE │ ├── OSX.H │ ├── OSXCLASS.H │ ├── OSXCTRLS.M │ ├── OSXDLG.M │ ├── OSXMAIN.M │ ├── OSXSEL.M │ ├── OSXWIN.M │ ├── PUTTY.ICN │ └── README.OSX ├── MINIBIDI.C ├── MISC.C ├── MISC.H ├── MKAUTO.SH ├── MKFILES.PL ├── MKUNXARC.SH ├── NETWORK.H ├── NOCPROXY.C ├── NOGSS.C ├── NOPRINT.C ├── NOTIMING.C ├── PGSSAPI.C ├── PGSSAPI.H ├── PINGER.C ├── PORTFWD.C ├── PPROXY.C ├── PROXY.C ├── PROXY.H ├── PSCP.C ├── PSFTP.C ├── PSFTP.H ├── PUTTY.H ├── PUTTYMEM.H ├── PUTTYPS.H ├── RAW.C ├── README ├── RECIPE ├── RESOURCE.H ├── RLOGIN.C ├── SERCFG.C ├── SETTINGS.C ├── SFTP.C ├── SFTP.H ├── SIGN.SH ├── SSH.C ├── SSH.H ├── SSHAES.C ├── SSHARCF.C ├── SSHBLOWF.C ├── SSHBN.C ├── SSHCRC.C ├── SSHCRCDA.C ├── SSHDES.C ├── SSHDH.C ├── SSHDSS.C ├── SSHDSSG.C ├── SSHGSS.H ├── SSHGSSC.C ├── SSHGSSC.H ├── SSHMD5.C ├── SSHNOGSS.C ├── SSHPRIME.C ├── SSHPUBK.C ├── SSHRAND.C ├── SSHRSA.C ├── SSHRSAG.C ├── SSHSH256.C ├── SSHSH512.C ├── SSHSHA.C ├── SSHZLIB.C ├── STORAGE.H ├── TELNET.C ├── TERMINAL.C ├── TERMINAL.H ├── TESTBACK.C ├── TESTDATA │ ├── BIGNUM.PY │ ├── COLOURS.TXT │ ├── LATTRS.TXT │ ├── SCOCOLS.TXT │ ├── UTF8.TXT │ └── VT100.TXT ├── TIME.C ├── TIMING.C ├── TREE234.C ├── TREE234.H ├── UNIX │ ├── CONFIGUR.AC │ ├── GTKCFG.C │ ├── GTKCOLS.C │ ├── GTKCOLS.H │ ├── GTKDLG.C │ ├── GTKFONT.C │ ├── GTKFONT.H │ ├── GTKWIN.C │ ├── MAKEFILE.GTK │ ├── MAKEFILE.IN │ ├── MAKEFILE.UX │ ├── UNIX.H │ ├── UXAGENTC.C │ ├── UXCFG.C │ ├── UXCONS.C │ ├── UXGEN.C │ ├── UXGSS.C │ ├── UXMISC.C │ ├── UXNET.C │ ├── UXNOISE.C │ ├── UXPLINK.C │ ├── UXPRINT.C │ ├── UXPROXY.C │ ├── UXPTERM.C │ ├── UXPTY.C │ ├── UXPUTTY.C │ ├── UXSEL.C │ ├── UXSER.C │ ├── UXSFTP.C │ ├── UXSIGNAL.C │ ├── UXSTORE.C │ ├── UXUCS.C │ ├── UX_X11.C │ ├── XKEYSYM.C │ ├── XPMPTCFG.C │ ├── XPMPTERM.C │ ├── XPMPUCFG.C │ └── XPMPUTTY.C ├── VERSION.C ├── WCWIDTH.C ├── WILDCARD.C ├── WINDOWS │ ├── DEVCPP │ │ ├── PAGEANT │ │ │ └── PAGEANT.DEV │ │ ├── PLINK │ │ │ └── PLINK.DEV │ │ ├── PSCP │ │ │ └── PSCP.DEV │ │ ├── PSFTP │ │ │ └── PSFTP.DEV │ │ ├── PUTTY │ │ │ └── PUTTY.DEV │ │ ├── PUTTYGEN │ │ │ └── PUTTYGEN.DEV │ │ └── PUTTYTEL │ │ │ └── PUTTYTEL.DEV │ ├── MAKEFILE.BOR │ ├── MAKEFILE.CYG │ ├── MAKEFILE.LCC │ ├── MAKEFILE.VC │ ├── MSVC │ │ ├── PAGEANT │ │ │ ├── PAGEANT.DSP │ │ │ ├── PAGEANT.vcxproj │ │ │ ├── PAGEANT.vcxproj.filters │ │ │ └── PAGEANT.vcxproj.user │ │ ├── PLINK │ │ │ ├── PLINK.DSP │ │ │ ├── PLINK.vcxproj │ │ │ ├── PLINK.vcxproj.filters │ │ │ └── PLINK.vcxproj.user │ │ ├── PSCP │ │ │ ├── PSCP.DSP │ │ │ ├── PSCP.vcxproj │ │ │ ├── PSCP.vcxproj.filters │ │ │ └── PSCP.vcxproj.user │ │ ├── PSFTP │ │ │ ├── PSFTP.DSP │ │ │ ├── PSFTP.vcxproj │ │ │ ├── PSFTP.vcxproj.filters │ │ │ └── PSFTP.vcxproj.user │ │ ├── PUTTY.DSW │ │ ├── PUTTY.sln │ │ ├── PUTTY │ │ │ ├── PUTTY.DSP │ │ │ ├── PUTTY.vcxproj │ │ │ ├── PUTTY.vcxproj.filters │ │ │ └── PUTTY.vcxproj.user │ │ ├── PUTTYGEN │ │ │ ├── PUTTYGEN.DSP │ │ │ ├── PUTTYGEN.vcxproj │ │ │ ├── PUTTYGEN.vcxproj.filters │ │ │ └── PUTTYGEN.vcxproj.user │ │ └── PUTTYTEL │ │ │ ├── PUTTYTEL.DSP │ │ │ ├── PUTTYTEL.vcxproj │ │ │ ├── PUTTYTEL.vcxproj.filters │ │ │ └── PUTTYTEL.vcxproj.user │ ├── PAGEANT.ICO │ ├── PAGEANT.MFT │ ├── PAGEANT.RC │ ├── PAGEANTS.ICO │ ├── PLINK.RC │ ├── PSCP.ICO │ ├── PSCP.RC │ ├── PSFTP.RC │ ├── PUTTY-BACKUP.ICO │ ├── PUTTY.ICO │ ├── PUTTY.ISS │ ├── PUTTY.MFT │ ├── PUTTY.RC │ ├── PUTTYCFG.ICO │ ├── PUTTYGEN.ICO │ ├── PUTTYGEN.MFT │ ├── PUTTYGEN.RC │ ├── PUTTYINS.ICO │ ├── PUTTYTEL.RC │ ├── RCSTUFF.H │ ├── README.TXT │ ├── SIZETIP.C │ ├── VERSION.RC2 │ ├── WEBSITE.URL │ ├── WINCFG.C │ ├── WINCONS.C │ ├── WINCTRLS.C │ ├── WINDEFS.C │ ├── WINDLG.C │ ├── WINDOW.C │ ├── WINGSS.C │ ├── WINHANDL.C │ ├── WINHELP.C │ ├── WINHELP.H │ ├── WINJUMP.C │ ├── WINMISC.C │ ├── WINNET.C │ ├── WINNOISE.C │ ├── WINNOJMP.C │ ├── WINPGEN.C │ ├── WINPGNT.C │ ├── WINPGNTC.C │ ├── WINPLINK.C │ ├── WINPRINT.C │ ├── WINPROXY.C │ ├── WINSER.C │ ├── WINSFTP.C │ ├── WINSTORE.C │ ├── WINSTUFF.H │ ├── WINTIME.C │ ├── WINUCS.C │ ├── WINUTILS.C │ ├── WINX11.C │ ├── WIN_RES.H │ ├── WIN_RES.RC2 │ ├── putty.aps │ └── resource.h └── X11FWD.C └── pe ├── Default.sln └── Default ├── Default.cpp ├── Default.h ├── Default.ico ├── Default.rc ├── Default.vcxproj ├── Default.vcxproj.filters ├── Default.vcxproj.user ├── ReadMe.txt ├── Resource.h ├── small.ico ├── stdafx.cpp ├── stdafx.h └── targetver.h /.gitignore: -------------------------------------------------------------------------------- 1 | Release/ 2 | Debug/ 3 | *.cer 4 | *.zip 5 | *.obj 6 | *.dll 7 | *.exe 8 | *.tlog 9 | *.ncb 10 | *.suo 11 | *.lib 12 | *.res 13 | *.pdb 14 | *.tlh 15 | *.tli 16 | *.opensdf 17 | *.manifest 18 | *.exp 19 | *.lastbuildstate 20 | *.sdf 21 | *.log 22 | *.ipch 23 | *manifest.rc 24 | *.idb 25 | *.unsuccessfulbuild 26 | -------------------------------------------------------------------------------- /pe.old/BE_ALL.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Linking module for PuTTY proper: list the available backends 3 | * including ssh. 4 | */ 5 | 6 | #include 7 | #include "putty.h" 8 | 9 | /* 10 | * This appname is not strictly in the right place, since Plink 11 | * also uses this module. However, Plink doesn't currently use any 12 | * of the dialog-box sorts of things that make use of appname, so 13 | * it shouldn't do any harm here. I'm trying to avoid having to 14 | * have tiny little source modules containing nothing but 15 | * declarations of appname, for as long as I can... 16 | */ 17 | const char *const appname = "PuTTY"; 18 | 19 | #ifdef TELNET_DEFAULT 20 | const int be_default_protocol = PROT_TELNET; 21 | #else 22 | const int be_default_protocol = PROT_SSH; 23 | #endif 24 | 25 | Backend *backends[] = { 26 | &ssh_backend, 27 | &telnet_backend, 28 | &rlogin_backend, 29 | &raw_backend, 30 | NULL 31 | }; 32 | -------------------------------------------------------------------------------- /pe.old/BE_ALL_S.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Linking module for PuTTY proper: list the available backends 3 | * including ssh, plus the serial backend. 4 | */ 5 | 6 | #include 7 | #include "putty.h" 8 | 9 | /* 10 | * This appname is not strictly in the right place, since Plink 11 | * also uses this module. However, Plink doesn't currently use any 12 | * of the dialog-box sorts of things that make use of appname, so 13 | * it shouldn't do any harm here. I'm trying to avoid having to 14 | * have tiny little source modules containing nothing but 15 | * declarations of appname, for as long as I can... 16 | */ 17 | const char *const appname = "PuTTY"; 18 | 19 | #ifdef TELNET_DEFAULT 20 | const int be_default_protocol = PROT_TELNET; 21 | #else 22 | const int be_default_protocol = PROT_SSH; 23 | #endif 24 | 25 | Backend *backends[] = { 26 | &ssh_backend, 27 | &telnet_backend, 28 | &rlogin_backend, 29 | &raw_backend, 30 | &serial_backend, 31 | NULL 32 | }; 33 | -------------------------------------------------------------------------------- /pe.old/BE_NONE.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Linking module for programs that do not support selection of backend 3 | * (such as pscp or pterm). 4 | */ 5 | 6 | #include 7 | #include "putty.h" 8 | 9 | Backend *backends[] = { 10 | NULL 11 | }; 12 | -------------------------------------------------------------------------------- /pe.old/BE_NOSSH.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Linking module for PuTTYtel: list the available backends not 3 | * including ssh. 4 | */ 5 | 6 | #include 7 | #include "putty.h" 8 | 9 | const int be_default_protocol = PROT_TELNET; 10 | 11 | const char *const appname = "PuTTYtel"; 12 | 13 | Backend *backends[] = { 14 | &telnet_backend, 15 | &rlogin_backend, 16 | &raw_backend, 17 | NULL 18 | }; 19 | 20 | /* 21 | * Stub implementations of functions not used in non-ssh versions. 22 | */ 23 | void random_save_seed(void) 24 | { 25 | } 26 | 27 | void random_destroy_seed(void) 28 | { 29 | } 30 | 31 | void noise_ultralight(unsigned long data) 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /pe.old/BE_NOS_S.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Linking module for PuTTYtel: list the available backends not 3 | * including ssh. 4 | */ 5 | 6 | #include 7 | #include "putty.h" 8 | 9 | const int be_default_protocol = PROT_TELNET; 10 | 11 | const char *const appname = "PuTTYtel"; 12 | 13 | Backend *backends[] = { 14 | &telnet_backend, 15 | &rlogin_backend, 16 | &raw_backend, 17 | &serial_backend, 18 | NULL 19 | }; 20 | 21 | /* 22 | * Stub implementations of functions not used in non-ssh versions. 23 | */ 24 | void random_save_seed(void) 25 | { 26 | } 27 | 28 | void random_destroy_seed(void) 29 | { 30 | } 31 | 32 | void noise_ultralight(unsigned long data) 33 | { 34 | } 35 | -------------------------------------------------------------------------------- /pe.old/CHARSET/ENUM.C: -------------------------------------------------------------------------------- 1 | /* 2 | * enum.c - enumerate all charsets defined by the library. 3 | * 4 | * This file maintains a list of every other source file which 5 | * contains ENUM_CHARSET definitions. It #includes each one with 6 | * ENUM_CHARSETS defined, which causes those source files to do 7 | * nothing at all except call the ENUM_CHARSET macro on each 8 | * charset they define. 9 | * 10 | * This file in turn is included from various other places, with 11 | * the ENUM_CHARSET macro defined to various different things. This 12 | * allows us to have multiple implementations of the master charset 13 | * lookup table (a static one and a dynamic one). 14 | */ 15 | 16 | #define ENUM_CHARSETS 17 | #include "sbcsdat.c" 18 | #include "utf8.c" 19 | #undef ENUM_CHARSETS 20 | -------------------------------------------------------------------------------- /pe.old/CHARSET/FROMUCS.C: -------------------------------------------------------------------------------- 1 | /* 2 | * fromucs.c - convert Unicode to other character sets. 3 | */ 4 | 5 | #include "charset.h" 6 | #include "internal.h" 7 | 8 | struct charset_emit_param { 9 | char *output; 10 | int outlen; 11 | const char *errstr; 12 | int errlen; 13 | int stopped; 14 | }; 15 | 16 | static void charset_emit(void *ctx, long int output) 17 | { 18 | struct charset_emit_param *param = (struct charset_emit_param *)ctx; 19 | char outval; 20 | char const *p; 21 | int outlen; 22 | 23 | if (output == ERROR) { 24 | p = param->errstr; 25 | outlen = param->errlen; 26 | } else { 27 | outval = output; 28 | p = &outval; 29 | outlen = 1; 30 | } 31 | 32 | if (param->outlen >= outlen) { 33 | while (outlen > 0) { 34 | *param->output++ = *p++; 35 | param->outlen--; 36 | outlen--; 37 | } 38 | } else { 39 | param->stopped = 1; 40 | } 41 | } 42 | 43 | int charset_from_unicode(wchar_t **input, int *inlen, char *output, int outlen, 44 | int charset, charset_state *state, 45 | const char *errstr, int errlen) 46 | { 47 | charset_spec const *spec = charset_find_spec(charset); 48 | charset_state localstate; 49 | struct charset_emit_param param; 50 | 51 | param.output = output; 52 | param.outlen = outlen; 53 | param.stopped = 0; 54 | 55 | /* 56 | * charset_emit will expect a valid errstr. 57 | */ 58 | if (!errstr) { 59 | /* *shrug* this is good enough, and consistent across all SBCS... */ 60 | param.errstr = "."; 61 | param.errlen = 1; 62 | } 63 | param.errstr = errstr; 64 | param.errlen = errlen; 65 | 66 | if (!state) { 67 | localstate.s0 = 0; 68 | } else { 69 | localstate = *state; /* structure copy */ 70 | } 71 | state = &localstate; 72 | 73 | while (*inlen > 0) { 74 | int lenbefore = param.output - output; 75 | spec->write(spec, **input, &localstate, charset_emit, ¶m); 76 | if (param.stopped) { 77 | /* 78 | * The emit function has _tried_ to output some 79 | * characters, but ran up against the end of the 80 | * buffer. Leave immediately, and return what happened 81 | * _before_ attempting to process this character. 82 | */ 83 | return lenbefore; 84 | } 85 | if (state) 86 | *state = localstate; /* structure copy */ 87 | (*input)++; 88 | (*inlen)--; 89 | } 90 | return param.output - output; 91 | } 92 | -------------------------------------------------------------------------------- /pe.old/CHARSET/INTERNAL.H: -------------------------------------------------------------------------------- 1 | /* 2 | * internal.h - internal header stuff for the charset library. 3 | */ 4 | 5 | #ifndef charset_internal_h 6 | #define charset_internal_h 7 | 8 | /* This invariably comes in handy */ 9 | #define lenof(x) ( sizeof((x)) / sizeof(*(x)) ) 10 | 11 | /* This is an invalid Unicode value used to indicate an error. */ 12 | #define ERROR 0xFFFFL /* Unicode value representing error */ 13 | 14 | typedef struct charset_spec charset_spec; 15 | typedef struct sbcs_data sbcs_data; 16 | 17 | struct charset_spec { 18 | int charset; /* numeric identifier */ 19 | 20 | /* 21 | * A function to read the character set and output Unicode 22 | * characters. The `emit' function expects to get Unicode chars 23 | * passed to it; it should be sent ERROR for any encoding error 24 | * on the input. 25 | */ 26 | void (*read)(charset_spec const *charset, long int input_chr, 27 | charset_state *state, 28 | void (*emit)(void *ctx, long int output), void *emitctx); 29 | /* 30 | * A function to read Unicode characters and output in this 31 | * character set. The `emit' function expects to get byte 32 | * values passed to it; it should be sent ERROR for any 33 | * non-representable characters on the input. 34 | */ 35 | void (*write)(charset_spec const *charset, long int input_chr, 36 | charset_state *state, 37 | void (*emit)(void *ctx, long int output), void *emitctx); 38 | void const *data; 39 | }; 40 | 41 | /* 42 | * This is the format of `data' used by the SBCS read and write 43 | * functions; so it's the format used in all SBCS definitions. 44 | */ 45 | struct sbcs_data { 46 | /* 47 | * This is a simple mapping table converting each SBCS position 48 | * to a Unicode code point. Some positions may contain ERROR, 49 | * indicating that that byte value is not defined in the SBCS 50 | * in question and its occurrence in input is an error. 51 | */ 52 | unsigned long sbcs2ucs[256]; 53 | 54 | /* 55 | * This lookup table is used to convert Unicode back to the 56 | * SBCS. It consists of the valid byte values in the SBCS, 57 | * sorted in order of their Unicode translation. So given a 58 | * Unicode value U, you can do a binary search on this table 59 | * using the above table as a lookup: when testing the Xth 60 | * position in this table, you branch according to whether 61 | * sbcs2ucs[ucs2sbcs[X]] is less than, greater than, or equal 62 | * to U. 63 | * 64 | * Note that since there may be fewer than 256 valid byte 65 | * values in a particular SBCS, we must supply the length of 66 | * this table as well as the contents. 67 | */ 68 | unsigned char ucs2sbcs[256]; 69 | int nvalid; 70 | }; 71 | 72 | /* 73 | * Prototypes for internal library functions. 74 | */ 75 | charset_spec const *charset_find_spec(int charset); 76 | void read_sbcs(charset_spec const *charset, long int input_chr, 77 | charset_state *state, 78 | void (*emit)(void *ctx, long int output), void *emitctx); 79 | void write_sbcs(charset_spec const *charset, long int input_chr, 80 | charset_state *state, 81 | void (*emit)(void *ctx, long int output), void *emitctx); 82 | 83 | /* 84 | * Placate compiler warning about unused parameters, of which we 85 | * expect to have some in this library. 86 | */ 87 | #define UNUSEDARG(x) ( (x) = (x) ) 88 | 89 | #endif /* charset_internal_h */ 90 | -------------------------------------------------------------------------------- /pe.old/CHARSET/LOCALENC.C: -------------------------------------------------------------------------------- 1 | /* 2 | * local.c - translate our internal character set codes to and from 3 | * our own set of plausibly legible character-set names. Also 4 | * provides a canonical name for each encoding (useful for software 5 | * announcing what character set it will be using), and a set of 6 | * enumeration functions which return a list of supported 7 | * encodings one by one. 8 | * 9 | * charset_from_localenc will attempt all other text translations 10 | * as well as this table, to maximise the number of different ways 11 | * you can select a supported charset. 12 | */ 13 | 14 | #include 15 | #include "charset.h" 16 | #include "internal.h" 17 | 18 | static const struct { 19 | const char *name; 20 | int charset; 21 | int return_in_enum; /* enumeration misses some charsets */ 22 | } localencs[] = { 23 | { "", CS_NONE, 0 }, 24 | { "ISO-8859-1", CS_ISO8859_1, 1 }, 25 | { "ISO-8859-1 with X11 line drawing", CS_ISO8859_1_X11, 0 }, 26 | { "ISO-8859-2", CS_ISO8859_2, 1 }, 27 | { "ISO-8859-3", CS_ISO8859_3, 1 }, 28 | { "ISO-8859-4", CS_ISO8859_4, 1 }, 29 | { "ISO-8859-5", CS_ISO8859_5, 1 }, 30 | { "ISO-8859-6", CS_ISO8859_6, 1 }, 31 | { "ISO-8859-7", CS_ISO8859_7, 1 }, 32 | { "ISO-8859-8", CS_ISO8859_8, 1 }, 33 | { "ISO-8859-9", CS_ISO8859_9, 1 }, 34 | { "ISO-8859-10", CS_ISO8859_10, 1 }, 35 | { "ISO-8859-11", CS_ISO8859_11, 1 }, 36 | { "ISO-8859-13", CS_ISO8859_13, 1 }, 37 | { "ISO-8859-14", CS_ISO8859_14, 1 }, 38 | { "ISO-8859-15", CS_ISO8859_15, 1 }, 39 | { "ISO-8859-16", CS_ISO8859_16, 1 }, 40 | { "CP437", CS_CP437, 1 }, 41 | { "CP850", CS_CP850, 1 }, 42 | { "CP866", CS_CP866, 1 }, 43 | { "CP1250", CS_CP1250, 1 }, 44 | { "CP1251", CS_CP1251, 1 }, 45 | { "CP1252", CS_CP1252, 1 }, 46 | { "CP1253", CS_CP1253, 1 }, 47 | { "CP1254", CS_CP1254, 1 }, 48 | { "CP1255", CS_CP1255, 1 }, 49 | { "CP1256", CS_CP1256, 1 }, 50 | { "CP1257", CS_CP1257, 1 }, 51 | { "CP1258", CS_CP1258, 1 }, 52 | { "KOI8-R", CS_KOI8_R, 1 }, 53 | { "KOI8-U", CS_KOI8_U, 1 }, 54 | { "Mac Roman", CS_MAC_ROMAN, 1 }, 55 | { "Mac Turkish", CS_MAC_TURKISH, 1 }, 56 | { "Mac Croatian", CS_MAC_CROATIAN, 1 }, 57 | { "Mac Iceland", CS_MAC_ICELAND, 1 }, 58 | { "Mac Romanian", CS_MAC_ROMANIAN, 1 }, 59 | { "Mac Greek", CS_MAC_GREEK, 1 }, 60 | { "Mac Cyrillic", CS_MAC_CYRILLIC, 1 }, 61 | { "Mac Thai", CS_MAC_THAI, 1 }, 62 | { "Mac Centeuro", CS_MAC_CENTEURO, 1 }, 63 | { "Mac Symbol", CS_MAC_SYMBOL, 1 }, 64 | { "Mac Dingbats", CS_MAC_DINGBATS, 1 }, 65 | { "Mac Roman (old)", CS_MAC_ROMAN_OLD, 0 }, 66 | { "Mac Croatian (old)", CS_MAC_CROATIAN_OLD, 0 }, 67 | { "Mac Iceland (old)", CS_MAC_ICELAND_OLD, 0 }, 68 | { "Mac Romanian (old)", CS_MAC_ROMANIAN_OLD, 0 }, 69 | { "Mac Greek (old)", CS_MAC_GREEK_OLD, 0 }, 70 | { "Mac Cyrillic (old)", CS_MAC_CYRILLIC_OLD, 0 }, 71 | { "Mac Ukraine", CS_MAC_UKRAINE, 1 }, 72 | { "Mac VT100", CS_MAC_VT100, 1 }, 73 | { "Mac VT100 (old)", CS_MAC_VT100_OLD, 0 }, 74 | { "VISCII", CS_VISCII, 1 }, 75 | { "HP ROMAN8", CS_HP_ROMAN8, 1 }, 76 | { "DEC MCS", CS_DEC_MCS, 1 }, 77 | { "UTF-8", CS_UTF8, 1 }, 78 | }; 79 | 80 | const char *charset_to_localenc(int charset) 81 | { 82 | int i; 83 | 84 | for (i = 0; i < (int)lenof(localencs); i++) 85 | if (charset == localencs[i].charset) 86 | return localencs[i].name; 87 | 88 | return NULL; /* not found */ 89 | } 90 | 91 | int charset_from_localenc(const char *name) 92 | { 93 | int i; 94 | 95 | if ( (i = charset_from_mimeenc(name)) != CS_NONE) 96 | return i; 97 | if ( (i = charset_from_xenc(name)) != CS_NONE) 98 | return i; 99 | 100 | for (i = 0; i < (int)lenof(localencs); i++) { 101 | const char *p, *q; 102 | p = name; 103 | q = localencs[i].name; 104 | while (*p || *q) { 105 | if (tolower((unsigned char)*p) != tolower((unsigned char)*q)) 106 | break; 107 | p++; q++; 108 | } 109 | if (!*p && !*q) 110 | return localencs[i].charset; 111 | } 112 | 113 | return CS_NONE; /* not found */ 114 | } 115 | 116 | int charset_localenc_nth(int n) 117 | { 118 | int i; 119 | 120 | for (i = 0; i < (int)lenof(localencs); i++) 121 | if (localencs[i].return_in_enum && !n--) 122 | return localencs[i].charset; 123 | 124 | return CS_NONE; /* end of list */ 125 | } 126 | -------------------------------------------------------------------------------- /pe.old/CHARSET/README: -------------------------------------------------------------------------------- 1 | This subdirectory contains a general character-set conversion 2 | library, used in the Unix port of PuTTY, and available for use in 3 | other ports if it should happen to be useful. 4 | 5 | This is a variant of a library that's currently used in some other 6 | programs such as Timber and Halibut. At some future date, we would 7 | like to merge the two libraries, so that all programs use the same 8 | libcharset. 9 | 10 | It is therefore a _strong_ design goal that this library should remain 11 | perfectly general, and not tied to particulars of PuTTY. It must not 12 | reference any code outside its own subdirectory; it should not have 13 | PuTTY-specific helper routines added to it unless they can be 14 | documented in a general manner which might make them useful in other 15 | circumstances as well. 16 | -------------------------------------------------------------------------------- /pe.old/CHARSET/SBCS.C: -------------------------------------------------------------------------------- 1 | /* 2 | * sbcs.c - routines to handle single-byte character sets. 3 | */ 4 | 5 | #include "charset.h" 6 | #include "internal.h" 7 | 8 | /* 9 | * The charset_spec for any single-byte character set should 10 | * provide read_sbcs() as its read function, and its `data' field 11 | * should be a wchar_t string constant containing the 256 entries 12 | * of the translation table. 13 | */ 14 | 15 | void read_sbcs(charset_spec const *charset, long int input_chr, 16 | charset_state *state, 17 | void (*emit)(void *ctx, long int output), void *emitctx) 18 | { 19 | const struct sbcs_data *sd = charset->data; 20 | 21 | UNUSEDARG(state); 22 | 23 | emit(emitctx, sd->sbcs2ucs[input_chr]); 24 | } 25 | 26 | void write_sbcs(charset_spec const *charset, long int input_chr, 27 | charset_state *state, 28 | void (*emit)(void *ctx, long int output), void *emitctx) 29 | { 30 | const struct sbcs_data *sd = charset->data; 31 | int i, j, k, c; 32 | 33 | UNUSEDARG(state); 34 | 35 | /* 36 | * Binary-search in the ucs2sbcs table. 37 | */ 38 | i = -1; 39 | j = sd->nvalid; 40 | while (i+1 < j) { 41 | k = (i+j)/2; 42 | c = sd->ucs2sbcs[k]; 43 | if (input_chr < sd->sbcs2ucs[c]) 44 | j = k; 45 | else if (input_chr > sd->sbcs2ucs[c]) 46 | i = k; 47 | else { 48 | emit(emitctx, c); 49 | return; 50 | } 51 | } 52 | emit(emitctx, ERROR); 53 | } 54 | -------------------------------------------------------------------------------- /pe.old/CHARSET/SBCSGEN.PL: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl -w 2 | 3 | # This script generates sbcsdat.c (the data for all the SBCSes) from its 4 | # source form sbcs.dat. 5 | 6 | $infile = "sbcs.dat"; 7 | $outfile = "sbcsdat.c"; 8 | 9 | open FOO, $infile; 10 | open BAR, ">$outfile"; 11 | select BAR; 12 | 13 | print "/*\n"; 14 | print " * sbcsdat.c - data definitions for single-byte character sets.\n"; 15 | print " *\n"; 16 | print " * Generated by sbcsgen.pl from sbcs.dat.\n"; 17 | print " * You should edit those files rather than editing this one.\n"; 18 | print " */\n"; 19 | print "\n"; 20 | print "#ifndef ENUM_CHARSETS\n"; 21 | print "\n"; 22 | print "#include \"charset.h\"\n"; 23 | print "#include \"internal.h\"\n"; 24 | print "\n"; 25 | 26 | my $charsetname = undef; 27 | my @vals = (); 28 | 29 | my @charsetnames = (); 30 | my @sortpriority = (); 31 | 32 | while () { 33 | chomp; 34 | if (/^charset (.*)$/) { 35 | $charsetname = $1; 36 | @vals = (); 37 | @sortpriority = map { 0 } 0..255; 38 | } elsif (/^sortpriority ([^-]*)-([^-]*) (.*)$/) { 39 | for ($i = hex $1; $i <= hex $2; $i++) { 40 | $sortpriority[$i] += $3; 41 | } 42 | } elsif (/^[0-9a-fA-FX]/) { 43 | push @vals, map { $_ eq "XXXX" ? -1 : hex $_ } split / +/, $_; 44 | if (scalar @vals > 256) { 45 | die "$infile:$.: charset $charsetname has more than 256 values\n"; 46 | } elsif (scalar @vals == 256) { 47 | &outcharset($charsetname, \@vals, \@sortpriority); 48 | push @charsetnames, $charsetname; 49 | $charsetname = undef; 50 | @vals = (); 51 | @sortpriority = map { 0 } 0..255; 52 | } 53 | } 54 | } 55 | 56 | print "#else /* ENUM_CHARSETS */\n"; 57 | print "\n"; 58 | 59 | foreach $i (@charsetnames) { 60 | print "ENUM_CHARSET($i)\n"; 61 | } 62 | 63 | print "\n"; 64 | print "#endif /* ENUM_CHARSETS */\n"; 65 | 66 | sub outcharset($$$) { 67 | my ($name, $vals, $sortpriority) = @_; 68 | my ($prefix, $i, @sorted); 69 | 70 | print "static const sbcs_data data_$name = {\n"; 71 | print " {\n"; 72 | $prefix = " "; 73 | @sorted = (); 74 | for ($i = 0; $i < 256; $i++) { 75 | if ($vals->[$i] < 0) { 76 | printf "%sERROR ", $prefix; 77 | } else { 78 | printf "%s0x%04x", $prefix, $vals->[$i]; 79 | die "ooh? $i\n" unless defined $sortpriority->[$i]; 80 | push @sorted, [$i, $vals->[$i], 0+$sortpriority->[$i]]; 81 | } 82 | if ($i % 8 == 7) { 83 | $prefix = ",\n "; 84 | } else { 85 | $prefix = ", "; 86 | } 87 | } 88 | print "\n },\n {\n"; 89 | @sorted = sort { ($a->[1] == $b->[1] ? 90 | $b->[2] <=> $a->[2] : 91 | $a->[1] <=> $b->[1]) || 92 | $a->[0] <=> $b->[0] } @sorted; 93 | $prefix = " "; 94 | $uval = -1; 95 | for ($i = $j = 0; $i < scalar @sorted; $i++) { 96 | next if ($uval == $sorted[$i]->[1]); # low-priority alternative 97 | $uval = $sorted[$i]->[1]; 98 | printf "%s0x%02x", $prefix, $sorted[$i]->[0]; 99 | if ($j % 8 == 7) { 100 | $prefix = ",\n "; 101 | } else { 102 | $prefix = ", "; 103 | } 104 | $j++; 105 | } 106 | printf "\n },\n %d\n", $j; 107 | print "};\n"; 108 | print "const charset_spec charset_$name = {\n" . 109 | " $name, read_sbcs, write_sbcs, &data_$name\n};\n\n"; 110 | } 111 | -------------------------------------------------------------------------------- /pe.old/CHARSET/SLOOKUP.C: -------------------------------------------------------------------------------- 1 | /* 2 | * slookup.c - static lookup of character sets. 3 | */ 4 | 5 | #include "charset.h" 6 | #include "internal.h" 7 | 8 | #define ENUM_CHARSET(x) extern charset_spec const charset_##x; 9 | #include "enum.c" 10 | #undef ENUM_CHARSET 11 | 12 | static charset_spec const *const cs_table[] = { 13 | 14 | #define ENUM_CHARSET(x) &charset_##x, 15 | #include "enum.c" 16 | #undef ENUM_CHARSET 17 | 18 | }; 19 | 20 | charset_spec const *charset_find_spec(int charset) 21 | { 22 | int i; 23 | 24 | for (i = 0; i < (int)lenof(cs_table); i++) 25 | if (cs_table[i]->charset == charset) 26 | return cs_table[i]; 27 | 28 | return NULL; 29 | } 30 | -------------------------------------------------------------------------------- /pe.old/CHARSET/TOUCS.C: -------------------------------------------------------------------------------- 1 | /* 2 | * toucs.c - convert charsets to Unicode. 3 | */ 4 | 5 | #include "charset.h" 6 | #include "internal.h" 7 | 8 | struct unicode_emit_param { 9 | wchar_t *output; 10 | int outlen; 11 | const wchar_t *errstr; 12 | int errlen; 13 | int stopped; 14 | }; 15 | 16 | static void unicode_emit(void *ctx, long int output) 17 | { 18 | struct unicode_emit_param *param = (struct unicode_emit_param *)ctx; 19 | wchar_t outval; 20 | wchar_t const *p; 21 | int outlen; 22 | 23 | if (output == ERROR) { 24 | if (param->errstr) { 25 | p = param->errstr; 26 | outlen = param->errlen; 27 | } else { 28 | outval = 0xFFFD; /* U+FFFD REPLACEMENT CHARACTER */ 29 | p = &outval; 30 | outlen = 1; 31 | } 32 | } else { 33 | outval = output; 34 | p = &outval; 35 | outlen = 1; 36 | } 37 | 38 | if (param->outlen >= outlen) { 39 | while (outlen > 0) { 40 | *param->output++ = *p++; 41 | param->outlen--; 42 | outlen--; 43 | } 44 | } else { 45 | param->stopped = 1; 46 | } 47 | } 48 | 49 | int charset_to_unicode(char **input, int *inlen, wchar_t *output, int outlen, 50 | int charset, charset_state *state, 51 | const wchar_t *errstr, int errlen) 52 | { 53 | charset_spec const *spec = charset_find_spec(charset); 54 | charset_state localstate; 55 | struct unicode_emit_param param; 56 | 57 | param.output = output; 58 | param.outlen = outlen; 59 | param.errstr = errstr; 60 | param.errlen = errlen; 61 | param.stopped = 0; 62 | 63 | if (!state) { 64 | localstate.s0 = 0; 65 | } else { 66 | localstate = *state; /* structure copy */ 67 | } 68 | 69 | while (*inlen > 0) { 70 | int lenbefore = param.output - output; 71 | spec->read(spec, (unsigned char)**input, &localstate, 72 | unicode_emit, ¶m); 73 | if (param.stopped) { 74 | /* 75 | * The emit function has _tried_ to output some 76 | * characters, but ran up against the end of the 77 | * buffer. Leave immediately, and return what happened 78 | * _before_ attempting to process this character. 79 | */ 80 | return lenbefore; 81 | } 82 | if (state) 83 | *state = localstate; /* structure copy */ 84 | (*input)++; 85 | (*inlen)--; 86 | } 87 | 88 | return param.output - output; 89 | } 90 | -------------------------------------------------------------------------------- /pe.old/CHARSET/XENC.C: -------------------------------------------------------------------------------- 1 | /* 2 | * xenc.c - translate our internal character set codes to and from 3 | * X11 character encoding names. 4 | * 5 | */ 6 | 7 | #include 8 | #include "charset.h" 9 | #include "internal.h" 10 | 11 | static const struct { 12 | const char *name; 13 | int charset; 14 | } xencs[] = { 15 | /* 16 | * Officially registered encoding names. This list is derived 17 | * from the font encodings section of 18 | * 19 | * http://ftp.x.org/pub/DOCS/registry 20 | * 21 | * Where multiple encoding names map to the same encoding id 22 | * (such as iso8859-15 and fcd8859-15), the first is considered 23 | * canonical and will be returned when translating the id to a 24 | * string. 25 | */ 26 | { "iso8859-1", CS_ISO8859_1 }, 27 | { "iso8859-2", CS_ISO8859_2 }, 28 | { "iso8859-3", CS_ISO8859_3 }, 29 | { "iso8859-4", CS_ISO8859_4 }, 30 | { "iso8859-5", CS_ISO8859_5 }, 31 | { "iso8859-6", CS_ISO8859_6 }, 32 | { "iso8859-7", CS_ISO8859_7 }, 33 | { "iso8859-8", CS_ISO8859_8 }, 34 | { "iso8859-9", CS_ISO8859_9 }, 35 | { "iso8859-10", CS_ISO8859_10 }, 36 | { "iso8859-13", CS_ISO8859_13 }, 37 | { "iso8859-14", CS_ISO8859_14 }, 38 | { "iso8859-15", CS_ISO8859_15 }, 39 | { "fcd8859-15", CS_ISO8859_15 }, 40 | { "hp-roman8", CS_HP_ROMAN8 }, 41 | { "koi8-r", CS_KOI8_R }, 42 | /* 43 | * Unofficial encoding names found in the wild. 44 | */ 45 | { "iso8859-16", CS_ISO8859_16 }, 46 | { "koi8-u", CS_KOI8_U }, 47 | { "ibm-cp437", CS_CP437 }, 48 | { "ibm-cp850", CS_CP850 }, 49 | { "ibm-cp866", CS_CP866 }, 50 | { "microsoft-cp1250", CS_CP1250 }, 51 | { "microsoft-cp1251", CS_CP1251 }, 52 | { "microsoft-cp1252", CS_CP1252 }, 53 | { "microsoft-cp1253", CS_CP1253 }, 54 | { "microsoft-cp1254", CS_CP1254 }, 55 | { "microsoft-cp1255", CS_CP1255 }, 56 | { "microsoft-cp1256", CS_CP1256 }, 57 | { "microsoft-cp1257", CS_CP1257 }, 58 | { "microsoft-cp1258", CS_CP1258 }, 59 | { "mac-roman", CS_MAC_ROMAN }, 60 | { "viscii1.1-1", CS_VISCII }, 61 | { "viscii1-1", CS_VISCII }, 62 | }; 63 | 64 | const char *charset_to_xenc(int charset) 65 | { 66 | int i; 67 | 68 | for (i = 0; i < (int)lenof(xencs); i++) 69 | if (charset == xencs[i].charset) 70 | return xencs[i].name; 71 | 72 | return NULL; /* not found */ 73 | } 74 | 75 | int charset_from_xenc(const char *name) 76 | { 77 | int i; 78 | 79 | for (i = 0; i < (int)lenof(xencs); i++) { 80 | const char *p, *q; 81 | p = name; 82 | q = xencs[i].name; 83 | while (*p || *q) { 84 | if (tolower((unsigned char)*p) != tolower((unsigned char)*q)) 85 | break; 86 | p++; q++; 87 | } 88 | if (!*p && !*q) 89 | return xencs[i].charset; 90 | } 91 | 92 | return CS_NONE; /* not found */ 93 | } 94 | -------------------------------------------------------------------------------- /pe.old/CONTRIB/CYGTERMD/MAIN.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Main program. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "sel.h" 18 | #include "pty.h" 19 | #include "telnet.h" 20 | 21 | int signalpipe[2]; 22 | 23 | sel *asel; 24 | sel_rfd *netr, *ptyr, *sigr; 25 | int ptyfd; 26 | sel_wfd *netw, *ptyw; 27 | Telnet telnet; 28 | 29 | #define BUF 65536 30 | 31 | void sigchld(int signum) 32 | { 33 | write(signalpipe[1], "C", 1); 34 | } 35 | 36 | void fatal(const char *fmt, ...) 37 | { 38 | va_list ap; 39 | fprintf(stderr, "FIXME: "); 40 | va_start(ap, fmt); 41 | vfprintf(stderr, fmt, ap); 42 | va_end(ap); 43 | fprintf(stderr, "\n"); 44 | exit(1); 45 | } 46 | 47 | void net_readdata(sel_rfd *rfd, void *data, size_t len) 48 | { 49 | if (len == 0) 50 | exit(0); /* EOF on network - client went away */ 51 | telnet_from_net(telnet, data, len); 52 | if (sel_write(netw, NULL, 0) > BUF) 53 | sel_rfd_freeze(ptyr); 54 | if (sel_write(ptyw, NULL, 0) > BUF) 55 | sel_rfd_freeze(netr); 56 | } 57 | 58 | void net_readerr(sel_rfd *rfd, int error) 59 | { 60 | fprintf(stderr, "standard input: read: %s\n", strerror(errno)); 61 | exit(1); 62 | } 63 | 64 | void net_written(sel_wfd *wfd, size_t bufsize) 65 | { 66 | if (bufsize < BUF) 67 | sel_rfd_unfreeze(ptyr); 68 | } 69 | 70 | void net_writeerr(sel_wfd *wfd, int error) 71 | { 72 | fprintf(stderr, "standard input: write: %s\n", strerror(errno)); 73 | exit(1); 74 | } 75 | 76 | void pty_readdata(sel_rfd *rfd, void *data, size_t len) 77 | { 78 | if (len == 0) 79 | exit(0); /* EOF on pty */ 80 | telnet_from_pty(telnet, data, len); 81 | if (sel_write(netw, NULL, 0) > BUF) 82 | sel_rfd_freeze(ptyr); 83 | if (sel_write(ptyw, NULL, 0) > BUF) 84 | sel_rfd_freeze(netr); 85 | } 86 | 87 | void pty_readerr(sel_rfd *rfd, int error) 88 | { 89 | if (error == EIO) /* means EOF, on a pty */ 90 | exit(0); 91 | fprintf(stderr, "pty: read: %s\n", strerror(errno)); 92 | exit(1); 93 | } 94 | 95 | void pty_written(sel_wfd *wfd, size_t bufsize) 96 | { 97 | if (bufsize < BUF) 98 | sel_rfd_unfreeze(netr); 99 | } 100 | 101 | void pty_writeerr(sel_wfd *wfd, int error) 102 | { 103 | fprintf(stderr, "pty: write: %s\n", strerror(errno)); 104 | exit(1); 105 | } 106 | 107 | void sig_readdata(sel_rfd *rfd, void *data, size_t len) 108 | { 109 | char *p = data; 110 | 111 | while (len > 0) { 112 | if (*p == 'C') { 113 | int status; 114 | pid_t pid = waitpid(-1, &status, WNOHANG); 115 | if (WIFEXITED(status) || WIFSIGNALED(status)) 116 | exit(0); /* child process vanished */ 117 | } 118 | } 119 | } 120 | 121 | void sig_readerr(sel_rfd *rfd, int error) 122 | { 123 | fprintf(stderr, "signal pipe: read: %s\n", strerror(errno)); 124 | exit(1); 125 | } 126 | 127 | int main(int argc, char **argv) 128 | { 129 | int ret; 130 | int shell_started = 0; 131 | char *directory = NULL; 132 | char **program_args = NULL; 133 | 134 | if (argc > 1 && argv[1][0]) { 135 | directory = argv[1]; 136 | argc--, argv++; 137 | } 138 | if (argc > 1) { 139 | program_args = argv + 1; 140 | } 141 | 142 | pty_preinit(); 143 | 144 | asel = sel_new(NULL); 145 | netr = sel_rfd_add(asel, 0, net_readdata, net_readerr, NULL); 146 | netw = sel_wfd_add(asel, 1, net_written, net_writeerr, NULL); 147 | ptyr = sel_rfd_add(asel, -1, pty_readdata, pty_readerr, NULL); 148 | ptyw = sel_wfd_add(asel, -1, pty_written, pty_writeerr, NULL); 149 | 150 | telnet = telnet_new(netw, ptyw); 151 | 152 | if (pipe(signalpipe) < 0) { 153 | perror("pipe"); 154 | return 1; 155 | } 156 | sigr = sel_rfd_add(asel, signalpipe[0], sig_readdata, 157 | sig_readerr, NULL); 158 | 159 | signal(SIGCHLD, sigchld); 160 | 161 | do { 162 | struct shell_data shdata; 163 | 164 | ret = sel_iterate(asel, -1); 165 | if (!shell_started && telnet_shell_ok(telnet, &shdata)) { 166 | ptyfd = run_program_in_pty(&shdata, directory, program_args); 167 | sel_rfd_setfd(ptyr, ptyfd); 168 | sel_wfd_setfd(ptyw, ptyfd); 169 | shell_started = 1; 170 | } 171 | } while (ret == 0); 172 | 173 | return 0; 174 | } 175 | -------------------------------------------------------------------------------- /pe.old/CONTRIB/CYGTERMD/MAKEFILE: -------------------------------------------------------------------------------- 1 | cygtermd.exe: main.c sel.c telnet.c pty.c malloc.c 2 | gcc -o cygtermd.exe main.c sel.c telnet.c pty.c malloc.c 3 | -------------------------------------------------------------------------------- /pe.old/CONTRIB/CYGTERMD/MALLOC.C: -------------------------------------------------------------------------------- 1 | /* 2 | * malloc.c: implementation of malloc.h 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | #include "malloc.h" 9 | 10 | extern void fatal(const char *, ...); 11 | 12 | void *smalloc(size_t size) { 13 | void *p; 14 | p = malloc(size); 15 | if (!p) { 16 | fatal("out of memory"); 17 | } 18 | return p; 19 | } 20 | 21 | void sfree(void *p) { 22 | if (p) { 23 | free(p); 24 | } 25 | } 26 | 27 | void *srealloc(void *p, size_t size) { 28 | void *q; 29 | if (p) { 30 | q = realloc(p, size); 31 | } else { 32 | q = malloc(size); 33 | } 34 | if (!q) 35 | fatal("out of memory"); 36 | return q; 37 | } 38 | 39 | char *dupstr(const char *s) { 40 | char *r = smalloc(1+strlen(s)); 41 | strcpy(r,s); 42 | return r; 43 | } 44 | -------------------------------------------------------------------------------- /pe.old/CONTRIB/CYGTERMD/MALLOC.H: -------------------------------------------------------------------------------- 1 | /* 2 | * malloc.h: safe wrappers around malloc, realloc, free, strdup 3 | */ 4 | 5 | #ifndef UMLWRAP_MALLOC_H 6 | #define UMLWRAP_MALLOC_H 7 | 8 | #include 9 | 10 | /* 11 | * smalloc should guarantee to return a useful pointer - Halibut 12 | * can do nothing except die when it's out of memory anyway. 13 | */ 14 | void *smalloc(size_t size); 15 | 16 | /* 17 | * srealloc should guaranteeably be able to realloc NULL 18 | */ 19 | void *srealloc(void *p, size_t size); 20 | 21 | /* 22 | * sfree should guaranteeably deal gracefully with freeing NULL 23 | */ 24 | void sfree(void *p); 25 | 26 | /* 27 | * dupstr is like strdup, but with the never-return-NULL property 28 | * of smalloc (and also reliably defined in all environments :-) 29 | */ 30 | char *dupstr(const char *s); 31 | 32 | /* 33 | * snew allocates one instance of a given type, and casts the 34 | * result so as to type-check that you're assigning it to the 35 | * right kind of pointer. Protects against allocation bugs 36 | * involving allocating the wrong size of thing. 37 | */ 38 | #define snew(type) \ 39 | ( (type *) smalloc (sizeof (type)) ) 40 | 41 | /* 42 | * snewn allocates n instances of a given type, for arrays. 43 | */ 44 | #define snewn(number, type) \ 45 | ( (type *) smalloc ((number) * sizeof (type)) ) 46 | 47 | /* 48 | * sresize wraps realloc so that you specify the new number of 49 | * elements and the type of the element, with the same type- 50 | * checking advantages. Also type-checks the input pointer. 51 | */ 52 | #define sresize(array, number, type) \ 53 | ( (void)sizeof((array)-(type *)0), \ 54 | (type *) srealloc ((array), (number) * sizeof (type)) ) 55 | 56 | #endif /* UMLWRAP_MALLOC_H */ 57 | -------------------------------------------------------------------------------- /pe.old/CONTRIB/CYGTERMD/PTY.H: -------------------------------------------------------------------------------- 1 | /* 2 | * pty.h - FIXME 3 | */ 4 | 5 | #ifndef FIXME_PTY_H 6 | #define FIXME_PTY_H 7 | 8 | #include "telnet.h" /* for struct shdata */ 9 | 10 | /* 11 | * Called at program startup to actually allocate a pty, so that 12 | * we can start passing in resize events as soon as they arrive. 13 | */ 14 | void pty_preinit(void); 15 | 16 | /* 17 | * Set the terminal size for the pty. 18 | */ 19 | void pty_resize(int w, int h); 20 | 21 | /* 22 | * Start a program in a subprocess running in the pty we allocated. 23 | * Returns the fd of the pty master. 24 | */ 25 | int run_program_in_pty(const struct shell_data *shdata, 26 | char *directory, char **program_args); 27 | 28 | #endif /* FIXME_PTY_H */ 29 | -------------------------------------------------------------------------------- /pe.old/CONTRIB/CYGTERMD/README: -------------------------------------------------------------------------------- 1 | This directory contains 'cygtermd', a small and specialist Telnet 2 | server designed to act as middleware between PuTTY and a Cygwin shell 3 | session running on the same machine, so that PuTTY can act as an 4 | xterm-alike for Cygwin. 5 | 6 | To install it, you must compile it from source using Cygwin gcc, 7 | install it in Cygwin's /bin, and configure PuTTY to use it as a local 8 | proxy process. For detailed instructions, see the PuTTY Wishlist page 9 | at 10 | 11 | http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/cygwin-terminal-window.html 12 | -------------------------------------------------------------------------------- /pe.old/CONTRIB/CYGTERMD/TELNET.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Header declaring Telnet-handling functions. 3 | */ 4 | 5 | #ifndef FIXME_TELNET_H 6 | #define FIXME_TELNET_H 7 | 8 | #include "sel.h" 9 | 10 | typedef struct telnet_tag *Telnet; 11 | 12 | struct shell_data { 13 | char **envvars; /* array of "VAR=value" terms */ 14 | int nenvvars; 15 | char *termtype; 16 | }; 17 | 18 | /* 19 | * Create and destroy a Telnet structure. 20 | */ 21 | Telnet telnet_new(sel_wfd *net, sel_wfd *pty); 22 | void telnet_free(Telnet telnet); 23 | 24 | /* 25 | * Process data read from the pty. 26 | */ 27 | void telnet_from_pty(Telnet telnet, char *buf, int len); 28 | 29 | /* 30 | * Process Telnet protocol data received from the network. 31 | */ 32 | void telnet_from_net(Telnet telnet, char *buf, int len); 33 | 34 | /* 35 | * Return true if pre-shell-startup negotiations are complete and 36 | * it's safe to start the shell subprocess now. On a true return, 37 | * also fills in the shell_data structure. 38 | */ 39 | int telnet_shell_ok(Telnet telnet, struct shell_data *shdata); 40 | 41 | #endif /* FIXME_TELNET_H */ 42 | -------------------------------------------------------------------------------- /pe.old/DOC/BLURB.BUT: -------------------------------------------------------------------------------- 1 | \define{versionidblurb} \versionid $Id: blurb.but 9072 2011-01-05 12:01:00Z jacob $ 2 | 3 | \title PuTTY User Manual 4 | 5 | \cfg{xhtml-leaf-level}{1} 6 | \cfg{xhtml-leaf-smallest-contents}{2} 7 | \cfg{xhtml-leaf-contains-contents}{true} 8 | \cfg{xhtml-body-end}{

If you want to provide feedback on this manual 9 | or on the PuTTY tools themselves, see the 10 | Feedback 11 | page.

} 12 | 13 | \cfg{html-template-fragment}{%k}{%b} 14 | 15 | \cfg{info-max-file-size}{0} 16 | 17 | \cfg{xhtml-contents-filename}{index.html} 18 | \cfg{text-filename}{puttydoc.txt} 19 | \cfg{winhelp-filename}{putty.hlp} 20 | \cfg{info-filename}{putty.info} 21 | 22 | PuTTY is a free (MIT-licensed) Win32 Telnet and SSH client. This 23 | manual documents PuTTY, and its companion utilities PSCP, PSFTP, 24 | Plink, Pageant and PuTTYgen. 25 | 26 | \e{Note to Unix users:} this manual currently primarily documents the 27 | Windows versions of the PuTTY utilities. Some options are therefore 28 | mentioned that are absent from the \i{Unix version}; the Unix version has 29 | features not described here; and the \i\cw{pterm} and command-line 30 | \cw{puttygen} utilities are not described at all. The only 31 | Unix-specific documentation that currently exists is the 32 | \I{man pages for PuTTY tools}man pages. 33 | 34 | \copyright This manual is copyright 2001-2011 Simon Tatham. All 35 | rights reserved. You may distribute this documentation under the MIT 36 | licence. See \k{licence} for the licence text in full. 37 | -------------------------------------------------------------------------------- /pe.old/DOC/CHM.BUT: -------------------------------------------------------------------------------- 1 | \# File containing the magic HTML configuration directives to create 2 | \# an MS HTML Help project. We put this on the end of the PuTTY 3 | \# docs build command line to build the HHP and friends. 4 | 5 | \cfg{html-leaf-level}{infinite} 6 | \cfg{html-leaf-contains-contents}{false} 7 | \cfg{html-suppress-navlinks}{true} 8 | \cfg{html-suppress-address}{true} 9 | 10 | \cfg{html-contents-filename}{index.html} 11 | \cfg{html-template-filename}{%k.html} 12 | \cfg{html-template-fragment}{%k} 13 | 14 | \cfg{html-mshtmlhelp-chm}{putty.chm} 15 | \cfg{html-mshtmlhelp-project}{putty.hhp} 16 | \cfg{html-mshtmlhelp-contents}{putty.hhc} 17 | \cfg{html-mshtmlhelp-index}{putty.hhk} 18 | 19 | \cfg{html-body-end}{} 20 | 21 | \cfg{html-head-end}{} 22 | 23 | \versionid $Id: chm.but 7272 2007-02-11 18:13:56Z jacob $ 24 | -------------------------------------------------------------------------------- /pe.old/DOC/CHM.CSS: -------------------------------------------------------------------------------- 1 | /* Stylesheet for a Windows .CHM help file */ 2 | 3 | body { font-size: 75%; font-family: Verdana, Arial, Helvetica, Sans-Serif; } 4 | 5 | h1 { font-weight: bold; font-size: 150%; } 6 | h2 { font-weight: bold; font-size: 130%; } 7 | h3 { font-weight: bold; font-size: 120%; } 8 | -------------------------------------------------------------------------------- /pe.old/DOC/INTRO.BUT: -------------------------------------------------------------------------------- 1 | \define{versionidintro} \versionid $Id: intro.but 5593 2005-04-05 18:01:32Z jacob $ 2 | 3 | \C{intro} Introduction to PuTTY 4 | 5 | PuTTY is a free SSH, Telnet and Rlogin client for 32-bit Windows 6 | systems. 7 | 8 | \H{you-what} What are SSH, Telnet and Rlogin? 9 | 10 | If you already know what SSH, Telnet and Rlogin are, you can safely 11 | skip on to the next section. 12 | 13 | SSH, Telnet and Rlogin are three ways of doing the same thing: 14 | logging in to a multi-user computer from another computer, over a 15 | network. 16 | 17 | Multi-user operating systems, such as Unix and VMS, usually present 18 | a \i{command-line interface} to the user, much like the \q{\i{Command 19 | Prompt}} or \q{\i{MS-DOS Prompt}} in Windows. The system prints a 20 | prompt, and you type commands which the system will obey. 21 | 22 | Using this type of interface, there is no need for you to be sitting 23 | at the same machine you are typing commands to. The commands, and 24 | responses, can be sent over a network, so you can sit at one 25 | computer and give commands to another one, or even to more than one. 26 | 27 | SSH, Telnet and Rlogin are \i\e{network protocols} that allow you to 28 | do this. On the computer you sit at, you run a \i\e{client}, which 29 | makes a network connection to the other computer (the \i\e{server}). 30 | The network connection carries your keystrokes and commands from the 31 | client to the server, and carries the server's responses back to 32 | you. 33 | 34 | These protocols can also be used for other types of keyboard-based 35 | interactive session. In particular, there are a lot of bulletin 36 | boards, \i{talker systems} and \i{MUDs} (Multi-User Dungeons) which support 37 | access using Telnet. There are even a few that support SSH. 38 | 39 | You might want to use SSH, Telnet or Rlogin if: 40 | 41 | \b you have an account on a Unix or VMS system which you want to be 42 | able to access from somewhere else 43 | 44 | \b your Internet Service Provider provides you with a login account 45 | on a \i{web server}. (This might also be known as a \i\e{shell account}. 46 | A \e{shell} is the program that runs on the server and interprets 47 | your commands for you.) 48 | 49 | \b you want to use a \i{bulletin board system}, talker or MUD which can 50 | be accessed using Telnet. 51 | 52 | You probably do \e{not} want to use SSH, Telnet or Rlogin if: 53 | 54 | \b you only use Windows. Windows computers have their own 55 | ways of networking between themselves, and unless you are doing 56 | something fairly unusual, you will not need to use any of these 57 | remote login protocols. 58 | 59 | \H{which-one} How do SSH, Telnet and Rlogin differ? 60 | 61 | This list summarises some of the \i{differences between SSH, Telnet 62 | and Rlogin}. 63 | 64 | \b SSH (which stands for \q{\i{secure shell}}) is a recently designed, 65 | high-security protocol. It uses strong cryptography to protect your 66 | connection against eavesdropping, hijacking and other attacks. Telnet 67 | and Rlogin are both older protocols offering minimal security. 68 | 69 | \b SSH and Rlogin both allow you to \I{passwordless login}log in to the 70 | server without having to type a password. (Rlogin's method of doing this is 71 | insecure, and can allow an attacker to access your account on the 72 | server. SSH's method is much more secure, and typically breaking the 73 | security requires the attacker to have gained access to your actual 74 | client machine.) 75 | 76 | \b SSH allows you to connect to the server and automatically send a 77 | command, so that the server will run that command and then 78 | disconnect. So you can use it in automated processing. 79 | 80 | The Internet is a hostile environment and security is everybody's 81 | responsibility. If you are connecting across the open Internet, then 82 | we recommend you use SSH. If the server you want to connect to 83 | doesn't support SSH, it might be worth trying to persuade the 84 | administrator to install it. 85 | 86 | If your client and server are both behind the same (good) firewall, 87 | it is more likely to be safe to use Telnet or Rlogin, but we still 88 | recommend you use SSH. 89 | -------------------------------------------------------------------------------- /pe.old/DOC/LICENCE.BUT: -------------------------------------------------------------------------------- 1 | \define{versionidlicence} \versionid $Id: licence.but 9072 2011-01-05 12:01:00Z jacob $ 2 | 3 | \A{licence} PuTTY \ii{Licence} 4 | 5 | PuTTY is \i{copyright} 1997-2011 Simon Tatham. 6 | 7 | Portions copyright Robert de Bath, Joris van Rantwijk, Delian 8 | Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, 9 | Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus 10 | Kuhn, Colin Watson, and CORE SDI S.A. 11 | 12 | Permission is hereby granted, free of charge, to any person 13 | obtaining a copy of this software and associated documentation files 14 | (the \q{Software}), to deal in the Software without restriction, 15 | including without limitation the rights to use, copy, modify, merge, 16 | publish, distribute, sublicense, and/or sell copies of the Software, 17 | and to permit persons to whom the Software is furnished to do so, 18 | subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED \q{AS IS}, WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE 27 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 28 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | -------------------------------------------------------------------------------- /pe.old/DOC/MAKEFILE: -------------------------------------------------------------------------------- 1 | all: man index.html 2 | 3 | # Decide on the versionid policy. 4 | # 5 | # If the user has passed in $(VERSION) on the command line (`make 6 | # VERSION="Release 0.56"'), we use that as an explicit version 7 | # string. Otherwise, we use `svnversion' to examine the checked-out 8 | # documentation source, and if that returns a single revision 9 | # number then we invent a version string reflecting just that 10 | # number. Failing _that_, we resort to versionids.but which shows a 11 | # $Id for each individual file. 12 | # 13 | # So here, we define VERSION using svnversion if it isn't already 14 | # defined ... 15 | ifndef VERSION 16 | SVNVERSION=$(shell test -d .svn && svnversion .) 17 | BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION)) 18 | ifeq ($(BADCHARS),) 19 | ifneq ($(SVNVERSION),) 20 | ifneq ($(SVNVERSION),exported) 21 | VERSION=Built from revision $(patsubst M,,$(SVNVERSION)) 22 | endif 23 | endif 24 | endif 25 | endif 26 | # ... and now, we condition our build behaviour on whether or not 27 | # VERSION _is_ defined. 28 | ifdef VERSION 29 | VERSIONIDS=vstr 30 | vstr.but: FORCE 31 | echo \\versionid $(VERSION) > vstr.but 32 | FORCE:; 33 | else 34 | VERSIONIDS=vids 35 | endif 36 | 37 | CHAPTERS := $(SITE) blurb intro gs using config pscp psftp plink pubkey 38 | CHAPTERS += pageant errors faq feedback licence udp pgpkeys sshnames 39 | CHAPTERS += index $(VERSIONIDS) 40 | 41 | INPUTS = $(patsubst %,%.but,$(CHAPTERS)) 42 | 43 | # This is temporary. Hack it locally or something. 44 | HALIBUT = halibut 45 | 46 | index.html: $(INPUTS) 47 | $(HALIBUT) --text --html --winhelp $(INPUTS) 48 | 49 | # During formal builds it's useful to be able to build this one alone. 50 | putty.hlp: $(INPUTS) 51 | $(HALIBUT) --winhelp $(INPUTS) 52 | 53 | putty.info: $(INPUTS) 54 | $(HALIBUT) --info $(INPUTS) 55 | 56 | chm: putty.hhp 57 | putty.hhp: $(INPUTS) chm.but 58 | $(HALIBUT) --html $(INPUTS) chm.but 59 | 60 | MKMAN = $(HALIBUT) --man=$@ mancfg.but $< 61 | MANPAGES = putty.1 puttygen.1 plink.1 pscp.1 psftp.1 puttytel.1 pterm.1 62 | man: $(MANPAGES) 63 | 64 | putty.1: man-putt.but mancfg.but; $(MKMAN) 65 | puttygen.1: man-pg.but mancfg.but; $(MKMAN) 66 | plink.1: man-pl.but mancfg.but; $(MKMAN) 67 | pscp.1: man-pscp.but mancfg.but; $(MKMAN) 68 | psftp.1: man-psft.but mancfg.but; $(MKMAN) 69 | puttytel.1: man-ptel.but mancfg.but; $(MKMAN) 70 | pterm.1: man-pter.but mancfg.but; $(MKMAN) 71 | 72 | mostlyclean: 73 | rm -f *.html *.txt *.hlp *.cnt *.1 *.info vstr.but *.hh[pck] 74 | clean: mostlyclean 75 | rm -f *.chm 76 | -------------------------------------------------------------------------------- /pe.old/DOC/MAN-PSCP.BUT: -------------------------------------------------------------------------------- 1 | \cfg{man-identity}{pscp}{1}{2004-03-24}{PuTTY tool suite}{PuTTY tool suite} 2 | 3 | \H{pscp-manpage} Man page for PSCP 4 | 5 | \S{pscp-manpage-name} NAME 6 | 7 | \cw{pscp} \- command-line SCP (secure copy) / SFTP client 8 | 9 | \S{pscp-manpage-synopsis} SYNOPSIS 10 | 11 | \c pscp [options] [user@]host:source target 12 | \e bbbb iiiiiii iiiib iiiibiiiiii iiiiii 13 | \c pscp [options] source [source...] [user@]host:target 14 | \e bbbb iiiiiii iiiiii iiiiii iiiib iiiibiiiiii 15 | \c pscp [options] -ls [user@]host:filespec 16 | \e bbbb iiiiiii bbb iiiib iiiibiiiiiiii 17 | 18 | \S{pscp-manpage-description} DESCRIPTION 19 | 20 | \cw{pscp} is a command-line client for the SSH-based SCP (secure 21 | copy) and SFTP (secure file transfer protocol) protocols. 22 | 23 | \S{pscp-manpage-options} OPTIONS 24 | 25 | The command-line options supported by \e{pscp} are: 26 | 27 | \dt \cw{-V} 28 | 29 | \dd Show version information and exit. 30 | 31 | \dt \cw{-pgpfp} 32 | 33 | \dd Display the fingerprints of the PuTTY PGP Master Keys and exit, 34 | to aid in verifying new files released by the PuTTY team. 35 | 36 | \dt \cw{-ls} 37 | 38 | \dd Remote directory listing. 39 | 40 | \dt \cw{-p} 41 | 42 | \dd Preserve file attributes. 43 | 44 | \dt \cw{-q} 45 | 46 | \dd Quiet, don't show statistics. 47 | 48 | \dt \cw{-r} 49 | 50 | \dd Copy directories recursively. 51 | 52 | \dt \cw{-unsafe} 53 | 54 | \dd Allow server-side wildcards (DANGEROUS). 55 | 56 | \dt \cw{-v} 57 | 58 | \dd Show verbose messages. 59 | 60 | \dt \cw{-load} \e{session} 61 | 62 | \dd Load settings from saved session. 63 | 64 | \dt \cw{-P} \e{port} 65 | 66 | \dd Connect to port \e{port}. 67 | 68 | \dt \cw{-l} \e{user} 69 | 70 | \dd Set remote username to \e{user}. 71 | 72 | \dt \cw{-batch} 73 | 74 | \dd Disable interactive prompts. 75 | 76 | \dt \cw{-pw} \e{password} 77 | 78 | \dd Set remote password to \e{password}. \e{CAUTION:} this will likely 79 | make the password visible to other users of the local machine (via 80 | commands such as \q{\c{w}}). 81 | 82 | \dt \cw{-1} 83 | 84 | \dd Force use of SSH protocol version 1. 85 | 86 | \dt \cw{-2} 87 | 88 | \dd Force use of SSH protocol version 2. 89 | 90 | \dt \cw{-C} 91 | 92 | \dd Enable SSH compression. 93 | 94 | \dt \cw{-i} \e{path} 95 | 96 | \dd Private key file for authentication. 97 | 98 | \dt \cw{-scp} 99 | 100 | \dd Force use of SCP protocol. 101 | 102 | \dt \cw{-sftp} 103 | 104 | \dd Force use of SFTP protocol. 105 | 106 | \S{pscp-manpage-more-information} MORE INFORMATION 107 | 108 | For more information on \cw{pscp} it's probably best to go and look at 109 | the manual on the PuTTY web page: 110 | 111 | \W{http://www.chiark.greenend.org.uk/~sgtatham/putty/}\cw{http://www.chiark.greenend.org.uk/~sgtatham/putty/} 112 | 113 | \S{pscp-manpage-bugs} BUGS 114 | 115 | This man page isn't terribly complete. See the above web link for 116 | better documentation. 117 | -------------------------------------------------------------------------------- /pe.old/DOC/MAN-PSFT.BUT: -------------------------------------------------------------------------------- 1 | \cfg{man-identity}{psftp}{1}{2004-03-24}{PuTTY tool suite}{PuTTY tool suite} 2 | 3 | \H{psftp-manpage} Man page for PSFTP 4 | 5 | \S{psftp-manpage-name} NAME 6 | 7 | \cw{psftp} \- interactive SFTP (secure file transfer protocol) client 8 | 9 | \S{psftp-manpage-synopsis} SYNOPSIS 10 | 11 | \c psftp [options] [user@]host 12 | \e bbbbb iiiiiii iiiib iiii 13 | 14 | \S{psftp-manpage-description} DESCRIPTION 15 | 16 | \cw{psftp} is an interactive text-based client for the SSH-based SFTP 17 | (secure file transfer) protocol. 18 | 19 | \S{psftp-manpage-options} OPTIONS 20 | 21 | The command-line options supported by \cw{psftp} are: 22 | 23 | \dt \cw{-V} 24 | 25 | \dd Show version information and exit. 26 | 27 | \dt \cw{-pgpfp} 28 | 29 | \dd Display the fingerprints of the PuTTY PGP Master Keys and exit, 30 | to aid in verifying new files released by the PuTTY team. 31 | 32 | \dt \cw{-b} \e{batchfile} 33 | 34 | \dd Use specified batchfile. 35 | 36 | \dt \cw{-bc} 37 | 38 | \dd Output batchfile commands. 39 | 40 | \dt \cw{-be} 41 | 42 | \dd Don't stop batchfile processing on errors. 43 | 44 | \dt \cw{-v} 45 | 46 | \dd Show verbose messages. 47 | 48 | \dt \cw{-load} \e{session} 49 | 50 | \dd Load settings from saved session. 51 | 52 | \dt \cw{-P} \e{port} 53 | 54 | \dd Connect to port \e{port}. 55 | 56 | \dt \cw{-l} \e{user} 57 | 58 | \dd Set remote username to \e{user}. 59 | 60 | \dt \cw{-batch} 61 | 62 | \dd Disable interactive prompts. 63 | 64 | \dt \cw{-pw} \e{password} 65 | 66 | \dd Set remote password to \e{password}. \e{CAUTION:} this will likely 67 | make the password visible to other users of the local machine (via 68 | commands such as \q{\c{w}}). 69 | 70 | \dt \cw{-1} 71 | 72 | \dd Force use of SSH protocol version 1. 73 | 74 | \dt \cw{-2} 75 | 76 | \dd Force use of SSH protocol version 2. 77 | 78 | \dt \cw{-C} 79 | 80 | \dd Enable SSH compression. 81 | 82 | \dt \cw{-i} \e{path} 83 | 84 | \dd Private key file for authentication. 85 | 86 | \S{psftp-manpage-commands} COMMANDS 87 | 88 | For a list of commands available inside \cw{psftp}, type \cw{help} 89 | at the \cw{psftp>} prompt. 90 | 91 | \S{psftp-manpage-more-information} MORE INFORMATION 92 | 93 | For more information on \cw{psftp} it's probably best to go and look at 94 | the manual on the PuTTY web page: 95 | 96 | \cw{http://www.chiark.greenend.org.uk/~sgtatham/putty/} 97 | 98 | \S{psftp-manpage-bugs} BUGS 99 | 100 | This man page isn't terribly complete. See the above web link for 101 | better documentation. 102 | -------------------------------------------------------------------------------- /pe.old/DOC/MANCFG.BUT: -------------------------------------------------------------------------------- 1 | \cfg{man-mindepth}{2} 2 | 3 | \C{not-shown} Chapter title which is not shown 4 | -------------------------------------------------------------------------------- /pe.old/DOC/MANPAGES.BUT: -------------------------------------------------------------------------------- 1 | \A{man-pages} Man pages for Unix PuTTY 2 | 3 | This appendix contains all the man pages for Unix PuTTY. 4 | -------------------------------------------------------------------------------- /pe.old/DOC/SITE.BUT: -------------------------------------------------------------------------------- 1 | \# Additional configuration for the version of the PuTTY docs 2 | \# actually published as HTML on the website. 3 | 4 | \cfg{xhtml-head-end}{} 5 | -------------------------------------------------------------------------------- /pe.old/DOC/SSHNAMES.BUT: -------------------------------------------------------------------------------- 1 | \define{versionidsshnames} \versionid $Id$ 2 | 3 | \A{sshnames} SSH-2 names specified for PuTTY 4 | 5 | There are various parts of the SSH-2 protocol where things are specified 6 | using a textual name. Names ending in \cw{@putty.projects.tartarus.org} 7 | are reserved for allocation by the PuTTY team. Allocated names are 8 | documented here. 9 | 10 | \H{sshnames-channel} Connection protocol channel request names 11 | 12 | These names can be sent in a \cw{SSH_MSG_CHANNEL_REQUEST} message. 13 | 14 | \dt \cw{simple@putty.projects.tartarus.org} 15 | 16 | \dd This is sent by a client to announce that it will not have more than 17 | one channel open at a time in the current connection (that one being 18 | the one the request is sent on). The intention is that the server, 19 | knowing this, can set the window on that one channel to something very 20 | large, and leave flow control to TCP. There is no message-specific data. 21 | 22 | \dt \cw{winadj@putty.projects.tartarus.org} 23 | 24 | \dd PuTTY sends this request along with some 25 | \cw{SSH_MSG_CHANNEL_WINDOW_ADJUST} messages as part of its window-size 26 | tuning. It can be sent on any type of channel. There is no 27 | message-specific data. Servers MUST treat it as an unrecognised request 28 | and respond with \cw{SSH_MSG_CHANNEL_FAILURE}. 29 | 30 | \H{sshnames-kex} Key exchange method names 31 | 32 | \dt \cw{rsa-sha1-draft-00@putty.projects.tartarus.org} 33 | 34 | \dt \cw{rsa-sha256-draft-00@putty.projects.tartarus.org} 35 | 36 | \dt \cw{rsa1024-sha1-draft-01@putty.projects.tartarus.org} 37 | 38 | \dt \cw{rsa1024-sha256-draft-01@putty.projects.tartarus.org} 39 | 40 | \dt \cw{rsa2048-sha256-draft-01@putty.projects.tartarus.org} 41 | 42 | \dt \cw{rsa1024-sha1-draft-02@putty.projects.tartarus.org} 43 | 44 | \dt \cw{rsa2048-sha512-draft-02@putty.projects.tartarus.org} 45 | 46 | \dt \cw{rsa1024-sha1-draft-03@putty.projects.tartarus.org} 47 | 48 | \dt \cw{rsa2048-sha256-draft-03@putty.projects.tartarus.org} 49 | 50 | \dt \cw{rsa1024-sha1-draft-04@putty.projects.tartarus.org} 51 | 52 | \dt \cw{rsa2048-sha256-draft-04@putty.projects.tartarus.org} 53 | 54 | \dd These appeared in various drafts of what eventually became RFC\_4432. 55 | They have been superseded by \cw{rsa1024-sha1} and \cw{rsa2048-sha256}. 56 | 57 | \H{sshnames-encrypt} Encryption algorithm names 58 | 59 | \dt \cw{arcfour128-draft-00@putty.projects.tartarus.org} 60 | 61 | \dt \cw{arcfour256-draft-00@putty.projects.tartarus.org} 62 | 63 | \dd These were used in drafts of what eventually became RFC\_4345. 64 | They have been superseded by \cw{arcfour128} and \cw{arcfour256}. 65 | -------------------------------------------------------------------------------- /pe.old/DOC/VIDS.BUT: -------------------------------------------------------------------------------- 1 | \# Invoke the versionid macros defined in all the other manual 2 | \# chapter files. 3 | 4 | \versionidblurb 5 | 6 | \versionidintro 7 | 8 | \versionidgs 9 | 10 | \versionidusing 11 | 12 | \versionidconfig 13 | 14 | \versionidpscp 15 | 16 | \versionidpsftp 17 | 18 | \versionidplink 19 | 20 | \versionidpubkey 21 | 22 | \versionidpageant 23 | 24 | \versioniderrors 25 | 26 | \versionidfaq 27 | 28 | \versionidfeedback 29 | 30 | \versionidlicence 31 | 32 | \versionidudp 33 | 34 | \versionidpgpkeys 35 | 36 | \versionidindex 37 | -------------------------------------------------------------------------------- /pe.old/ICONS/CICON.PL: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Given a list of input PNGs, create a C source file containing a 4 | # const array of XPMs, named by a given C identifier. 5 | 6 | $id = shift @ARGV; 7 | $k = 0; 8 | @xpms = (); 9 | foreach $f (@ARGV) { 10 | # XPM format is generated directly by ImageMagick, so that's easy 11 | # enough. We just have to adjust the declaration line so that it 12 | # has the right name, linkage and storage class. 13 | @lines = (); 14 | open XPM, "convert $f xpm:- |"; 15 | push @lines, $_ while ; 16 | close XPM; 17 | die "XPM from $f in unexpected format\n" unless $lines[1] =~ /^static.*\{$/; 18 | $lines[1] = "static const char *const ${id}_$k"."[] = {\n"; 19 | $k++; 20 | push @xpms, @lines, "\n"; 21 | } 22 | 23 | # Now output. 24 | foreach $line (@xpms) { print $line; } 25 | print "const char *const *const ${id}[] = {\n"; 26 | for ($i = 0; $i < $k; $i++) { print " ${id}_$i,\n"; } 27 | print "};\n"; 28 | print "const int n_${id} = $k;\n"; 29 | -------------------------------------------------------------------------------- /pe.old/ICONS/MAKEFILE: -------------------------------------------------------------------------------- 1 | # Makefile for the PuTTY icon suite. 2 | 3 | ICONS = putty puttycfg puttygen pscp pageant pterm ptermcfg puttyins 4 | SIZES = 16 32 48 5 | 6 | MODE = # override to -it on command line for opaque testing 7 | 8 | PNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S).png)) 9 | MONOPNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S)-mono.png)) 10 | TRUEPNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S)-true.png)) 11 | 12 | ICOS = putty.ico puttygen.ico pscp.ico pageant.ico pageants.ico puttycfg.ico \ 13 | puttyins.ico 14 | CICONS = xpmputty.c xpmpucfg.c xpmpterm.c xpmptcfg.c 15 | 16 | base: icos cicons 17 | 18 | all: pngs monopngs base # truepngs currently disabled by default 19 | 20 | pngs: $(PNGS) 21 | monopngs: $(MONOPNGS) 22 | truepngs: $(TRUEPNGS) 23 | 24 | icos: $(ICOS) 25 | cicons: $(CICONS) 26 | 27 | install: icos cicons 28 | cp $(ICOS) ../windows 29 | cp $(CICONS) ../unix 30 | 31 | $(PNGS): %.png: mkicon.py 32 | ./mkicon.py $(MODE) $(join $(subst -, ,$(basename $@)),_icon) $@ 33 | 34 | $(MONOPNGS): %.png: mkicon.py 35 | ./mkicon.py -2 $(MODE) $(join $(subst -, ,$(subst -mono,,$(basename $@))),_icon) $@ 36 | 37 | $(TRUEPNGS): %.png: mkicon.py 38 | ./mkicon.py -T $(MODE) $(join $(subst -, ,$(subst -true,,$(basename $@))),_icon) $@ 39 | 40 | putty.ico: putty-16.png putty-32.png putty-48.png \ 41 | putty-16-mono.png putty-32-mono.png putty-48-mono.png 42 | ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ 43 | 44 | puttycfg.ico: puttycfg-16.png puttycfg-32.png puttycfg-48.png \ 45 | puttycfg-16-mono.png puttycfg-32-mono.png puttycfg-48-mono.png 46 | ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ 47 | 48 | puttygen.ico: puttygen-16.png puttygen-32.png puttygen-48.png \ 49 | puttygen-16-mono.png puttygen-32-mono.png puttygen-48-mono.png 50 | ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ 51 | 52 | pageant.ico: pageant-16.png pageant-32.png pageant-48.png \ 53 | pageant-16-mono.png pageant-32-mono.png pageant-48-mono.png 54 | ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ 55 | 56 | pageants.ico: pageant-16.png pageant-16-mono.png 57 | ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ 58 | 59 | pscp.ico: pscp-16.png pscp-32.png pscp-48.png \ 60 | pscp-16-mono.png pscp-32-mono.png pscp-48-mono.png 61 | ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ 62 | 63 | # Because the installer icon makes heavy use of brown when drawing 64 | # the cardboard box, it's worth having 8-bit versions of it in 65 | # addition to the 4- and 1-bit ones. 66 | puttyins.ico: puttyins-16.png puttyins-32.png puttyins-48.png \ 67 | puttyins-16-mono.png puttyins-32-mono.png \ 68 | puttyins-48-mono.png \ 69 | puttyins-16-true.png puttyins-32-true.png \ 70 | puttyins-48-true.png 71 | ./icon.pl -8 $(filter %-true.png, $^) \ 72 | -4 $(filter-out %-true.png, $(filter-out %-mono.png, $^)) \ 73 | -1 $(filter %-mono.png, $^) > $@ 74 | 75 | # Icon for the website. (This isn't linked into "make all".) 76 | website.ico: putty-16.png 77 | ./icon.pl -4 $^ >$@ 78 | 79 | xpmputty.c: putty-16.png putty-32.png putty-48.png 80 | ./cicon.pl main_icon $^ > $@ 81 | 82 | xpmpucfg.c: puttycfg-16.png puttycfg-32.png puttycfg-48.png 83 | ./cicon.pl cfg_icon $^ > $@ 84 | 85 | xpmpterm.c: pterm-16.png pterm-32.png pterm-48.png 86 | ./cicon.pl main_icon $^ > $@ 87 | 88 | xpmptcfg.c: ptermcfg-16.png ptermcfg-32.png ptermcfg-48.png 89 | ./cicon.pl cfg_icon $^ > $@ 90 | 91 | clean: 92 | rm -f *.png *.ico *.c 93 | -------------------------------------------------------------------------------- /pe.old/INT64.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Handling of the int64 and uint64 types. Done in 32-bit integers, 3 | * for (pre-C99) portability. Hopefully once C99 becomes widespread 4 | * we can kiss this lot goodbye... 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "int64.h" 11 | 12 | uint64 uint64_div10(uint64 x, int *remainder) 13 | { 14 | uint64 y; 15 | unsigned int rem, r2; 16 | y.hi = x.hi / 10; 17 | y.lo = x.lo / 10; 18 | rem = x.lo % 10; 19 | /* 20 | * Now we have to add in the remainder left over from x.hi. 21 | */ 22 | r2 = x.hi % 10; 23 | y.lo += r2 * 429496729; 24 | rem += r2 * 6; 25 | y.lo += rem / 10; 26 | rem %= 10; 27 | 28 | if (remainder) 29 | *remainder = rem; 30 | return y; 31 | } 32 | 33 | void uint64_decimal(uint64 x, char *buffer) 34 | { 35 | char buf[20]; 36 | int start = 20; 37 | int d; 38 | 39 | do { 40 | x = uint64_div10(x, &d); 41 | assert(start > 0); 42 | buf[--start] = d + '0'; 43 | } while (x.hi || x.lo); 44 | 45 | memcpy(buffer, buf + start, sizeof(buf) - start); 46 | buffer[sizeof(buf) - start] = '\0'; 47 | } 48 | 49 | uint64 uint64_make(unsigned long hi, unsigned long lo) 50 | { 51 | uint64 y; 52 | y.hi = hi & 0xFFFFFFFFU; 53 | y.lo = lo & 0xFFFFFFFFU; 54 | return y; 55 | } 56 | 57 | uint64 uint64_add(uint64 x, uint64 y) 58 | { 59 | x.lo = (x.lo + y.lo) & 0xFFFFFFFFU; 60 | x.hi += y.hi + (x.lo < y.lo ? 1 : 0); 61 | return x; 62 | } 63 | 64 | uint64 uint64_add32(uint64 x, unsigned long y) 65 | { 66 | uint64 yy; 67 | yy.hi = 0; 68 | yy.lo = y; 69 | return uint64_add(x, yy); 70 | } 71 | 72 | int uint64_compare(uint64 x, uint64 y) 73 | { 74 | if (x.hi != y.hi) 75 | return x.hi < y.hi ? -1 : +1; 76 | if (x.lo != y.lo) 77 | return x.lo < y.lo ? -1 : +1; 78 | return 0; 79 | } 80 | 81 | uint64 uint64_subtract(uint64 x, uint64 y) 82 | { 83 | x.lo = (x.lo - y.lo) & 0xFFFFFFFFU; 84 | x.hi = (x.hi - y.hi - (x.lo > (y.lo ^ 0xFFFFFFFFU) ? 1 : 0)) & 0xFFFFFFFFU; 85 | return x; 86 | } 87 | 88 | double uint64_to_double(uint64 x) 89 | { 90 | return (4294967296.0 * x.hi) + (double)x.lo; 91 | } 92 | 93 | uint64 uint64_shift_right(uint64 x, int shift) 94 | { 95 | if (shift < 32) { 96 | x.lo >>= shift; 97 | x.lo |= (x.hi << (32-shift)) & 0xFFFFFFFFU; 98 | x.hi >>= shift; 99 | } else { 100 | x.lo = x.hi >> (shift-32); 101 | x.hi = 0; 102 | } 103 | return x; 104 | } 105 | 106 | uint64 uint64_shift_left(uint64 x, int shift) 107 | { 108 | if (shift < 32) { 109 | x.hi = (x.hi << shift) & 0xFFFFFFFFU; 110 | x.hi |= (x.lo >> (32-shift)); 111 | x.lo = (x.lo << shift) & 0xFFFFFFFFU; 112 | } else { 113 | x.hi = (x.lo << (shift-32)) & 0xFFFFFFFFU; 114 | x.lo = 0; 115 | } 116 | return x; 117 | } 118 | 119 | uint64 uint64_from_decimal(char *str) 120 | { 121 | uint64 ret; 122 | ret.hi = ret.lo = 0; 123 | while (*str >= '0' && *str <= '9') { 124 | ret = uint64_add(uint64_shift_left(ret, 3), 125 | uint64_shift_left(ret, 1)); 126 | ret = uint64_add32(ret, *str - '0'); 127 | str++; 128 | } 129 | return ret; 130 | } 131 | 132 | #ifdef TESTMODE 133 | 134 | #include 135 | 136 | int main(void) 137 | { 138 | uint64 x, y, z; 139 | char buf[80]; 140 | 141 | x = uint64_make(0x3456789AUL, 0xDEF01234UL); 142 | printf("%08lx.%08lx\n", x.hi, x.lo); 143 | uint64_decimal(x, buf); 144 | printf("%s\n", buf); 145 | 146 | y = uint64_add32(x, 0xFFFFFFFFU); 147 | printf("%08lx.%08lx\n", y.hi, y.lo); 148 | uint64_decimal(y, buf); 149 | printf("%s\n", buf); 150 | 151 | z = uint64_subtract(y, x); 152 | printf("%08lx.%08lx\n", z.hi, z.lo); 153 | uint64_decimal(z, buf); 154 | printf("%s\n", buf); 155 | 156 | z = uint64_subtract(x, y); 157 | printf("%08lx.%08lx\n", z.hi, z.lo); 158 | uint64_decimal(z, buf); 159 | printf("%s\n", buf); 160 | 161 | y = uint64_shift_right(x, 4); 162 | printf("%08lx.%08lx\n", y.hi, y.lo); 163 | 164 | y = uint64_shift_right(x, 36); 165 | printf("%08lx.%08lx\n", y.hi, y.lo); 166 | 167 | y = uint64_shift_left(x, 4); 168 | printf("%08lx.%08lx\n", x.hi, x.lo); 169 | 170 | y = uint64_shift_left(x, 36); 171 | printf("%08lx.%08lx\n", x.hi, x.lo); 172 | 173 | return 0; 174 | } 175 | #endif 176 | -------------------------------------------------------------------------------- /pe.old/INT64.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Header for int64.c. 3 | */ 4 | 5 | #ifndef PUTTY_INT64_H 6 | #define PUTTY_INT64_H 7 | 8 | typedef struct { 9 | unsigned long hi, lo; 10 | } uint64; 11 | 12 | uint64 uint64_div10(uint64 x, int *remainder); 13 | void uint64_decimal(uint64 x, char *buffer); 14 | uint64 uint64_make(unsigned long hi, unsigned long lo); 15 | uint64 uint64_add(uint64 x, uint64 y); 16 | uint64 uint64_add32(uint64 x, unsigned long y); 17 | int uint64_compare(uint64 x, uint64 y); 18 | uint64 uint64_subtract(uint64 x, uint64 y); 19 | double uint64_to_double(uint64 x); 20 | uint64 uint64_shift_right(uint64 x, int shift); 21 | uint64 uint64_shift_left(uint64 x, int shift); 22 | uint64 uint64_from_decimal(char *str); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /pe.old/LDISC.H: -------------------------------------------------------------------------------- 1 | /* 2 | * ldisc.h: defines the Ldisc data structure used by ldisc.c and 3 | * ldiscucs.c. (Unfortunately it was necessary to split the ldisc 4 | * module in two, to avoid unnecessarily linking in the Unicode 5 | * stuff in tools that don't require it.) 6 | */ 7 | 8 | #ifndef PUTTY_LDISC_H 9 | #define PUTTY_LDISC_H 10 | 11 | typedef struct ldisc_tag { 12 | Terminal *term; 13 | Backend *back; 14 | Config *cfg; 15 | void *backhandle; 16 | void *frontend; 17 | 18 | char *buf; 19 | int buflen, bufsiz, quotenext; 20 | } *Ldisc; 21 | 22 | #endif /* PUTTY_LDISC_H */ 23 | -------------------------------------------------------------------------------- /pe.old/LDISCUCS.C: -------------------------------------------------------------------------------- 1 | /* 2 | * ldisc.c: PuTTY line discipline. Sits between the input coming 3 | * from keypresses in the window, and the output channel leading to 4 | * the back end. Implements echo and/or local line editing, 5 | * depending on what's currently configured. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | #include "putty.h" 12 | #include "terminal.h" 13 | #include "ldisc.h" 14 | 15 | void lpage_send(void *handle, 16 | int codepage, char *buf, int len, int interactive) 17 | { 18 | Ldisc ldisc = (Ldisc)handle; 19 | wchar_t *widebuffer = 0; 20 | int widesize = 0; 21 | int wclen; 22 | 23 | if (codepage < 0) { 24 | ldisc_send(ldisc, buf, len, interactive); 25 | return; 26 | } 27 | 28 | widesize = len * 2; 29 | widebuffer = snewn(widesize, wchar_t); 30 | 31 | wclen = mb_to_wc(codepage, 0, buf, len, widebuffer, widesize); 32 | luni_send(ldisc, widebuffer, wclen, interactive); 33 | 34 | sfree(widebuffer); 35 | } 36 | 37 | void luni_send(void *handle, wchar_t * widebuf, int len, int interactive) 38 | { 39 | Ldisc ldisc = (Ldisc)handle; 40 | int ratio = (in_utf(ldisc->term))?3:1; 41 | char *linebuffer; 42 | int linesize; 43 | int i; 44 | char *p; 45 | 46 | linesize = len * ratio * 2; 47 | linebuffer = snewn(linesize, char); 48 | 49 | if (in_utf(ldisc->term)) { 50 | /* UTF is a simple algorithm */ 51 | for (p = linebuffer, i = 0; i < len; i++) { 52 | unsigned long ch = widebuf[i]; 53 | 54 | if ((ch & 0xF800) == 0xD800) { 55 | #ifdef PLATFORM_IS_UTF16 56 | if (i+1 < len) { 57 | unsigned long ch2 = widebuf[i+1]; 58 | if ((ch & 0xFC00) == 0xD800 && 59 | (ch2 & 0xFC00) == 0xDC00) { 60 | ch = 0x10000 + ((ch & 0x3FF) << 10) + (ch2 & 0x3FF); 61 | i++; 62 | } 63 | } else 64 | #endif 65 | { 66 | /* Unrecognised UTF-16 sequence */ 67 | ch = '.'; 68 | } 69 | } 70 | 71 | if (ch < 0x80) { 72 | *p++ = (char) (ch); 73 | } else if (ch < 0x800) { 74 | *p++ = (char) (0xC0 | (ch >> 6)); 75 | *p++ = (char) (0x80 | (ch & 0x3F)); 76 | } else if (ch < 0x10000) { 77 | *p++ = (char) (0xE0 | (ch >> 12)); 78 | *p++ = (char) (0x80 | ((ch >> 6) & 0x3F)); 79 | *p++ = (char) (0x80 | (ch & 0x3F)); 80 | } else { 81 | *p++ = (char) (0xF0 | (ch >> 18)); 82 | *p++ = (char) (0x80 | ((ch >> 12) & 0x3F)); 83 | *p++ = (char) (0x80 | ((ch >> 6) & 0x3F)); 84 | *p++ = (char) (0x80 | (ch & 0x3F)); 85 | } 86 | } 87 | } else { 88 | int rv; 89 | rv = wc_to_mb(ldisc->term->ucsdata->line_codepage, 0, widebuf, len, 90 | linebuffer, linesize, NULL, NULL, ldisc->term->ucsdata); 91 | if (rv >= 0) 92 | p = linebuffer + rv; 93 | else 94 | p = linebuffer; 95 | } 96 | if (p > linebuffer) 97 | ldisc_send(ldisc, linebuffer, p - linebuffer, interactive); 98 | 99 | sfree(linebuffer); 100 | } 101 | -------------------------------------------------------------------------------- /pe.old/LICENCE: -------------------------------------------------------------------------------- 1 | PuTTY is copyright 1997-2011 Simon Tatham. 2 | 3 | Portions copyright Robert de Bath, Joris van Rantwijk, Delian 4 | Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, 5 | Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus 6 | Kuhn, Colin Watson, and CORE SDI S.A. 7 | 8 | Permission is hereby granted, free of charge, to any person 9 | obtaining a copy of this software and associated documentation files 10 | (the "Software"), to deal in the Software without restriction, 11 | including without limitation the rights to use, copy, modify, merge, 12 | publish, distribute, sublicense, and/or sell copies of the Software, 13 | and to permit persons to whom the Software is furnished to do so, 14 | subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE 23 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 24 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /pe.old/MACOSX/INFO.PLI: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIconFile 6 | PuTTY.icns 7 | 8 | 9 | -------------------------------------------------------------------------------- /pe.old/MACOSX/OSX.H: -------------------------------------------------------------------------------- 1 | #ifndef PUTTY_OSX_H 2 | #define PUTTY_OSX_H 3 | 4 | /* 5 | * Cocoa defines `FontSpec' itself, so we must change its name. 6 | * (Arrgh.) 7 | */ 8 | #define FontSpec FontSpec_OSX_Proof 9 | 10 | /* 11 | * Define the various compatibility symbols to make uxpty.c compile 12 | * correctly on OS X. 13 | */ 14 | #define BSD_PTYS 15 | #define OMIT_UTMP 16 | #define HAVE_NO_SETRESUID 17 | #define NOT_X_WINDOWS 18 | 19 | /* 20 | * OS X is largely just Unix, so we can include most of this 21 | * unchanged. 22 | */ 23 | #include "unix.h" 24 | 25 | /* 26 | * Functions exported by osxsel.m. (Both of these functions are 27 | * expected to be called in the _main_ thread: the select subthread 28 | * is an implementation detail of osxsel.m and ideally should not 29 | * be visible at all outside it.) 30 | */ 31 | void osxsel_init(void); /* call this to kick things off */ 32 | void osxsel_process_results(void); /* call this on receipt of a netevent */ 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /pe.old/MACOSX/OSXCLASS.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Header file for the Objective-C parts of Mac OS X PuTTY. This 3 | * file contains the class definitions, which would cause compile 4 | * failures in the pure C modules if they appeared in osx.h. 5 | */ 6 | 7 | #ifndef PUTTY_OSXCLASS_H 8 | #define PUTTY_OSXCLASS_H 9 | 10 | #include "putty.h" 11 | 12 | /* 13 | * The application controller class, defined in osxmain.m. 14 | */ 15 | @interface AppController : NSObject 16 | { 17 | NSTimer *timer; 18 | } 19 | - (void)newSessionConfig:(id)sender; 20 | - (void)newTerminal:(id)sender; 21 | - (void)newSessionWithConfig:(id)cfg; 22 | - (void)setTimer:(long)next; 23 | @end 24 | extern AppController *controller; 25 | 26 | /* 27 | * The SessionWindow class, defined in osxwin.m. 28 | */ 29 | 30 | struct alert_queue { 31 | struct alert_queue *next; 32 | NSAlert *alert; 33 | void (*callback)(void *, int); 34 | void *ctx; 35 | }; 36 | 37 | @class SessionWindow; 38 | @class TerminalView; 39 | 40 | @interface SessionWindow : NSWindow 41 | { 42 | Terminal *term; 43 | TerminalView *termview; 44 | struct unicode_data ucsdata; 45 | void *logctx; 46 | Config cfg; 47 | void *ldisc; 48 | Backend *back; 49 | void *backhandle; 50 | int exited; 51 | /* 52 | * The following two members relate to the currently active 53 | * alert sheet, if any. They are NULL if there isn't one. 54 | */ 55 | void (*alert_callback)(void *, int); 56 | void *alert_ctx; 57 | /* This queues future alerts that need to be shown. */ 58 | struct alert_queue *alert_qhead, *alert_qtail; 59 | } 60 | - (id)initWithConfig:(Config)cfg; 61 | - (void)drawStartFinish:(BOOL)start; 62 | - (void)setColour:(int)n r:(float)r g:(float)g b:(float)b; 63 | - (Config *)cfg; 64 | - (void)doText:(wchar_t *)text len:(int)len x:(int)x y:(int)y 65 | attr:(unsigned long)attr lattr:(int)lattr; 66 | - (int)fromBackend:(const char *)data len:(int)len isStderr:(int)is_stderr; 67 | - (int)fromBackendUntrusted:(const char *)data len:(int)len; 68 | - (void)startAlert:(NSAlert *)alert 69 | withCallback:(void (*)(void *, int))callback andCtx:(void *)ctx; 70 | - (void)endSession:(int)clean; 71 | - (void)notifyRemoteExit; 72 | - (Terminal *)term; 73 | @end 74 | 75 | /* 76 | * The ConfigWindow class, defined in osxdlg.m. 77 | */ 78 | 79 | @class ConfigWindow; 80 | 81 | @interface ConfigWindow : NSWindow 82 | { 83 | NSOutlineView *treeview; 84 | struct controlbox *ctrlbox; 85 | void *dv; 86 | Config cfg; 87 | } 88 | - (id)initWithConfig:(Config)cfg; 89 | @end 90 | 91 | /* 92 | * Functions exported by osxctrls.m. (They have to go in this 93 | * header file and not osx.h, because some of them have Cocoa class 94 | * types in their prototypes.) 95 | */ 96 | #define HSPACING 12 /* needed in osxdlg.m and osxctrls.m */ 97 | #define VSPACING 8 98 | 99 | void *fe_dlg_init(void *data, NSWindow *window, NSObject *target, SEL action); 100 | void fe_dlg_free(void *dv); 101 | void create_ctrls(void *dv, NSView *parent, struct controlset *s, 102 | int *minw, int *minh); 103 | int place_ctrls(void *dv, struct controlset *s, int leftx, int topy, 104 | int width); /* returns height used */ 105 | void select_panel(void *dv, struct controlbox *b, const char *name); 106 | 107 | #endif /* PUTTY_OSXCLASS_H */ 108 | -------------------------------------------------------------------------------- /pe.old/MACOSX/PUTTY.ICN: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/MACOSX/PUTTY.ICN -------------------------------------------------------------------------------- /pe.old/MACOSX/README.OSX: -------------------------------------------------------------------------------- 1 | This directory contains a Mac OS X port of PuTTY/pterm, running as a 2 | native Aqua GUI application. 3 | 4 | THIS PORT IS CURRENTLY UNFINISHED AND EXPERIMENTAL. It is _not_ 5 | considered to be of release quality, even if you've found it (and 6 | are reading this) in a PuTTY release source archive. You are welcome 7 | to try using it, but don't be surprised at unexpected behaviour. I'm 8 | not kidding. 9 | 10 | In particular, I have not yet decided where OS X PuTTY should store 11 | its configuration data. Options include storing it in ~/.putty to be 12 | compatible with Unix PuTTY, storing it wherever is compatible with 13 | Mac Classic PuTTY, storing it in a natively OS X location, or 14 | sorting out the `config-locations' wishlist item and doing all 15 | three. Therefore, if you start using this port and create a whole 16 | load of saved sessions, you should not be surprised if a future 17 | version of the port decides to look somewhere completely different 18 | for the data and therefore loses them all. If that happens, don't 19 | say you weren't warned! 20 | 21 | Other ways in which the port is currently unfinished include: 22 | 23 | Missing terminal window features 24 | -------------------------------- 25 | 26 | - terminal display is horribly slow 27 | 28 | - fonts aren't configurable 29 | 30 | - several features are unimplemented in the terminal display: 31 | underlining, non-solid-block cursors, double-width and 32 | double-height line attributes, bold as font rather than as 33 | colour, wide (CJK) characters, combining characters. 34 | 35 | - there's no scrollbar 36 | 37 | - terminal window resizing isn't implemented yet 38 | 39 | - proper window placement (cascading down and right from the 40 | starting position, plus remembering previous window positions per 41 | the Apple HIG) is not implemented 42 | 43 | Missing alert box features 44 | -------------------------- 45 | 46 | - warn-on-close isn't implemented 47 | 48 | Missing input features 49 | ---------------------- 50 | 51 | - use of Alt+numberpad to enter arbitrary numeric character codes 52 | is not yet supported 53 | 54 | - there's no Meta key yet. (I'd like to at least have the 55 | possibility of using Command rather than Option as the Meta key, 56 | since the latter is necessary to send some characters, including 57 | the rather important # on Apple UK keyboards; but trapping 58 | Command- and sending it to the window rather than the 59 | application menu requires me to make a positive effort of some 60 | sort and I haven't got round to it yet. For those Mac users who 61 | consider their Command key sacrosanct, don't worry, this option 62 | _will_ be configurable and _will_ be off by default.) 63 | 64 | - there's no specials menu 65 | 66 | - mouse activity isn't supported (neither cut-and-paste nor xterm 67 | mouse tracking) 68 | 69 | Missing terminal emulation features 70 | ----------------------------------- 71 | 72 | - currently no support for server-side window management requests 73 | (i.e. escape sequences to minimise or maximise the window, 74 | request or change its position and size, change its title etc) 75 | 76 | - window title is currently fixed 77 | 78 | Other missing features 79 | ---------------------- 80 | 81 | - no Event Log 82 | 83 | - no mid-session Change Settings 84 | -------------------------------------------------------------------------------- /pe.old/MISC.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Header for misc.c. 3 | */ 4 | 5 | #ifndef PUTTY_MISC_H 6 | #define PUTTY_MISC_H 7 | 8 | #include "puttymem.h" 9 | 10 | #include /* for FILE * */ 11 | #include /* for va_list */ 12 | #include /* for struct tm */ 13 | 14 | #ifndef FALSE 15 | #define FALSE 0 16 | #endif 17 | #ifndef TRUE 18 | #define TRUE 1 19 | #endif 20 | 21 | typedef struct Filename Filename; 22 | typedef struct FontSpec FontSpec; 23 | 24 | unsigned long parse_blocksize(const char *bs); 25 | char ctrlparse(char *s, char **next); 26 | 27 | char *dupstr(const char *s); 28 | char *dupcat(const char *s1, ...); 29 | char *dupprintf(const char *fmt, ...); 30 | char *dupvprintf(const char *fmt, va_list ap); 31 | 32 | char *fgetline(FILE *fp); 33 | 34 | void base64_encode_atom(unsigned char *data, int n, char *out); 35 | 36 | struct bufchain_granule; 37 | typedef struct bufchain_tag { 38 | struct bufchain_granule *head, *tail; 39 | int buffersize; /* current amount of buffered data */ 40 | } bufchain; 41 | 42 | void bufchain_init(bufchain *ch); 43 | void bufchain_clear(bufchain *ch); 44 | int bufchain_size(bufchain *ch); 45 | void bufchain_add(bufchain *ch, const void *data, int len); 46 | void bufchain_prefix(bufchain *ch, void **data, int *len); 47 | void bufchain_consume(bufchain *ch, int len); 48 | void bufchain_fetch(bufchain *ch, void *data, int len); 49 | 50 | struct tm ltime(void); 51 | 52 | /* 53 | * Debugging functions. 54 | * 55 | * Output goes to debug.log 56 | * 57 | * debug(()) (note the double brackets) is like printf(). 58 | * 59 | * dmemdump() and dmemdumpl() both do memory dumps. The difference 60 | * is that dmemdumpl() is more suited for when the memory address is 61 | * important (say because you'll be recording pointer values later 62 | * on). dmemdump() is more concise. 63 | */ 64 | 65 | #ifdef DEBUG 66 | void debug_printf(char *fmt, ...); 67 | void debug_memdump(void *buf, int len, int L); 68 | #define debug(x) (debug_printf x) 69 | #define dmemdump(buf,len) debug_memdump (buf, len, 0); 70 | #define dmemdumpl(buf,len) debug_memdump (buf, len, 1); 71 | #else 72 | #define debug(x) 73 | #define dmemdump(buf,len) 74 | #define dmemdumpl(buf,len) 75 | #endif 76 | 77 | #ifndef lenof 78 | #define lenof(x) ( (sizeof((x))) / (sizeof(*(x)))) 79 | #endif 80 | 81 | #ifndef min 82 | #define min(x,y) ( (x) < (y) ? (x) : (y) ) 83 | #endif 84 | #ifndef max 85 | #define max(x,y) ( (x) > (y) ? (x) : (y) ) 86 | #endif 87 | 88 | #define GET_32BIT_LSB_FIRST(cp) \ 89 | (((unsigned long)(unsigned char)(cp)[0]) | \ 90 | ((unsigned long)(unsigned char)(cp)[1] << 8) | \ 91 | ((unsigned long)(unsigned char)(cp)[2] << 16) | \ 92 | ((unsigned long)(unsigned char)(cp)[3] << 24)) 93 | 94 | #define PUT_32BIT_LSB_FIRST(cp, value) ( \ 95 | (cp)[0] = (unsigned char)(value), \ 96 | (cp)[1] = (unsigned char)((value) >> 8), \ 97 | (cp)[2] = (unsigned char)((value) >> 16), \ 98 | (cp)[3] = (unsigned char)((value) >> 24) ) 99 | 100 | #define GET_16BIT_LSB_FIRST(cp) \ 101 | (((unsigned long)(unsigned char)(cp)[0]) | \ 102 | ((unsigned long)(unsigned char)(cp)[1] << 8)) 103 | 104 | #define PUT_16BIT_LSB_FIRST(cp, value) ( \ 105 | (cp)[0] = (unsigned char)(value), \ 106 | (cp)[1] = (unsigned char)((value) >> 8) ) 107 | 108 | #define GET_32BIT_MSB_FIRST(cp) \ 109 | (((unsigned long)(unsigned char)(cp)[0] << 24) | \ 110 | ((unsigned long)(unsigned char)(cp)[1] << 16) | \ 111 | ((unsigned long)(unsigned char)(cp)[2] << 8) | \ 112 | ((unsigned long)(unsigned char)(cp)[3])) 113 | 114 | #define GET_32BIT(cp) GET_32BIT_MSB_FIRST(cp) 115 | 116 | #define PUT_32BIT_MSB_FIRST(cp, value) ( \ 117 | (cp)[0] = (unsigned char)((value) >> 24), \ 118 | (cp)[1] = (unsigned char)((value) >> 16), \ 119 | (cp)[2] = (unsigned char)((value) >> 8), \ 120 | (cp)[3] = (unsigned char)(value) ) 121 | 122 | #define PUT_32BIT(cp, value) PUT_32BIT_MSB_FIRST(cp, value) 123 | 124 | #define GET_16BIT_MSB_FIRST(cp) \ 125 | (((unsigned long)(unsigned char)(cp)[0] << 8) | \ 126 | ((unsigned long)(unsigned char)(cp)[1])) 127 | 128 | #define PUT_16BIT_MSB_FIRST(cp, value) ( \ 129 | (cp)[0] = (unsigned char)((value) >> 8), \ 130 | (cp)[1] = (unsigned char)(value) ) 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /pe.old/MKAUTO.SH: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # This script makes the autoconf mechanism for the Unix port work. 3 | # It's separate from mkfiles.pl because it won't work (and isn't needed) 4 | # on a non-Unix system. 5 | 6 | # It's nice to be able to run this from inside the unix subdir as 7 | # well as from outside. 8 | test -f unix.h && cd .. 9 | 10 | # Persuade automake to give us a copy of its install-sh. This is a 11 | # pain because I don't actually want to have to _use_ automake. 12 | # Instead, I construct a trivial unrelated automake project in a 13 | # temporary subdirectory, run automake so that it'll copy 14 | # install-sh into that directory, then copy it back out again. 15 | # Hideous, but it should work. 16 | 17 | mkdir automake-grievous-hack 18 | cat > automake-grievous-hack/hello.c << EOF 19 | #include 20 | int main(int argc, char **argv) 21 | { 22 | printf("hello, world\n"); 23 | return 0; 24 | } 25 | EOF 26 | cat > automake-grievous-hack/Makefile.am << EOF 27 | bin_PROGRAMS = hello 28 | hello_SOURCES = hello.c 29 | EOF 30 | cat > automake-grievous-hack/configure.ac << EOF 31 | AC_INIT 32 | AM_INIT_AUTOMAKE(hello, 1.0) 33 | AC_CONFIG_FILES([Makefile]) 34 | AC_PROG_CC 35 | AC_OUTPUT 36 | EOF 37 | echo Some news > automake-grievous-hack/NEWS 38 | echo Some text > automake-grievous-hack/README 39 | echo Some people > automake-grievous-hack/AUTHORS 40 | echo Some changes > automake-grievous-hack/ChangeLog 41 | rm -f install-sh # this won't work if we accidentally have one _here_ 42 | (cd automake-grievous-hack && autoreconf -i && \ 43 | cp install-sh ../unix/install-sh) 44 | rm -rf automake-grievous-hack 45 | 46 | # That was the hard bit. Now run autoconf on our real configure.in. 47 | (cd unix && autoreconf && rm -rf aclocal.m4 autom4te.cache) 48 | -------------------------------------------------------------------------------- /pe.old/MKUNXARC.SH: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Build a Unix source distribution from the PuTTY CVS area. 4 | # 5 | # Pass an argument of the form `2004-02-08' to have the archive 6 | # tagged as a development snapshot; of the form `0.54' to have it 7 | # tagged as a release; of the form `r1234' to have it tagged as a 8 | # custom build. Otherwise it'll be tagged as unidentified. 9 | 10 | case "$1" in 11 | ????-??-??) 12 | case "$1" in *[!-0-9]*) echo "Malformed snapshot ID '$1'" >&2;exit 1;;esac 13 | arcsuffix="-`cat LATEST.VER`-$1" 14 | ver="-DSNAPSHOT=$1" 15 | docver= 16 | ;; 17 | r*) 18 | arcsuffix="-$1" 19 | ver="-DSVN_REV=$1" 20 | docver= 21 | ;; 22 | '') 23 | arcsuffix= 24 | ver= 25 | docver= 26 | ;; 27 | *) 28 | case "$1" in *[!.0-9a-z]*) echo "Malformed release ID '$1'">&2;exit 1;;esac 29 | arcsuffix="-$1" 30 | ver="-DRELEASE=$1" 31 | docver="VERSION=\"PuTTY release $1\"" 32 | ;; 33 | esac 34 | 35 | perl mkfiles.pl 36 | (cd doc && make -s ${docver:+"$docver"}) 37 | sh mkauto.sh 2>/dev/null 38 | 39 | relver=`cat LATEST.VER` 40 | arcname="putty$arcsuffix" 41 | mkdir uxarc 42 | mkdir uxarc/$arcname 43 | find . -name uxarc -prune -o \ 44 | -name CVS -prune -o \ 45 | -name .svn -prune -o \ 46 | -name . -o \ 47 | -type d -exec mkdir uxarc/$arcname/{} \; 48 | find . -name uxarc -prune -o \ 49 | -name CVS -prune -o \ 50 | -name .cvsignore -prune -o \ 51 | -name .svn -prune -o \ 52 | -name '*.zip' -prune -o \ 53 | -name '*.tar.gz' -prune -o \ 54 | -type f -exec ln -s $PWD/{} uxarc/$arcname/{} \; 55 | if test "x$ver" != "x"; then 56 | (cd uxarc/$arcname; 57 | md5sum `find . -name '*.[ch]' -print` > manifest; 58 | echo "$ver" > version.def) 59 | fi 60 | tar -C uxarc -chzof $arcname.tar.gz $arcname 61 | rm -rf uxarc 62 | -------------------------------------------------------------------------------- /pe.old/NOCPROXY.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Routines to refuse to do cryptographic interaction with proxies 3 | * in PuTTY. This is a stub implementation of the same interfaces 4 | * provided by cproxy.c, for use in PuTTYtel. 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define DEFINE_PLUG_METHOD_MACROS 12 | #include "putty.h" 13 | #include "network.h" 14 | #include "proxy.h" 15 | 16 | void proxy_socks5_offerencryptedauth(char * command, int * len) 17 | { 18 | /* For telnet, don't add any new encrypted authentication routines */ 19 | } 20 | 21 | int proxy_socks5_handlechap (Proxy_Socket p) 22 | { 23 | 24 | plug_closing(p->plug, "Proxy error: Trying to handle a SOCKS5 CHAP request" 25 | " in telnet-only build", 26 | PROXY_ERROR_GENERAL, 0); 27 | return 1; 28 | } 29 | 30 | int proxy_socks5_selectchap(Proxy_Socket p) 31 | { 32 | plug_closing(p->plug, "Proxy error: Trying to handle a SOCKS5 CHAP request" 33 | " in telnet-only build", 34 | PROXY_ERROR_GENERAL, 0); 35 | return 1; 36 | } 37 | -------------------------------------------------------------------------------- /pe.old/NOGSS.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub definitions of the GSSAPI library list, for Unix pterm and 3 | * any other application that needs the symbols defined but has no 4 | * use for them. 5 | */ 6 | 7 | #include "putty.h" 8 | 9 | const int ngsslibs = 0; 10 | const char *const gsslibnames[1] = { "dummy" }; 11 | const struct keyvalwhere gsslibkeywords[1] = { { "dummy", 0, -1, -1 } }; 12 | -------------------------------------------------------------------------------- /pe.old/NOPRINT.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub implementation of the printing interface for PuTTY, for the 3 | * benefit of non-printing terminal applications. 4 | */ 5 | 6 | #include 7 | #include 8 | #include "putty.h" 9 | 10 | struct printer_job_tag { 11 | int dummy; 12 | }; 13 | 14 | printer_job *printer_start_job(char *printer) 15 | { 16 | return NULL; 17 | } 18 | 19 | void printer_job_data(printer_job *pj, void *data, int len) 20 | { 21 | } 22 | 23 | void printer_finish_job(printer_job *pj) 24 | { 25 | } 26 | 27 | printer_enum *printer_start_enum(int *nprinters_ptr) 28 | { 29 | *nprinters_ptr = 0; 30 | return NULL; 31 | } 32 | char *printer_get_name(printer_enum *pe, int i) 33 | { 34 | return NULL; 35 | } 36 | void printer_finish_enum(printer_enum *pe) 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /pe.old/NOTIMING.C: -------------------------------------------------------------------------------- 1 | /* 2 | * notiming.c: stub version of timing API. 3 | * 4 | * Used in any tool which needs a subsystem linked against the 5 | * timing API but doesn't want to actually provide timing. For 6 | * example, key generation tools need the random number generator, 7 | * but they don't want the hassle of calling noise_regular() at 8 | * regular intervals - and they don't _need_ it either, since they 9 | * have their own rigorous and different means of noise collection. 10 | */ 11 | 12 | #include "putty.h" 13 | 14 | long schedule_timer(int ticks, timer_fn_t fn, void *ctx) 15 | { 16 | return 0; 17 | } 18 | 19 | void expire_timer_context(void *ctx) 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /pe.old/PINGER.C: -------------------------------------------------------------------------------- 1 | /* 2 | * pinger.c: centralised module that deals with sending TS_PING 3 | * keepalives, to avoid replicating this code in multiple backends. 4 | */ 5 | 6 | #include "putty.h" 7 | 8 | struct pinger_tag { 9 | int interval; 10 | int pending; 11 | long next; 12 | Backend *back; 13 | void *backhandle; 14 | }; 15 | 16 | static void pinger_schedule(Pinger pinger); 17 | 18 | static void pinger_timer(void *ctx, long now) 19 | { 20 | Pinger pinger = (Pinger)ctx; 21 | 22 | if (pinger->pending && now - pinger->next >= 0) { 23 | pinger->back->special(pinger->backhandle, TS_PING); 24 | pinger->pending = FALSE; 25 | pinger_schedule(pinger); 26 | } 27 | } 28 | 29 | static void pinger_schedule(Pinger pinger) 30 | { 31 | int next; 32 | 33 | if (!pinger->interval) { 34 | pinger->pending = FALSE; /* cancel any pending ping */ 35 | return; 36 | } 37 | 38 | next = schedule_timer(pinger->interval * TICKSPERSEC, 39 | pinger_timer, pinger); 40 | if (!pinger->pending || next < pinger->next) { 41 | pinger->next = next; 42 | pinger->pending = TRUE; 43 | } 44 | } 45 | 46 | Pinger pinger_new(Config *cfg, Backend *back, void *backhandle) 47 | { 48 | Pinger pinger = snew(struct pinger_tag); 49 | 50 | pinger->interval = cfg->ping_interval; 51 | pinger->pending = FALSE; 52 | pinger->back = back; 53 | pinger->backhandle = backhandle; 54 | pinger_schedule(pinger); 55 | 56 | return pinger; 57 | } 58 | 59 | void pinger_reconfig(Pinger pinger, Config *oldcfg, Config *newcfg) 60 | { 61 | if (oldcfg->ping_interval != newcfg->ping_interval) { 62 | pinger->interval = newcfg->ping_interval; 63 | pinger_schedule(pinger); 64 | } 65 | } 66 | 67 | void pinger_free(Pinger pinger) 68 | { 69 | expire_timer_context(pinger); 70 | sfree(pinger); 71 | } 72 | -------------------------------------------------------------------------------- /pe.old/PPROXY.C: -------------------------------------------------------------------------------- 1 | /* 2 | * pproxy.c: dummy implementation of platform_new_connection(), to 3 | * be supplanted on any platform which has its own local proxy 4 | * method. 5 | */ 6 | 7 | #include "putty.h" 8 | #include "network.h" 9 | #include "proxy.h" 10 | 11 | Socket platform_new_connection(SockAddr addr, char *hostname, 12 | int port, int privport, 13 | int oobinline, int nodelay, int keepalive, 14 | Plug plug, const Config *cfg) 15 | { 16 | return NULL; 17 | } 18 | -------------------------------------------------------------------------------- /pe.old/PROXY.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Network proxy abstraction in PuTTY 3 | * 4 | * A proxy layer, if necessary, wedges itself between the 5 | * network code and the higher level backend. 6 | * 7 | * Supported proxies: HTTP CONNECT, generic telnet, SOCKS 4 & 5 8 | */ 9 | 10 | #ifndef PUTTY_PROXY_H 11 | #define PUTTY_PROXY_H 12 | 13 | #define PROXY_ERROR_GENERAL 8000 14 | #define PROXY_ERROR_UNEXPECTED 8001 15 | 16 | typedef struct Socket_proxy_tag * Proxy_Socket; 17 | 18 | struct Socket_proxy_tag { 19 | const struct socket_function_table *fn; 20 | /* the above variable absolutely *must* be the first in this structure */ 21 | 22 | char * error; 23 | 24 | Socket sub_socket; 25 | Plug plug; 26 | SockAddr remote_addr; 27 | int remote_port; 28 | 29 | bufchain pending_output_data; 30 | bufchain pending_oob_output_data; 31 | int pending_flush; 32 | bufchain pending_input_data; 33 | 34 | #define PROXY_STATE_NEW -1 35 | #define PROXY_STATE_ACTIVE 0 36 | 37 | int state; /* proxy states greater than 0 are implementation 38 | * dependent, but represent various stages/states 39 | * of the initialization/setup/negotiation with the 40 | * proxy server. 41 | */ 42 | int freeze; /* should we freeze the underlying socket when 43 | * we are done with the proxy negotiation? this 44 | * simply caches the value of sk_set_frozen calls. 45 | */ 46 | 47 | #define PROXY_CHANGE_NEW -1 48 | #define PROXY_CHANGE_CLOSING 0 49 | #define PROXY_CHANGE_SENT 1 50 | #define PROXY_CHANGE_RECEIVE 2 51 | #define PROXY_CHANGE_ACCEPTING 3 52 | 53 | /* something has changed (a call from the sub socket 54 | * layer into our Proxy Plug layer, or we were just 55 | * created, etc), so the proxy layer needs to handle 56 | * this change (the type of which is the second argument) 57 | * and further the proxy negotiation process. 58 | */ 59 | 60 | int (*negotiate) (Proxy_Socket /* this */, int /* change type */); 61 | 62 | /* current arguments of plug handlers 63 | * (for use by proxy's negotiate function) 64 | */ 65 | 66 | /* closing */ 67 | const char *closing_error_msg; 68 | int closing_error_code; 69 | int closing_calling_back; 70 | 71 | /* receive */ 72 | int receive_urgent; 73 | char *receive_data; 74 | int receive_len; 75 | 76 | /* sent */ 77 | int sent_bufsize; 78 | 79 | /* accepting */ 80 | OSSocket accepting_sock; 81 | 82 | /* configuration, used to look up proxy settings */ 83 | Config cfg; 84 | 85 | /* CHAP transient data */ 86 | int chap_num_attributes; 87 | int chap_num_attributes_processed; 88 | int chap_current_attribute; 89 | int chap_current_datalen; 90 | }; 91 | 92 | typedef struct Plug_proxy_tag * Proxy_Plug; 93 | 94 | struct Plug_proxy_tag { 95 | const struct plug_function_table *fn; 96 | /* the above variable absolutely *must* be the first in this structure */ 97 | 98 | Proxy_Socket proxy_socket; 99 | 100 | }; 101 | 102 | extern void proxy_activate (Proxy_Socket); 103 | 104 | extern int proxy_http_negotiate (Proxy_Socket, int); 105 | extern int proxy_telnet_negotiate (Proxy_Socket, int); 106 | extern int proxy_socks4_negotiate (Proxy_Socket, int); 107 | extern int proxy_socks5_negotiate (Proxy_Socket, int); 108 | 109 | /* 110 | * This may be reused by local-command proxies on individual 111 | * platforms. 112 | */ 113 | char *format_telnet_command(SockAddr addr, int port, const Config *cfg); 114 | 115 | /* 116 | * These are implemented in cproxy.c or nocproxy.c, depending on 117 | * whether encrypted proxy authentication is available. 118 | */ 119 | extern void proxy_socks5_offerencryptedauth(char *command, int *len); 120 | extern int proxy_socks5_handlechap (Proxy_Socket p); 121 | extern int proxy_socks5_selectchap(Proxy_Socket p); 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /pe.old/PUTTYMEM.H: -------------------------------------------------------------------------------- 1 | /* 2 | * PuTTY memory-handling header. 3 | */ 4 | 5 | #ifndef PUTTY_PUTTYMEM_H 6 | #define PUTTY_PUTTYMEM_H 7 | 8 | #include /* for size_t */ 9 | #include /* for memcpy() */ 10 | 11 | 12 | /* #define MALLOC_LOG do this if you suspect putty of leaking memory */ 13 | #ifdef MALLOC_LOG 14 | #define smalloc(z) (mlog(__FILE__,__LINE__), safemalloc(z,1)) 15 | #define snmalloc(z,s) (mlog(__FILE__,__LINE__), safemalloc(z,s)) 16 | #define srealloc(y,z) (mlog(__FILE__,__LINE__), saferealloc(y,z,1)) 17 | #define snrealloc(y,z,s) (mlog(__FILE__,__LINE__), saferealloc(y,z,s)) 18 | #define sfree(z) (mlog(__FILE__,__LINE__), safefree(z)) 19 | void mlog(char *, int); 20 | #else 21 | #define smalloc(z) safemalloc(z,1) 22 | #define snmalloc safemalloc 23 | #define srealloc(y,z) saferealloc(y,z,1) 24 | #define snrealloc saferealloc 25 | #define sfree safefree 26 | #endif 27 | 28 | void *safemalloc(size_t, size_t); 29 | void *saferealloc(void *, size_t, size_t); 30 | void safefree(void *); 31 | 32 | /* 33 | * Direct use of smalloc within the code should be avoided where 34 | * possible, in favour of these type-casting macros which ensure 35 | * you don't mistakenly allocate enough space for one sort of 36 | * structure and assign it to a different sort of pointer. 37 | */ 38 | #define snew(type) ((type *)snmalloc(1, sizeof(type))) 39 | #define snewn(n, type) ((type *)snmalloc((n), sizeof(type))) 40 | #define sresize(ptr, n, type) ((type *)snrealloc((ptr), (n), sizeof(type))) 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /pe.old/PUTTYPS.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Find the platform-specific header for this platform. 3 | */ 4 | 5 | #ifndef PUTTY_PUTTYPS_H 6 | #define PUTTY_PUTTYPS_H 7 | 8 | #ifdef _WINDOWS 9 | 10 | #include "winstuff.h" 11 | 12 | #elif defined(MACOSX) 13 | 14 | #include "osx.h" 15 | 16 | #else 17 | 18 | #include "unix.h" 19 | 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /pe.old/RESOURCE.H: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by win_res.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /pe.old/SIGN.SH: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Generate GPG signatures on a PuTTY release/snapshot directory as 4 | # delivered by Buildscr. 5 | 6 | # Usage: sh sign.sh 7 | # e.g. sh sign.sh putty Snapshots (probably in the build.out directory) 8 | # or sh sign.sh 0.60 Releases 9 | 10 | set -e 11 | 12 | sign() { 13 | # Check for the prior existence of the signature, so we can 14 | # re-run this script if it encounters an error part way 15 | # through. 16 | echo "----- Signing $2 with '$keyname'" 17 | test -f "$3" || \ 18 | gpg --load-extension=idea "$1" -u "$keyname" -o "$3" "$2" 19 | } 20 | 21 | cd "$1" 22 | for t in DSA RSA; do 23 | keyname="$2 ($t)" 24 | echo "===== Signing with '$keyname'" 25 | for i in putty*src.zip putty*.tar.gz x86/*.exe x86/*.zip; do 26 | sign --detach-sign "$i" "$i.$t" 27 | done 28 | for i in md5sums sha1sums sha256sums sha512sums; do 29 | sign --clearsign $i ${i}.$t 30 | done 31 | done 32 | -------------------------------------------------------------------------------- /pe.old/SSHARCF.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Arcfour (RC4) implementation for PuTTY. 3 | * 4 | * Coded from Schneier. 5 | */ 6 | 7 | #include 8 | #include "ssh.h" 9 | 10 | typedef struct { 11 | unsigned char i, j, s[256]; 12 | } ArcfourContext; 13 | 14 | static void arcfour_block(void *handle, unsigned char *blk, int len) 15 | { 16 | ArcfourContext *ctx = (ArcfourContext *)handle; 17 | unsigned k; 18 | unsigned char tmp, i, j, *s; 19 | 20 | s = ctx->s; 21 | i = ctx->i; j = ctx->j; 22 | for (k = 0; (int)k < len; k++) { 23 | i = (i + 1) & 0xff; 24 | j = (j + s[i]) & 0xff; 25 | tmp = s[i]; s[i] = s[j]; s[j] = tmp; 26 | blk[k] ^= s[(s[i]+s[j]) & 0xff]; 27 | } 28 | ctx->i = i; ctx->j = j; 29 | } 30 | 31 | static void arcfour_setkey(ArcfourContext *ctx, unsigned char const *key, 32 | unsigned keybytes) 33 | { 34 | unsigned char tmp, k[256], *s; 35 | unsigned i, j; 36 | 37 | s = ctx->s; 38 | assert(keybytes <= 256); 39 | ctx->i = ctx->j = 0; 40 | for (i = 0; i < 256; i++) { 41 | s[i] = i; 42 | k[i] = key[i % keybytes]; 43 | } 44 | j = 0; 45 | for (i = 0; i < 256; i++) { 46 | j = (j + s[i] + k[i]) & 0xff; 47 | tmp = s[i]; s[i] = s[j]; s[j] = tmp; 48 | } 49 | } 50 | 51 | /* -- Interface with PuTTY -- */ 52 | 53 | /* 54 | * We don't implement Arcfour in SSH-1 because it's utterly insecure in 55 | * several ways. See CERT Vulnerability Notes VU#25309, VU#665372, 56 | * and VU#565052. 57 | * 58 | * We don't implement the "arcfour" algorithm in SSH-2 because it doesn't 59 | * stir the cipher state before emitting keystream, and hence is likely 60 | * to leak data about the key. 61 | */ 62 | 63 | static void *arcfour_make_context(void) 64 | { 65 | return snew(ArcfourContext); 66 | } 67 | 68 | static void arcfour_free_context(void *handle) 69 | { 70 | sfree(handle); 71 | } 72 | 73 | static void arcfour_stir(ArcfourContext *ctx) 74 | { 75 | unsigned char *junk = snewn(1536, unsigned char); 76 | memset(junk, 0, 1536); 77 | arcfour_block(ctx, junk, 1536); 78 | memset(junk, 0, 1536); 79 | sfree(junk); 80 | } 81 | 82 | static void arcfour128_key(void *handle, unsigned char *key) 83 | { 84 | ArcfourContext *ctx = (ArcfourContext *)handle; 85 | arcfour_setkey(ctx, key, 16); 86 | arcfour_stir(ctx); 87 | } 88 | 89 | static void arcfour256_key(void *handle, unsigned char *key) 90 | { 91 | ArcfourContext *ctx = (ArcfourContext *)handle; 92 | arcfour_setkey(ctx, key, 32); 93 | arcfour_stir(ctx); 94 | } 95 | 96 | static void arcfour_iv(void *handle, unsigned char *key) 97 | { 98 | 99 | } 100 | 101 | const struct ssh2_cipher ssh_arcfour128_ssh2 = { 102 | arcfour_make_context, arcfour_free_context, arcfour_iv, arcfour128_key, 103 | arcfour_block, arcfour_block, 104 | "arcfour128", 105 | 1, 128, 0, "Arcfour-128" 106 | }; 107 | 108 | const struct ssh2_cipher ssh_arcfour256_ssh2 = { 109 | arcfour_make_context, arcfour_free_context, arcfour_iv, arcfour256_key, 110 | arcfour_block, arcfour_block, 111 | "arcfour256", 112 | 1, 256, 0, "Arcfour-256" 113 | }; 114 | 115 | static const struct ssh2_cipher *const arcfour_list[] = { 116 | &ssh_arcfour256_ssh2, 117 | &ssh_arcfour128_ssh2, 118 | }; 119 | 120 | const struct ssh2_ciphers ssh2_arcfour = { 121 | sizeof(arcfour_list) / sizeof(*arcfour_list), 122 | arcfour_list 123 | }; 124 | -------------------------------------------------------------------------------- /pe.old/SSHGSSC.H: -------------------------------------------------------------------------------- 1 | #ifndef PUTTY_SSHGSSC_H 2 | #define PUTTY_SSHGSSC_H 3 | #include "putty.h" 4 | #ifndef NO_GSSAPI 5 | 6 | #include "pgssapi.h" 7 | #include "sshgss.h" 8 | 9 | typedef struct gssapi_ssh_gss_ctx { 10 | OM_uint32 maj_stat; 11 | OM_uint32 min_stat; 12 | gss_ctx_id_t ctx; 13 | } gssapi_ssh_gss_ctx; 14 | 15 | void ssh_gssapi_bind_fns(struct ssh_gss_library *lib); 16 | 17 | #else 18 | 19 | int ssh_gssapi_init(void); 20 | 21 | #endif /*NO_GSSAPI*/ 22 | 23 | #endif /*PUTTY_SSHGSSC_H*/ 24 | -------------------------------------------------------------------------------- /pe.old/SSHNOGSS.C: -------------------------------------------------------------------------------- 1 | #include "putty.h" 2 | #ifndef NO_GSSAPI 3 | 4 | /* For platforms not supporting GSSAPI */ 5 | 6 | struct ssh_gss_liblist *ssh_gss_setup(const Config *cfg) 7 | { 8 | struct ssh_gss_liblist *list = snew(struct ssh_gss_liblist *); 9 | list->libraries = NULL; 10 | list->nlibraries = 0; 11 | return list; 12 | } 13 | 14 | void ssh_gss_cleanup(struct ssh_gss_liblist *list) 15 | { 16 | sfree(list); 17 | } 18 | 19 | #endif /* NO_GSSAPI */ 20 | -------------------------------------------------------------------------------- /pe.old/SSHRSAG.C: -------------------------------------------------------------------------------- 1 | /* 2 | * RSA key generation. 3 | */ 4 | 5 | #include "ssh.h" 6 | 7 | #define RSA_EXPONENT 37 /* we like this prime */ 8 | 9 | int rsa_generate(struct RSAKey *key, int bits, progfn_t pfn, 10 | void *pfnparam) 11 | { 12 | Bignum pm1, qm1, phi_n; 13 | 14 | /* 15 | * Set up the phase limits for the progress report. We do this 16 | * by passing minus the phase number. 17 | * 18 | * For prime generation: our initial filter finds things 19 | * coprime to everything below 2^16. Computing the product of 20 | * (p-1)/p for all prime p below 2^16 gives about 20.33; so 21 | * among B-bit integers, one in every 20.33 will get through 22 | * the initial filter to be a candidate prime. 23 | * 24 | * Meanwhile, we are searching for primes in the region of 2^B; 25 | * since pi(x) ~ x/log(x), when x is in the region of 2^B, the 26 | * prime density will be d/dx pi(x) ~ 1/log(B), i.e. about 27 | * 1/0.6931B. So the chance of any given candidate being prime 28 | * is 20.33/0.6931B, which is roughly 29.34 divided by B. 29 | * 30 | * So now we have this probability P, we're looking at an 31 | * exponential distribution with parameter P: we will manage in 32 | * one attempt with probability P, in two with probability 33 | * P(1-P), in three with probability P(1-P)^2, etc. The 34 | * probability that we have still not managed to find a prime 35 | * after N attempts is (1-P)^N. 36 | * 37 | * We therefore inform the progress indicator of the number B 38 | * (29.34/B), so that it knows how much to increment by each 39 | * time. We do this in 16-bit fixed point, so 29.34 becomes 40 | * 0x1D.57C4. 41 | */ 42 | pfn(pfnparam, PROGFN_PHASE_EXTENT, 1, 0x10000); 43 | pfn(pfnparam, PROGFN_EXP_PHASE, 1, -0x1D57C4 / (bits / 2)); 44 | pfn(pfnparam, PROGFN_PHASE_EXTENT, 2, 0x10000); 45 | pfn(pfnparam, PROGFN_EXP_PHASE, 2, -0x1D57C4 / (bits - bits / 2)); 46 | pfn(pfnparam, PROGFN_PHASE_EXTENT, 3, 0x4000); 47 | pfn(pfnparam, PROGFN_LIN_PHASE, 3, 5); 48 | pfn(pfnparam, PROGFN_READY, 0, 0); 49 | 50 | /* 51 | * We don't generate e; we just use a standard one always. 52 | */ 53 | key->exponent = bignum_from_long(RSA_EXPONENT); 54 | 55 | /* 56 | * Generate p and q: primes with combined length `bits', not 57 | * congruent to 1 modulo e. (Strictly speaking, we wanted (p-1) 58 | * and e to be coprime, and (q-1) and e to be coprime, but in 59 | * general that's slightly more fiddly to arrange. By choosing 60 | * a prime e, we can simplify the criterion.) 61 | */ 62 | key->p = primegen(bits / 2, RSA_EXPONENT, 1, NULL, 63 | 1, pfn, pfnparam); 64 | key->q = primegen(bits - bits / 2, RSA_EXPONENT, 1, NULL, 65 | 2, pfn, pfnparam); 66 | 67 | /* 68 | * Ensure p > q, by swapping them if not. 69 | */ 70 | if (bignum_cmp(key->p, key->q) < 0) { 71 | Bignum t = key->p; 72 | key->p = key->q; 73 | key->q = t; 74 | } 75 | 76 | /* 77 | * Now we have p, q and e. All we need to do now is work out 78 | * the other helpful quantities: n=pq, d=e^-1 mod (p-1)(q-1), 79 | * and (q^-1 mod p). 80 | */ 81 | pfn(pfnparam, PROGFN_PROGRESS, 3, 1); 82 | key->modulus = bigmul(key->p, key->q); 83 | pfn(pfnparam, PROGFN_PROGRESS, 3, 2); 84 | pm1 = copybn(key->p); 85 | decbn(pm1); 86 | qm1 = copybn(key->q); 87 | decbn(qm1); 88 | phi_n = bigmul(pm1, qm1); 89 | pfn(pfnparam, PROGFN_PROGRESS, 3, 3); 90 | freebn(pm1); 91 | freebn(qm1); 92 | key->private_exponent = modinv(key->exponent, phi_n); 93 | pfn(pfnparam, PROGFN_PROGRESS, 3, 4); 94 | key->iqmp = modinv(key->q, key->p); 95 | pfn(pfnparam, PROGFN_PROGRESS, 3, 5); 96 | 97 | /* 98 | * Clean up temporary numbers. 99 | */ 100 | freebn(phi_n); 101 | 102 | return 1; 103 | } 104 | -------------------------------------------------------------------------------- /pe.old/STORAGE.H: -------------------------------------------------------------------------------- 1 | /* 2 | * storage.h: interface defining functions for storage and recovery 3 | * of PuTTY's persistent data. 4 | */ 5 | 6 | #ifndef PUTTY_STORAGE_H 7 | #define PUTTY_STORAGE_H 8 | 9 | /* ---------------------------------------------------------------------- 10 | * Functions to save and restore PuTTY sessions. Note that this is 11 | * only the low-level code to do the reading and writing. The 12 | * higher-level code that translates a Config structure into a set 13 | * of (key,value) pairs is elsewhere, since it doesn't (mostly) 14 | * change between platforms. 15 | */ 16 | 17 | /* 18 | * Write a saved session. The caller is expected to call 19 | * open_setting_w() to get a `void *' handle, then pass that to a 20 | * number of calls to write_setting_s() and write_setting_i(), and 21 | * then close it using close_settings_w(). At the end of this call 22 | * sequence the settings should have been written to the PuTTY 23 | * persistent storage area. 24 | * 25 | * A given key will be written at most once while saving a session. 26 | * Keys may be up to 255 characters long. String values have no length 27 | * limit. 28 | * 29 | * Any returned error message must be freed after use. 30 | */ 31 | void *open_settings_w(const char *sessionname, char **errmsg); 32 | void write_setting_s(void *handle, const char *key, const char *value); 33 | void write_setting_i(void *handle, const char *key, int value); 34 | void write_setting_filename(void *handle, const char *key, Filename value); 35 | void write_setting_fontspec(void *handle, const char *key, FontSpec font); 36 | void close_settings_w(void *handle); 37 | 38 | /* 39 | * Read a saved session. The caller is expected to call 40 | * open_setting_r() to get a `void *' handle, then pass that to a 41 | * number of calls to read_setting_s() and read_setting_i(), and 42 | * then close it using close_settings_r(). 43 | * 44 | * read_setting_s() writes into the provided buffer and returns a 45 | * pointer to the same buffer. 46 | * 47 | * If a particular string setting is not present in the session, 48 | * read_setting_s() can return NULL, in which case the caller 49 | * should invent a sensible default. If an integer setting is not 50 | * present, read_setting_i() returns its provided default. 51 | * 52 | * read_setting_filename() and read_setting_fontspec() each read into 53 | * the provided buffer, and return zero if they failed to. 54 | */ 55 | void *open_settings_r(const char *sessionname); 56 | char *read_setting_s(void *handle, const char *key, char *buffer, int buflen); 57 | int read_setting_i(void *handle, const char *key, int defvalue); 58 | int read_setting_filename(void *handle, const char *key, Filename *value); 59 | int read_setting_fontspec(void *handle, const char *key, FontSpec *font); 60 | void close_settings_r(void *handle); 61 | 62 | /* 63 | * Delete a whole saved session. 64 | */ 65 | void del_settings(const char *sessionname); 66 | 67 | /* 68 | * Enumerate all saved sessions. 69 | */ 70 | void *enum_settings_start(void); 71 | char *enum_settings_next(void *handle, char *buffer, int buflen); 72 | void enum_settings_finish(void *handle); 73 | 74 | /* ---------------------------------------------------------------------- 75 | * Functions to access PuTTY's host key database. 76 | */ 77 | 78 | /* 79 | * See if a host key matches the database entry. Return values can 80 | * be 0 (entry matches database), 1 (entry is absent in database), 81 | * or 2 (entry exists in database and is different). 82 | */ 83 | int verify_host_key(const char *hostname, int port, 84 | const char *keytype, const char *key); 85 | 86 | /* 87 | * Write a host key into the database, overwriting any previous 88 | * entry that might have been there. 89 | */ 90 | void store_host_key(const char *hostname, int port, 91 | const char *keytype, const char *key); 92 | 93 | /* ---------------------------------------------------------------------- 94 | * Functions to access PuTTY's random number seed file. 95 | */ 96 | 97 | typedef void (*noise_consumer_t) (void *data, int len); 98 | 99 | /* 100 | * Read PuTTY's random seed file and pass its contents to a noise 101 | * consumer function. 102 | */ 103 | void read_random_seed(noise_consumer_t consumer); 104 | 105 | /* 106 | * Write PuTTY's random seed file from a given chunk of noise. 107 | */ 108 | void write_random_seed(void *data, int len); 109 | 110 | /* ---------------------------------------------------------------------- 111 | * Cleanup function: remove all of PuTTY's persistent state. 112 | */ 113 | void cleanup_all(void); 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /pe.old/TESTDATA/BIGNUM.PY: -------------------------------------------------------------------------------- 1 | # Generate test cases for a bignum implementation. 2 | 3 | import sys 4 | 5 | # integer square roots 6 | def sqrt(n): 7 | d = long(n) 8 | a = 0L 9 | # b must start off as a power of 4 at least as large as n 10 | ndigits = len(hex(long(n))) 11 | b = 1L << (ndigits*4) 12 | while 1: 13 | a = a >> 1 14 | di = 2*a + b 15 | if di <= d: 16 | d = d - di 17 | a = a + b 18 | b = b >> 2 19 | if b == 0: break 20 | return a 21 | 22 | # continued fraction convergents of a rational 23 | def confrac(n, d): 24 | coeffs = [(1,0),(0,1)] 25 | while d != 0: 26 | i = n / d 27 | n, d = d, n % d 28 | coeffs.append((coeffs[-2][0]-i*coeffs[-1][0], 29 | coeffs[-2][1]-i*coeffs[-1][1])) 30 | return coeffs 31 | 32 | def findprod(target, dir = +1, ratio=(1,1)): 33 | # Return two numbers whose product is as close as we can get to 34 | # 'target', with any deviation having the sign of 'dir', and in 35 | # the same approximate ratio as 'ratio'. 36 | 37 | r = sqrt(target * ratio[0] * ratio[1]) 38 | a = r / ratio[1] 39 | b = r / ratio[0] 40 | if a*b * dir < target * dir: 41 | a = a + 1 42 | b = b + 1 43 | assert a*b * dir >= target * dir 44 | 45 | best = (a,b,a*b) 46 | 47 | while 1: 48 | improved = 0 49 | a, b = best[:2] 50 | 51 | coeffs = confrac(a, b) 52 | for c in coeffs: 53 | # a*c[0]+b*c[1] is as close as we can get it to zero. So 54 | # if we replace a and b with a+c[1] and b+c[0], then that 55 | # will be added to our product, along with c[0]*c[1]. 56 | da, db = c[1], c[0] 57 | 58 | # Flip signs as appropriate. 59 | if (a+da) * (b+db) * dir < target * dir: 60 | da, db = -da, -db 61 | 62 | # Multiply up. We want to get as close as we can to a 63 | # solution of the quadratic equation in n 64 | # 65 | # (a + n da) (b + n db) = target 66 | # => n^2 da db + n (b da + a db) + (a b - target) = 0 67 | A,B,C = da*db, b*da+a*db, a*b-target 68 | discrim = B^2-4*A*C 69 | if discrim > 0 and A != 0: 70 | root = sqrt(discrim) 71 | vals = [] 72 | vals.append((-B + root) / (2*A)) 73 | vals.append((-B - root) / (2*A)) 74 | if root * root != discrim: 75 | root = root + 1 76 | vals.append((-B + root) / (2*A)) 77 | vals.append((-B - root) / (2*A)) 78 | 79 | for n in vals: 80 | ap = a + da*n 81 | bp = b + db*n 82 | pp = ap*bp 83 | if pp * dir >= target * dir and pp * dir < best[2]*dir: 84 | best = (ap, bp, pp) 85 | improved = 1 86 | 87 | if not improved: 88 | break 89 | 90 | return best 91 | 92 | def hexstr(n): 93 | s = hex(n) 94 | if s[:2] == "0x": s = s[2:] 95 | if s[-1:] == "L": s = s[:-1] 96 | return s 97 | 98 | # Tests of multiplication which exercise the propagation of the last 99 | # carry to the very top of the number. 100 | for i in range(1,4200): 101 | a, b, p = findprod((1< 8 | #include 9 | 10 | struct tm ltime(void) 11 | { 12 | time_t t; 13 | time(&t); 14 | assert (t != ((time_t)-1)); 15 | return *localtime(&t); 16 | } 17 | -------------------------------------------------------------------------------- /pe.old/UNIX/CONFIGUR.AC: -------------------------------------------------------------------------------- 1 | # To compile this into a configure script, you need: 2 | # * Autoconf 2.50 or newer 3 | # * Gtk (for $prefix/share/aclocal/gtk.m4) 4 | # * Automake (for aclocal) 5 | # If you've got them, running "autoreconf" should work. 6 | 7 | AC_INIT 8 | AC_CONFIG_FILES([Makefile]) 9 | AC_CONFIG_HEADERS([uxconfig.h:uxconfig.in]) 10 | 11 | AC_PROG_INSTALL 12 | AC_PROG_CC 13 | if test "X$GCC" = Xyes; then 14 | PUTTYCFLAGS="-Wall -Werror" 15 | else 16 | PUTTYCFLAGS="" 17 | fi 18 | AC_SUBST(PUTTYCFLAGS) 19 | 20 | AC_ARG_WITH([gssapi], 21 | [AS_HELP_STRING([--without-gssapi], 22 | [disable GSSAPI support])], 23 | [], 24 | [with_gssapi=yes]) 25 | 26 | WITH_GSSAPI= 27 | AS_IF([test "x$with_gssapi" != xno], 28 | [AC_DEFINE([WITH_GSSAPI], [1], [Define if building with GSSAPI support.])]) 29 | 30 | AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[ 31 | #include 32 | #include ]) 33 | 34 | # Look for both GTK 1 and GTK 2. 35 | AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none]) 36 | AM_PATH_GTK_2_0([2.0.0], [gtk=2], []) 37 | if test "$gtk" = "none"; then 38 | all_targets="all-cli" 39 | else 40 | all_targets="all-cli all-gtk" 41 | fi 42 | if test "$gtk" = "2"; then 43 | ac_save_CFLAGS="$CFLAGS" 44 | ac_save_LIBS="$LIBS" 45 | CFLAGS="$CFLAGS $GTK_CFLAGS" 46 | LIBS="$GTK_LIBS $LIBS" 47 | AC_CHECK_FUNCS([pango_font_family_is_monospace pango_font_map_list_families]) 48 | CFLAGS="$ac_save_CFLAGS" 49 | LIBS="$ac_save_LIBS" 50 | fi 51 | AC_SUBST([all_targets]) 52 | 53 | AC_SEARCH_LIBS([socket], [xnet]) 54 | 55 | AS_IF([test "x$with_gssapi" != xno], 56 | [AC_SEARCH_LIBS( 57 | [dlopen],[dl], 58 | [], 59 | [AC_DEFINE([NO_LIBDL], [1], [Define if we could not find libdl.]) 60 | AC_CHECK_HEADERS([gssapi/gssapi.h]) 61 | AC_SEARCH_LIBS( 62 | [gss_init_sec_context],[gssapi gssapi_krb5 gss], 63 | [], 64 | [AC_DEFINE([NO_GSSAPI_LIB], [1], [Define if we could not find a gssapi library])])])]) 65 | 66 | AC_CHECK_LIB(X11, XOpenDisplay) 67 | 68 | AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx]) 69 | 70 | AC_OUTPUT 71 | 72 | AH_BOTTOM([ 73 | /* Convert autoconf definitions to ones that PuTTY wants. */ 74 | 75 | #ifndef HAVE_GETADDRINFO 76 | # define NO_IPV6 77 | #endif 78 | #ifndef HAVE_SETRESUID 79 | # define HAVE_NO_SETRESUID 80 | #endif 81 | #ifndef HAVE_STRSIGNAL 82 | # define HAVE_NO_STRSIGNAL 83 | #endif 84 | #if !defined(HAVE_UTMPX_H) || !defined(HAVE_UPDWTMPX) 85 | # define OMIT_UTMP 86 | #endif 87 | #ifndef HAVE_PTSNAME 88 | # define BSD_PTYS 89 | #endif 90 | #ifndef HAVE_SYS_SELECT_H 91 | # define HAVE_NO_SYS_SELECT_H 92 | #endif 93 | #ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE 94 | # define PANGO_PRE_1POINT4 95 | #endif 96 | #ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES 97 | # define PANGO_PRE_1POINT6 98 | #endif 99 | #if !defined(WITH_GSSAPI) 100 | # define NO_GSSAPI 101 | #endif 102 | #if !defined(NO_GSSAPI) && defined(NO_LIBDL) 103 | # if !defined(HAVE_GSSAPI_GSSAPI_H) || defined(NO_GSSAPI_LIB) 104 | # define NO_GSSAPI 105 | # endif 106 | #endif 107 | ]) 108 | -------------------------------------------------------------------------------- /pe.old/UNIX/GTKCOLS.H: -------------------------------------------------------------------------------- 1 | /* 2 | * gtkcols.h - header file for a columns-based widget container 3 | * capable of supporting the PuTTY portable dialog box layout 4 | * mechanism. 5 | */ 6 | 7 | #ifndef COLUMNS_H 8 | #define COLUMNS_H 9 | 10 | #include 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif /* __cplusplus */ 16 | 17 | #define TYPE_COLUMNS (columns_get_type()) 18 | #define COLUMNS(obj) (GTK_CHECK_CAST((obj), TYPE_COLUMNS, Columns)) 19 | #define COLUMNS_CLASS(klass) \ 20 | (GTK_CHECK_CLASS_CAST((klass), TYPE_COLUMNS, ColumnsClass)) 21 | #define IS_COLUMNS(obj) (GTK_CHECK_TYPE((obj), TYPE_COLUMNS)) 22 | #define IS_COLUMNS_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), TYPE_COLUMNS)) 23 | 24 | typedef struct Columns_tag Columns; 25 | typedef struct ColumnsClass_tag ColumnsClass; 26 | typedef struct ColumnsChild_tag ColumnsChild; 27 | 28 | struct Columns_tag { 29 | GtkContainer container; 30 | /* private after here */ 31 | GList *children; /* this holds ColumnsChild structures */ 32 | GList *taborder; /* this just holds GtkWidgets */ 33 | gint spacing; 34 | }; 35 | 36 | struct ColumnsClass_tag { 37 | GtkContainerClass parent_class; 38 | }; 39 | 40 | struct ColumnsChild_tag { 41 | /* If `widget' is non-NULL, this entry represents an actual widget. */ 42 | GtkWidget *widget; 43 | gint colstart, colspan; 44 | gboolean force_left; /* for recalcitrant GtkLabels */ 45 | /* Otherwise, this entry represents a change in the column setup. */ 46 | gint ncols; 47 | gint *percentages; 48 | }; 49 | 50 | GtkType columns_get_type(void); 51 | GtkWidget *columns_new(gint spacing); 52 | void columns_set_cols(Columns *cols, gint ncols, const gint *percentages); 53 | void columns_add(Columns *cols, GtkWidget *child, 54 | gint colstart, gint colspan); 55 | void columns_taborder_last(Columns *cols, GtkWidget *child); 56 | void columns_force_left_align(Columns *cols, GtkWidget *child); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif /* __cplusplus */ 61 | 62 | #endif /* COLUMNS_H */ 63 | -------------------------------------------------------------------------------- /pe.old/UNIX/GTKFONT.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Header file for gtkfont.c. Has to be separate from unix.h 3 | * because it depends on GTK data types, hence can't be included 4 | * from cross-platform code (which doesn't go near GTK). 5 | */ 6 | 7 | #ifndef PUTTY_GTKFONT_H 8 | #define PUTTY_GTKFONT_H 9 | 10 | /* 11 | * Exports from gtkfont.c. 12 | */ 13 | struct unifont_vtable; /* contents internal to gtkfont.c */ 14 | typedef struct unifont { 15 | const struct unifont_vtable *vt; 16 | /* 17 | * `Non-static data members' of the `class', accessible to 18 | * external code. 19 | */ 20 | 21 | /* 22 | * public_charset is the charset used when the user asks for 23 | * `Use font encoding'. 24 | * 25 | * real_charset is the charset used when translating text into 26 | * a form suitable for sending to unifont_draw_text(). 27 | * 28 | * They can differ. For example, public_charset might be 29 | * CS_ISO8859_1 while real_charset is CS_ISO8859_1_X11. 30 | */ 31 | int public_charset, real_charset; 32 | 33 | /* 34 | * Font dimensions needed by clients. 35 | */ 36 | int width, height, ascent, descent; 37 | } unifont; 38 | 39 | unifont *unifont_create(GtkWidget *widget, const char *name, 40 | int wide, int bold, 41 | int shadowoffset, int shadowalways); 42 | void unifont_destroy(unifont *font); 43 | void unifont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font, 44 | int x, int y, const char *string, int len, 45 | int wide, int bold, int cellwidth); 46 | 47 | /* 48 | * Unified font selector dialog. I can't be bothered to do a 49 | * proper GTK subclassing today, so this will just be an ordinary 50 | * data structure with some useful members. 51 | * 52 | * (Of course, these aren't the only members; this structure is 53 | * contained within a bigger one which holds data visible only to 54 | * the implementation.) 55 | */ 56 | typedef struct unifontsel { 57 | void *user_data; /* settable by the user */ 58 | GtkWindow *window; 59 | GtkWidget *ok_button, *cancel_button; 60 | } unifontsel; 61 | 62 | unifontsel *unifontsel_new(const char *wintitle); 63 | void unifontsel_destroy(unifontsel *fontsel); 64 | void unifontsel_set_name(unifontsel *fontsel, const char *fontname); 65 | char *unifontsel_get_name(unifontsel *fontsel); 66 | 67 | #endif /* PUTTY_GTKFONT_H */ 68 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXAGENTC.C: -------------------------------------------------------------------------------- 1 | /* 2 | * SSH agent client code. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "putty.h" 14 | #include "misc.h" 15 | #include "tree234.h" 16 | #include "puttymem.h" 17 | 18 | int agent_exists(void) 19 | { 20 | if (getenv("SSH_AUTH_SOCK") != NULL) 21 | return TRUE; 22 | return FALSE; 23 | } 24 | 25 | static tree234 *agent_connections; 26 | struct agent_connection { 27 | int fd; 28 | char *retbuf; 29 | char sizebuf[4]; 30 | int retsize, retlen; 31 | void (*callback)(void *, void *, int); 32 | void *callback_ctx; 33 | }; 34 | static int agent_conncmp(void *av, void *bv) 35 | { 36 | struct agent_connection *a = (struct agent_connection *) av; 37 | struct agent_connection *b = (struct agent_connection *) bv; 38 | if (a->fd < b->fd) 39 | return -1; 40 | if (a->fd > b->fd) 41 | return +1; 42 | return 0; 43 | } 44 | static int agent_connfind(void *av, void *bv) 45 | { 46 | int afd = *(int *) av; 47 | struct agent_connection *b = (struct agent_connection *) bv; 48 | if (afd < b->fd) 49 | return -1; 50 | if (afd > b->fd) 51 | return +1; 52 | return 0; 53 | } 54 | 55 | static int agent_select_result(int fd, int event) 56 | { 57 | int ret; 58 | struct agent_connection *conn; 59 | 60 | assert(event == 1); /* not selecting for anything but R */ 61 | 62 | conn = find234(agent_connections, &fd, agent_connfind); 63 | if (!conn) { 64 | uxsel_del(fd); 65 | return 1; 66 | } 67 | 68 | ret = read(fd, conn->retbuf+conn->retlen, conn->retsize-conn->retlen); 69 | if (ret <= 0) { 70 | if (conn->retbuf != conn->sizebuf) sfree(conn->retbuf); 71 | conn->retbuf = NULL; 72 | conn->retlen = 0; 73 | goto done; 74 | } 75 | conn->retlen += ret; 76 | if (conn->retsize == 4 && conn->retlen == 4) { 77 | conn->retsize = GET_32BIT(conn->retbuf); 78 | if (conn->retsize <= 0) { 79 | conn->retbuf = NULL; 80 | conn->retlen = 0; 81 | goto done; 82 | } 83 | conn->retsize += 4; 84 | assert(conn->retbuf == conn->sizebuf); 85 | conn->retbuf = snewn(conn->retsize, char); 86 | memcpy(conn->retbuf, conn->sizebuf, 4); 87 | } 88 | 89 | if (conn->retlen < conn->retsize) 90 | return 0; /* more data to come */ 91 | 92 | done: 93 | /* 94 | * We have now completed the agent query. Do the callback, and 95 | * clean up. (Of course we don't free retbuf, since ownership 96 | * of that passes to the callback.) 97 | */ 98 | conn->callback(conn->callback_ctx, conn->retbuf, conn->retlen); 99 | uxsel_del(fd); 100 | close(fd); 101 | del234(agent_connections, conn); 102 | sfree(conn); 103 | return 0; 104 | } 105 | 106 | int agent_query(void *in, int inlen, void **out, int *outlen, 107 | void (*callback)(void *, void *, int), void *callback_ctx) 108 | { 109 | char *name; 110 | int sock; 111 | struct sockaddr_un addr; 112 | int done; 113 | struct agent_connection *conn; 114 | 115 | name = getenv("SSH_AUTH_SOCK"); 116 | if (!name) 117 | goto failure; 118 | 119 | sock = socket(PF_UNIX, SOCK_STREAM, 0); 120 | if (sock < 0) { 121 | perror("socket(PF_UNIX)"); 122 | exit(1); 123 | } 124 | 125 | cloexec(sock); 126 | 127 | addr.sun_family = AF_UNIX; 128 | strncpy(addr.sun_path, name, sizeof(addr.sun_path)); 129 | if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { 130 | close(sock); 131 | goto failure; 132 | } 133 | 134 | for (done = 0; done < inlen ;) { 135 | int ret = write(sock, (char *)in + done, inlen - done); 136 | if (ret <= 0) { 137 | close(sock); 138 | goto failure; 139 | } 140 | done += ret; 141 | } 142 | 143 | if (!agent_connections) 144 | agent_connections = newtree234(agent_conncmp); 145 | 146 | conn = snew(struct agent_connection); 147 | conn->fd = sock; 148 | conn->retbuf = conn->sizebuf; 149 | conn->retsize = 4; 150 | conn->retlen = 0; 151 | conn->callback = callback; 152 | conn->callback_ctx = callback_ctx; 153 | add234(agent_connections, conn); 154 | 155 | uxsel_set(sock, 1, agent_select_result); 156 | return 0; 157 | 158 | failure: 159 | *out = NULL; 160 | *outlen = 0; 161 | return 1; 162 | } 163 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXCFG.C: -------------------------------------------------------------------------------- 1 | /* 2 | * uxcfg.c - the Unix-specific parts of the PuTTY configuration 3 | * box. 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "putty.h" 10 | #include "dialog.h" 11 | #include "storage.h" 12 | 13 | void unix_setup_config_box(struct controlbox *b, int midsession, int protocol) 14 | { 15 | struct controlset *s; 16 | union control *c; 17 | 18 | /* 19 | * The Config structure contains two Unix-specific elements 20 | * which are not configured in here: stamp_utmp and 21 | * login_shell. This is because pterm does not put up a 22 | * configuration box right at the start, which is the only time 23 | * when these elements would be useful to configure. 24 | */ 25 | 26 | /* 27 | * On Unix, we don't have a drop-down list for the printer 28 | * control. 29 | */ 30 | s = ctrl_getset(b, "Terminal", "printing", "Remote-controlled printing"); 31 | assert(s->ncontrols == 1 && s->ctrls[0]->generic.type == CTRL_EDITBOX); 32 | s->ctrls[0]->editbox.has_list = 0; 33 | 34 | /* 35 | * Unix supports a local-command proxy. This also means we must 36 | * adjust the text on the `Telnet command' control. 37 | */ 38 | if (!midsession) { 39 | int i; 40 | s = ctrl_getset(b, "Connection/Proxy", "basics", NULL); 41 | for (i = 0; i < s->ncontrols; i++) { 42 | c = s->ctrls[i]; 43 | if (c->generic.type == CTRL_RADIO && 44 | c->generic.context.i == offsetof(Config, proxy_type)) { 45 | assert(c->generic.handler == dlg_stdradiobutton_handler); 46 | c->radio.nbuttons++; 47 | c->radio.buttons = 48 | sresize(c->radio.buttons, c->radio.nbuttons, char *); 49 | c->radio.buttons[c->radio.nbuttons-1] = 50 | dupstr("Local"); 51 | c->radio.buttondata = 52 | sresize(c->radio.buttondata, c->radio.nbuttons, intorptr); 53 | c->radio.buttondata[c->radio.nbuttons-1] = I(PROXY_CMD); 54 | break; 55 | } 56 | } 57 | 58 | for (i = 0; i < s->ncontrols; i++) { 59 | c = s->ctrls[i]; 60 | if (c->generic.type == CTRL_EDITBOX && 61 | c->generic.context.i == 62 | offsetof(Config, proxy_telnet_command)) { 63 | assert(c->generic.handler == dlg_stdeditbox_handler); 64 | sfree(c->generic.label); 65 | c->generic.label = dupstr("Telnet command, or local" 66 | " proxy command"); 67 | break; 68 | } 69 | } 70 | } 71 | 72 | /* 73 | * Serial back end is available on Unix. However, we have to 74 | * mask out a couple of the configuration options: mark and 75 | * space parity are not conveniently supported, and neither is 76 | * DSR/DTR flow control. 77 | */ 78 | if (!midsession || (protocol == PROT_SERIAL)) 79 | ser_setup_config_box(b, midsession, 0x07, 0x07); 80 | } 81 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXGEN.C: -------------------------------------------------------------------------------- 1 | /* 2 | * uxgen.c: Unix implementation of get_heavy_noise() from cmdgen.c. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "putty.h" 10 | 11 | char *get_random_data(int len) 12 | { 13 | char *buf = snewn(len, char); 14 | int fd; 15 | int ngot, ret; 16 | 17 | fd = open("/dev/random", O_RDONLY); 18 | if (fd < 0) { 19 | sfree(buf); 20 | perror("puttygen: unable to open /dev/random"); 21 | return NULL; 22 | } 23 | 24 | ngot = 0; 25 | while (ngot < len) { 26 | ret = read(fd, buf+ngot, len-ngot); 27 | if (ret < 0) { 28 | close(fd); 29 | perror("puttygen: unable to read /dev/random"); 30 | return NULL; 31 | } 32 | ngot += ret; 33 | } 34 | 35 | close(fd); 36 | 37 | return buf; 38 | } 39 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXMISC.C: -------------------------------------------------------------------------------- 1 | /* 2 | * PuTTY miscellaneous Unix stuff 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "putty.h" 15 | 16 | long tickcount_offset = 0; 17 | 18 | unsigned long getticks(void) 19 | { 20 | struct timeval tv; 21 | gettimeofday(&tv, NULL); 22 | /* 23 | * We want to use milliseconds rather than microseconds, 24 | * because we need a decent number of them to fit into a 32-bit 25 | * word so it can be used for keepalives. 26 | */ 27 | return tv.tv_sec * 1000 + tv.tv_usec / 1000 + tickcount_offset; 28 | } 29 | 30 | Filename filename_from_str(const char *str) 31 | { 32 | Filename ret; 33 | strncpy(ret.path, str, sizeof(ret.path)); 34 | ret.path[sizeof(ret.path)-1] = '\0'; 35 | return ret; 36 | } 37 | 38 | const char *filename_to_str(const Filename *fn) 39 | { 40 | return fn->path; 41 | } 42 | 43 | int filename_equal(Filename f1, Filename f2) 44 | { 45 | return !strcmp(f1.path, f2.path); 46 | } 47 | 48 | int filename_is_null(Filename fn) 49 | { 50 | return !*fn.path; 51 | } 52 | 53 | #ifdef DEBUG 54 | static FILE *debug_fp = NULL; 55 | 56 | void dputs(char *buf) 57 | { 58 | if (!debug_fp) { 59 | debug_fp = fopen("debug.log", "w"); 60 | } 61 | 62 | write(1, buf, strlen(buf)); 63 | 64 | fputs(buf, debug_fp); 65 | fflush(debug_fp); 66 | } 67 | #endif 68 | 69 | char *get_username(void) 70 | { 71 | struct passwd *p; 72 | uid_t uid = getuid(); 73 | char *user, *ret = NULL; 74 | 75 | /* 76 | * First, find who we think we are using getlogin. If this 77 | * agrees with our uid, we'll go along with it. This should 78 | * allow sharing of uids between several login names whilst 79 | * coping correctly with people who have su'ed. 80 | */ 81 | user = getlogin(); 82 | setpwent(); 83 | if (user) 84 | p = getpwnam(user); 85 | else 86 | p = NULL; 87 | if (p && p->pw_uid == uid) { 88 | /* 89 | * The result of getlogin() really does correspond to 90 | * our uid. Fine. 91 | */ 92 | ret = user; 93 | } else { 94 | /* 95 | * If that didn't work, for whatever reason, we'll do 96 | * the simpler version: look up our uid in the password 97 | * file and map it straight to a name. 98 | */ 99 | p = getpwuid(uid); 100 | if (!p) 101 | return NULL; 102 | ret = p->pw_name; 103 | } 104 | endpwent(); 105 | 106 | return dupstr(ret); 107 | } 108 | 109 | /* 110 | * Display the fingerprints of the PGP Master Keys to the user. 111 | * (This is here rather than in uxcons because it's appropriate even for 112 | * Unix GUI apps.) 113 | */ 114 | void pgp_fingerprints(void) 115 | { 116 | fputs("These are the fingerprints of the PuTTY PGP Master Keys. They can\n" 117 | "be used to establish a trust path from this executable to another\n" 118 | "one. See the manual for more information.\n" 119 | "(Note: these fingerprints have nothing to do with SSH!)\n" 120 | "\n" 121 | "PuTTY Master Key (RSA), 1024-bit:\n" 122 | " " PGP_RSA_MASTER_KEY_FP "\n" 123 | "PuTTY Master Key (DSA), 1024-bit:\n" 124 | " " PGP_DSA_MASTER_KEY_FP "\n", stdout); 125 | } 126 | 127 | /* 128 | * Set FD_CLOEXEC on a file descriptor 129 | */ 130 | int cloexec(int fd) { 131 | int fdflags; 132 | 133 | fdflags = fcntl(fd, F_GETFD); 134 | if (fdflags == -1) return -1; 135 | return fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC); 136 | } 137 | 138 | FILE *f_open(struct Filename filename, char const *mode, int is_private) 139 | { 140 | if (!is_private) { 141 | return fopen(filename.path, mode); 142 | } else { 143 | int fd; 144 | assert(mode[0] == 'w'); /* is_private is meaningless for read, 145 | and tricky for append */ 146 | fd = open(filename.path, O_WRONLY | O_CREAT | O_TRUNC, 147 | 0700); 148 | if (fd < 0) 149 | return NULL; 150 | return fdopen(fd, mode); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXNOISE.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Noise generation for PuTTY's cryptographic random number 3 | * generator. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "putty.h" 16 | #include "ssh.h" 17 | #include "storage.h" 18 | 19 | static int read_dev_urandom(char *buf, int len) 20 | { 21 | int fd; 22 | int ngot, ret; 23 | 24 | fd = open("/dev/urandom", O_RDONLY); 25 | if (fd < 0) 26 | return 0; 27 | 28 | ngot = 0; 29 | while (ngot < len) { 30 | ret = read(fd, buf+ngot, len-ngot); 31 | if (ret < 0) { 32 | close(fd); 33 | return 0; 34 | } 35 | ngot += ret; 36 | } 37 | 38 | close(fd); 39 | 40 | return 1; 41 | } 42 | 43 | /* 44 | * This function is called once, at PuTTY startup. It will do some 45 | * slightly silly things such as fetching an entire process listing 46 | * and scanning /tmp, load the saved random seed from disk, and 47 | * also read 32 bytes out of /dev/urandom. 48 | */ 49 | 50 | void noise_get_heavy(void (*func) (void *, int)) 51 | { 52 | char buf[512]; 53 | FILE *fp; 54 | int ret; 55 | int got_dev_urandom = 0; 56 | 57 | if (read_dev_urandom(buf, 32)) { 58 | got_dev_urandom = 1; 59 | func(buf, 32); 60 | } 61 | 62 | fp = popen("ps -axu 2>/dev/null", "r"); 63 | if (fp) { 64 | while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0) 65 | func(buf, ret); 66 | pclose(fp); 67 | } else if (!got_dev_urandom) { 68 | fprintf(stderr, "popen: %s\n" 69 | "Unable to access fallback entropy source\n", strerror(errno)); 70 | exit(1); 71 | } 72 | 73 | fp = popen("ls -al /tmp 2>/dev/null", "r"); 74 | if (fp) { 75 | while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0) 76 | func(buf, ret); 77 | pclose(fp); 78 | } else if (!got_dev_urandom) { 79 | fprintf(stderr, "popen: %s\n" 80 | "Unable to access fallback entropy source\n", strerror(errno)); 81 | exit(1); 82 | } 83 | 84 | read_random_seed(func); 85 | random_save_seed(); 86 | } 87 | 88 | void random_save_seed(void) 89 | { 90 | int len; 91 | void *data; 92 | 93 | if (random_active) { 94 | random_get_savedata(&data, &len); 95 | write_random_seed(data, len); 96 | sfree(data); 97 | } 98 | } 99 | 100 | /* 101 | * This function is called every time the random pool needs 102 | * stirring, and will acquire the system time. 103 | */ 104 | void noise_get_light(void (*func) (void *, int)) 105 | { 106 | struct timeval tv; 107 | gettimeofday(&tv, NULL); 108 | func(&tv, sizeof(tv)); 109 | } 110 | 111 | /* 112 | * This function is called on a timer, and grabs as much changeable 113 | * system data as it can quickly get its hands on. 114 | */ 115 | void noise_regular(void) 116 | { 117 | int fd; 118 | int ret; 119 | char buf[512]; 120 | struct rusage rusage; 121 | 122 | if ((fd = open("/proc/meminfo", O_RDONLY)) >= 0) { 123 | while ( (ret = read(fd, buf, sizeof(buf))) > 0) 124 | random_add_noise(buf, ret); 125 | close(fd); 126 | } 127 | if ((fd = open("/proc/stat", O_RDONLY)) >= 0) { 128 | while ( (ret = read(fd, buf, sizeof(buf))) > 0) 129 | random_add_noise(buf, ret); 130 | close(fd); 131 | } 132 | getrusage(RUSAGE_SELF, &rusage); 133 | random_add_noise(&rusage, sizeof(rusage)); 134 | } 135 | 136 | /* 137 | * This function is called on every keypress or mouse move, and 138 | * will add the current time to the noise pool. It gets the scan 139 | * code or mouse position passed in, and adds that too. 140 | */ 141 | void noise_ultralight(unsigned long data) 142 | { 143 | struct timeval tv; 144 | gettimeofday(&tv, NULL); 145 | random_add_noise(&tv, sizeof(tv)); 146 | random_add_noise(&data, sizeof(data)); 147 | } 148 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXPRINT.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Printing interface for PuTTY. 3 | */ 4 | 5 | #include 6 | #include 7 | #include "putty.h" 8 | 9 | struct printer_job_tag { 10 | FILE *fp; 11 | }; 12 | 13 | printer_job *printer_start_job(char *printer) 14 | { 15 | printer_job *ret = snew(printer_job); 16 | /* 17 | * On Unix, we treat the printer string as the name of a 18 | * command to pipe to - typically lpr, of course. 19 | */ 20 | ret->fp = popen(printer, "w"); 21 | if (!ret->fp) { 22 | sfree(ret); 23 | ret = NULL; 24 | } 25 | return ret; 26 | } 27 | 28 | void printer_job_data(printer_job *pj, void *data, int len) 29 | { 30 | if (!pj) 31 | return; 32 | 33 | if (fwrite(data, 1, len, pj->fp) < len) 34 | /* ignore */; 35 | } 36 | 37 | void printer_finish_job(printer_job *pj) 38 | { 39 | if (!pj) 40 | return; 41 | 42 | pclose(pj->fp); 43 | sfree(pj); 44 | } 45 | 46 | /* 47 | * There's no sensible way to enumerate printers under Unix, since 48 | * practically any valid Unix command is a valid printer :-) So 49 | * these are useless stub functions, and uxcfg.c will disable the 50 | * drop-down list in the printer configurer. 51 | */ 52 | printer_enum *printer_start_enum(int *nprinters_ptr) { 53 | *nprinters_ptr = 0; 54 | return NULL; 55 | } 56 | char *printer_get_name(printer_enum *pe, int i) { return NULL; 57 | } 58 | void printer_finish_enum(printer_enum *pe) { } 59 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXPTERM.C: -------------------------------------------------------------------------------- 1 | /* 2 | * pterm main program. 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | #include "putty.h" 9 | 10 | const char *const appname = "pterm"; 11 | const int use_event_log = 0; /* pterm doesn't need it */ 12 | const int new_session = 0, saved_sessions = 0; /* or these */ 13 | const int use_pty_argv = TRUE; 14 | 15 | Backend *select_backend(Config *cfg) 16 | { 17 | return &pty_backend; 18 | } 19 | 20 | int cfgbox(Config *cfg) 21 | { 22 | /* 23 | * This is a no-op in pterm, except that we'll ensure the 24 | * protocol is set to -1 to inhibit the useless Connection 25 | * panel in the config box. 26 | */ 27 | cfg->protocol = -1; 28 | return 1; 29 | } 30 | 31 | void cleanup_exit(int code) 32 | { 33 | exit(code); 34 | } 35 | 36 | int process_nonoption_arg(char *arg, Config *cfg, int *allow_launch) 37 | { 38 | return 0; /* pterm doesn't have any. */ 39 | } 40 | 41 | char *make_default_wintitle(char *hostname) 42 | { 43 | return dupstr("pterm"); 44 | } 45 | 46 | int main(int argc, char **argv) 47 | { 48 | extern int pt_main(int argc, char **argv); 49 | extern void pty_pre_init(void); /* declared in pty.c */ 50 | 51 | cmdline_tooltype = TOOLTYPE_NONNETWORK; 52 | default_protocol = -1; 53 | 54 | pty_pre_init(); 55 | 56 | return pt_main(argc, argv); 57 | } 58 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXPUTTY.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Unix PuTTY main program. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "putty.h" 13 | #include "storage.h" 14 | 15 | /* 16 | * Stubs to avoid uxpty.c needing to be linked in. 17 | */ 18 | const int use_pty_argv = FALSE; 19 | char **pty_argv; /* never used */ 20 | 21 | /* 22 | * Clean up and exit. 23 | */ 24 | void cleanup_exit(int code) 25 | { 26 | /* 27 | * Clean up. 28 | */ 29 | sk_cleanup(); 30 | random_save_seed(); 31 | exit(code); 32 | } 33 | 34 | Backend *select_backend(Config *cfg) 35 | { 36 | Backend *back = backend_from_proto(cfg->protocol); 37 | assert(back != NULL); 38 | return back; 39 | } 40 | 41 | int cfgbox(Config *cfg) 42 | { 43 | char *title = dupcat(appname, " Configuration", NULL); 44 | int ret = do_config_box(title, cfg, 0, 0); 45 | sfree(title); 46 | return ret; 47 | } 48 | 49 | static int got_host = 0; 50 | 51 | const int use_event_log = 1, new_session = 1, saved_sessions = 1; 52 | 53 | int process_nonoption_arg(char *arg, Config *cfg, int *allow_launch) 54 | { 55 | char *p, *q = arg; 56 | 57 | if (got_host) { 58 | /* 59 | * If we already have a host name, treat this argument as a 60 | * port number. NB we have to treat this as a saved -P 61 | * argument, so that it will be deferred until it's a good 62 | * moment to run it. 63 | */ 64 | int ret = cmdline_process_param("-P", arg, 1, cfg); 65 | assert(ret == 2); 66 | } else if (!strncmp(q, "telnet:", 7)) { 67 | /* 68 | * If the hostname starts with "telnet:", 69 | * set the protocol to Telnet and process 70 | * the string as a Telnet URL. 71 | */ 72 | char c; 73 | 74 | q += 7; 75 | if (q[0] == '/' && q[1] == '/') 76 | q += 2; 77 | cfg->protocol = PROT_TELNET; 78 | p = q; 79 | while (*p && *p != ':' && *p != '/') 80 | p++; 81 | c = *p; 82 | if (*p) 83 | *p++ = '\0'; 84 | if (c == ':') 85 | cfg->port = atoi(p); 86 | else 87 | cfg->port = -1; 88 | strncpy(cfg->host, q, sizeof(cfg->host) - 1); 89 | cfg->host[sizeof(cfg->host) - 1] = '\0'; 90 | got_host = 1; 91 | } else { 92 | /* 93 | * Otherwise, treat this argument as a host name. 94 | */ 95 | p = arg; 96 | while (*p && !isspace((unsigned char)*p)) 97 | p++; 98 | if (*p) 99 | *p++ = '\0'; 100 | strncpy(cfg->host, q, sizeof(cfg->host) - 1); 101 | cfg->host[sizeof(cfg->host) - 1] = '\0'; 102 | got_host = 1; 103 | } 104 | if (got_host) 105 | *allow_launch = TRUE; 106 | return 1; 107 | } 108 | 109 | char *make_default_wintitle(char *hostname) 110 | { 111 | return dupcat(hostname, " - ", appname, NULL); 112 | } 113 | 114 | /* 115 | * X11-forwarding-related things suitable for Gtk app. 116 | */ 117 | 118 | char *platform_get_x_display(void) { 119 | const char *display; 120 | /* Try to take account of --display and what have you. */ 121 | if (!(display = gdk_get_display())) 122 | /* fall back to traditional method */ 123 | display = getenv("DISPLAY"); 124 | return dupstr(display); 125 | } 126 | 127 | int main(int argc, char **argv) 128 | { 129 | extern int pt_main(int argc, char **argv); 130 | sk_init(); 131 | flags = FLAG_VERBOSE | FLAG_INTERACTIVE; 132 | default_protocol = be_default_protocol; 133 | /* Find the appropriate default port. */ 134 | { 135 | Backend *b = backend_from_proto(default_protocol); 136 | default_port = 0; /* illegal */ 137 | if (b) 138 | default_port = b->default_port; 139 | } 140 | return pt_main(argc, argv); 141 | } 142 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXSEL.C: -------------------------------------------------------------------------------- 1 | /* 2 | * uxsel.c 3 | * 4 | * This module is a sort of all-purpose interchange for file 5 | * descriptors. At one end it talks to uxnet.c and pty.c and 6 | * anything else which might have one or more fds that need 7 | * select()-type things doing to them during an extended program 8 | * run; at the other end it talks to pterm.c or uxplink.c or 9 | * anything else which might have its own means of actually doing 10 | * those select()-type things. 11 | */ 12 | 13 | #include 14 | 15 | #include "putty.h" 16 | #include "tree234.h" 17 | 18 | struct fd { 19 | int fd; 20 | int rwx; /* 4=except 2=write 1=read */ 21 | uxsel_callback_fn callback; 22 | int id; /* for uxsel_input_remove */ 23 | }; 24 | 25 | static tree234 *fds; 26 | 27 | static int uxsel_fd_cmp(void *av, void *bv) 28 | { 29 | struct fd *a = (struct fd *)av; 30 | struct fd *b = (struct fd *)bv; 31 | if (a->fd < b->fd) 32 | return -1; 33 | if (a->fd > b->fd) 34 | return +1; 35 | return 0; 36 | } 37 | static int uxsel_fd_findcmp(void *av, void *bv) 38 | { 39 | int *a = (int *)av; 40 | struct fd *b = (struct fd *)bv; 41 | if (*a < b->fd) 42 | return -1; 43 | if (*a > b->fd) 44 | return +1; 45 | return 0; 46 | } 47 | 48 | void uxsel_init(void) 49 | { 50 | fds = newtree234(uxsel_fd_cmp); 51 | } 52 | 53 | /* 54 | * Here is the interface to fd-supplying modules. They supply an 55 | * fd, a set of read/write/execute states, and a callback function 56 | * for when the fd satisfies one of those states. Repeated calls to 57 | * uxsel_set on the same fd are perfectly legal and serve to change 58 | * the rwx state (typically you only want to select an fd for 59 | * writing when you actually have pending data you want to write to 60 | * it!). 61 | */ 62 | 63 | void uxsel_set(int fd, int rwx, uxsel_callback_fn callback) 64 | { 65 | struct fd *newfd; 66 | 67 | uxsel_del(fd); 68 | 69 | if (rwx) { 70 | newfd = snew(struct fd); 71 | newfd->fd = fd; 72 | newfd->rwx = rwx; 73 | newfd->callback = callback; 74 | newfd->id = uxsel_input_add(fd, rwx); 75 | add234(fds, newfd); 76 | } 77 | } 78 | 79 | void uxsel_del(int fd) 80 | { 81 | struct fd *oldfd = find234(fds, &fd, uxsel_fd_findcmp); 82 | if (oldfd) { 83 | uxsel_input_remove(oldfd->id); 84 | del234(fds, oldfd); 85 | sfree(oldfd); 86 | } 87 | } 88 | 89 | /* 90 | * And here is the interface to select-functionality-supplying 91 | * modules. 92 | */ 93 | 94 | int next_fd(int *state, int *rwx) 95 | { 96 | struct fd *fd; 97 | fd = index234(fds, (*state)++); 98 | if (fd) { 99 | *rwx = fd->rwx; 100 | return fd->fd; 101 | } else 102 | return -1; 103 | } 104 | 105 | int first_fd(int *state, int *rwx) 106 | { 107 | *state = 0; 108 | return next_fd(state, rwx); 109 | } 110 | 111 | int select_result(int fd, int event) 112 | { 113 | struct fd *fdstruct = find234(fds, &fd, uxsel_fd_findcmp); 114 | /* 115 | * Apparently this can sometimes be NULL. Can't see how, but I 116 | * assume it means I need to ignore the event since it's on an 117 | * fd I've stopped being interested in. Sigh. 118 | */ 119 | if (fdstruct) 120 | return fdstruct->callback(fd, event); 121 | else 122 | return 1; 123 | } 124 | -------------------------------------------------------------------------------- /pe.old/UNIX/UXSIGNAL.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* 6 | * Calling signal() is non-portable, as it varies in meaning 7 | * between platforms and depending on feature macros, and has 8 | * stupid semantics at least some of the time. 9 | * 10 | * This function provides the same interface as the libc function, 11 | * but provides consistent semantics. It assumes POSIX semantics 12 | * for sigaction() (so you might need to do some more work if you 13 | * port to something ancient like SunOS 4) 14 | */ 15 | void (*putty_signal(int sig, void (*func)(int)))(int) { 16 | struct sigaction sa; 17 | struct sigaction old; 18 | 19 | sa.sa_handler = func; 20 | if(sigemptyset(&sa.sa_mask) < 0) 21 | return SIG_ERR; 22 | sa.sa_flags = SA_RESTART; 23 | if(sigaction(sig, &sa, &old) < 0) 24 | return SIG_ERR; 25 | return old.sa_handler; 26 | } 27 | 28 | void block_signal(int sig, int block_it) 29 | { 30 | sigset_t ss; 31 | 32 | sigemptyset(&ss); 33 | sigaddset(&ss, sig); 34 | if(sigprocmask(block_it ? SIG_BLOCK : SIG_UNBLOCK, &ss, 0) < 0) { 35 | perror("sigprocmask"); 36 | exit(1); 37 | } 38 | } 39 | 40 | /* 41 | Local Variables: 42 | c-basic-offset:4 43 | comment-column:40 44 | End: 45 | */ 46 | -------------------------------------------------------------------------------- /pe.old/UNIX/UX_X11.C: -------------------------------------------------------------------------------- 1 | /* 2 | * ux_x11.c: fetch local auth data for X forwarding. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "putty.h" 12 | #include "ssh.h" 13 | #include "network.h" 14 | 15 | void platform_get_x11_auth(struct X11Display *disp, const Config *cfg) 16 | { 17 | char *xauthfile; 18 | int needs_free; 19 | 20 | /* 21 | * Find the .Xauthority file. 22 | */ 23 | needs_free = FALSE; 24 | xauthfile = getenv("XAUTHORITY"); 25 | if (!xauthfile) { 26 | xauthfile = getenv("HOME"); 27 | if (xauthfile) { 28 | xauthfile = dupcat(xauthfile, "/.Xauthority", NULL); 29 | needs_free = TRUE; 30 | } 31 | } 32 | 33 | if (xauthfile) { 34 | x11_get_auth_from_authfile(disp, xauthfile); 35 | if (needs_free) 36 | sfree(xauthfile); 37 | } 38 | } 39 | 40 | const int platform_uses_x11_unix_by_default = TRUE; 41 | -------------------------------------------------------------------------------- /pe.old/VERSION.C: -------------------------------------------------------------------------------- 1 | /* 2 | * PuTTY version numbering 3 | */ 4 | 5 | #define STR1(x) #x 6 | #define STR(x) STR1(x) 7 | 8 | #if defined SNAPSHOT 9 | 10 | #if defined SVN_REV 11 | #define SNAPSHOT_TEXT STR(SNAPSHOT) ":r" STR(SVN_REV) 12 | #else 13 | #define SNAPSHOT_TEXT STR(SNAPSHOT) 14 | #endif 15 | 16 | char ver[] = "Development snapshot " SNAPSHOT_TEXT; 17 | char sshver[] = "PuTTY-Snapshot-" SNAPSHOT_TEXT; 18 | 19 | #undef SNAPSHOT_TEXT 20 | 21 | #elif defined RELEASE 22 | 23 | char ver[] = "Release " STR(RELEASE); 24 | char sshver[] = "PuTTY-Release-" STR(RELEASE); 25 | 26 | #elif defined SVN_REV 27 | 28 | char ver[] = "Custom build r" STR(SVN_REV) ", " __DATE__ " " __TIME__; 29 | char sshver[] = "PuTTY-Custom-r" STR(SVN_REV); 30 | 31 | #else 32 | 33 | char ver[] = "Unidentified build, " __DATE__ " " __TIME__; 34 | char sshver[] = "PuTTY-Local: " __DATE__ " " __TIME__; 35 | 36 | #endif 37 | 38 | /* 39 | * SSH local version string MUST be under 40 characters. Here's a 40 | * compile time assertion to verify this. 41 | */ 42 | enum { vorpal_sword = 1 / (sizeof(sshver) <= 40) }; 43 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PAGEANT/PAGEANT.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PLINK/PLINK.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PSCP/PSCP.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PSFTP/PSFTP.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PUTTY.DSW: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "pageant"=".\pageant\pageant.dsp" - Package Owner=<4> 7 | Project: "plink"=".\plink\plink.dsp" - Package Owner=<4> 8 | Project: "pscp"=".\pscp\pscp.dsp" - Package Owner=<4> 9 | Project: "psftp"=".\psftp\psftp.dsp" - Package Owner=<4> 10 | Project: "putty"=".\putty\putty.dsp" - Package Owner=<4> 11 | Project: "puttygen"=".\puttygen\puttygen.dsp" - Package Owner=<4> 12 | Project: "puttytel"=".\puttytel\puttytel.dsp" - Package Owner=<4> 13 | 14 | Package=<5> 15 | {{{ 16 | }}} 17 | 18 | Package=<4> 19 | {{{ 20 | }}} 21 | 22 | ############################################################################### 23 | 24 | Global: 25 | 26 | Package=<5> 27 | {{{ 28 | }}} 29 | 30 | Package=<3> 31 | {{{ 32 | }}} 33 | 34 | ############################################################################### 35 | 36 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PUTTY.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PAGEANT", "PAGEANT\PAGEANT.vcxproj", "{380DBDB8-6BC6-9228-A966-FCC6611327A6}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PLINK", "PLINK\PLINK.vcxproj", "{49A32F8F-2E46-CA8E-71EE-64C04776410D}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PSCP", "PSCP\PSCP.vcxproj", "{CF6B165C-69E2-86EE-6CD9-1C4C212A9426}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PSFTP", "PSFTP\PSFTP.vcxproj", "{13AD505B-C203-CB16-159A-6DF8B2B59EAF}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PUTTY", "PUTTY\PUTTY.vcxproj", "{A7E7F50C-9842-651D-FA95-D16A3D2A0CDF}" 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PUTTYGEN", "PUTTYGEN\PUTTYGEN.vcxproj", "{D71C1025-E45F-B042-C337-5716201A861D}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PUTTYTEL", "PUTTYTEL\PUTTYTEL.vcxproj", "{4CBF7657-6FF5-7D75-32C9-3501F41ABEE4}" 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Win32 = Debug|Win32 21 | Release|Win32 = Release|Win32 22 | Template|Win32 = Template|Win32 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {380DBDB8-6BC6-9228-A966-FCC6611327A6}.Debug|Win32.ActiveCfg = Debug|Win32 26 | {380DBDB8-6BC6-9228-A966-FCC6611327A6}.Debug|Win32.Build.0 = Debug|Win32 27 | {380DBDB8-6BC6-9228-A966-FCC6611327A6}.Release|Win32.ActiveCfg = Release|Win32 28 | {380DBDB8-6BC6-9228-A966-FCC6611327A6}.Template|Win32.ActiveCfg = Release|Win32 29 | {380DBDB8-6BC6-9228-A966-FCC6611327A6}.Template|Win32.Build.0 = Release|Win32 30 | {49A32F8F-2E46-CA8E-71EE-64C04776410D}.Debug|Win32.ActiveCfg = Debug|Win32 31 | {49A32F8F-2E46-CA8E-71EE-64C04776410D}.Debug|Win32.Build.0 = Debug|Win32 32 | {49A32F8F-2E46-CA8E-71EE-64C04776410D}.Release|Win32.ActiveCfg = Release|Win32 33 | {49A32F8F-2E46-CA8E-71EE-64C04776410D}.Template|Win32.ActiveCfg = Template|Win32 34 | {49A32F8F-2E46-CA8E-71EE-64C04776410D}.Template|Win32.Build.0 = Template|Win32 35 | {CF6B165C-69E2-86EE-6CD9-1C4C212A9426}.Debug|Win32.ActiveCfg = Debug|Win32 36 | {CF6B165C-69E2-86EE-6CD9-1C4C212A9426}.Debug|Win32.Build.0 = Debug|Win32 37 | {CF6B165C-69E2-86EE-6CD9-1C4C212A9426}.Release|Win32.ActiveCfg = Release|Win32 38 | {CF6B165C-69E2-86EE-6CD9-1C4C212A9426}.Template|Win32.ActiveCfg = Template|Win32 39 | {CF6B165C-69E2-86EE-6CD9-1C4C212A9426}.Template|Win32.Build.0 = Template|Win32 40 | {13AD505B-C203-CB16-159A-6DF8B2B59EAF}.Debug|Win32.ActiveCfg = Debug|Win32 41 | {13AD505B-C203-CB16-159A-6DF8B2B59EAF}.Debug|Win32.Build.0 = Debug|Win32 42 | {13AD505B-C203-CB16-159A-6DF8B2B59EAF}.Release|Win32.ActiveCfg = Release|Win32 43 | {13AD505B-C203-CB16-159A-6DF8B2B59EAF}.Template|Win32.ActiveCfg = Template|Win32 44 | {13AD505B-C203-CB16-159A-6DF8B2B59EAF}.Template|Win32.Build.0 = Template|Win32 45 | {A7E7F50C-9842-651D-FA95-D16A3D2A0CDF}.Debug|Win32.ActiveCfg = Debug|Win32 46 | {A7E7F50C-9842-651D-FA95-D16A3D2A0CDF}.Debug|Win32.Build.0 = Debug|Win32 47 | {A7E7F50C-9842-651D-FA95-D16A3D2A0CDF}.Release|Win32.ActiveCfg = Release|Win32 48 | {A7E7F50C-9842-651D-FA95-D16A3D2A0CDF}.Release|Win32.Build.0 = Release|Win32 49 | {A7E7F50C-9842-651D-FA95-D16A3D2A0CDF}.Template|Win32.ActiveCfg = Template|Win32 50 | {A7E7F50C-9842-651D-FA95-D16A3D2A0CDF}.Template|Win32.Build.0 = Template|Win32 51 | {D71C1025-E45F-B042-C337-5716201A861D}.Debug|Win32.ActiveCfg = Debug|Win32 52 | {D71C1025-E45F-B042-C337-5716201A861D}.Debug|Win32.Build.0 = Debug|Win32 53 | {D71C1025-E45F-B042-C337-5716201A861D}.Release|Win32.ActiveCfg = Release|Win32 54 | {D71C1025-E45F-B042-C337-5716201A861D}.Template|Win32.ActiveCfg = Template|Win32 55 | {D71C1025-E45F-B042-C337-5716201A861D}.Template|Win32.Build.0 = Template|Win32 56 | {4CBF7657-6FF5-7D75-32C9-3501F41ABEE4}.Debug|Win32.ActiveCfg = Debug|Win32 57 | {4CBF7657-6FF5-7D75-32C9-3501F41ABEE4}.Debug|Win32.Build.0 = Debug|Win32 58 | {4CBF7657-6FF5-7D75-32C9-3501F41ABEE4}.Release|Win32.ActiveCfg = Release|Win32 59 | {4CBF7657-6FF5-7D75-32C9-3501F41ABEE4}.Template|Win32.ActiveCfg = Template|Win32 60 | {4CBF7657-6FF5-7D75-32C9-3501F41ABEE4}.Template|Win32.Build.0 = Template|Win32 61 | EndGlobalSection 62 | GlobalSection(SolutionProperties) = preSolution 63 | HideSolutionNode = FALSE 64 | EndGlobalSection 65 | EndGlobal 66 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PUTTY/PUTTY.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PUTTYGEN/PUTTYGEN.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/MSVC/PUTTYTEL/PUTTYTEL.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PAGEANT.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/PAGEANT.ICO -------------------------------------------------------------------------------- /pe.old/WINDOWS/PAGEANT.MFT: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | PuTTY SSH authentication agent 12 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | 28 | true 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PAGEANT.RC: -------------------------------------------------------------------------------- 1 | /* 2 | * Windows resources for Pageant. 3 | */ 4 | 5 | #include "rcstuff.h" 6 | 7 | #define APPNAME "Pageant" 8 | #define APPDESC "PuTTY SSH authentication agent" 9 | 10 | 200 ICON "pageant.ico" 11 | 201 ICON "pageants.ico" 12 | 13 | 210 DIALOG DISCARDABLE 0, 0, 140, 60 14 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 15 | CAPTION "Pageant: Enter Passphrase" 16 | FONT 8, "MS Shell Dlg" 17 | BEGIN 18 | CTEXT "Enter passphrase for key", 100, 10, 6, 120, 8 19 | CTEXT "", 101, 10, 16, 120, 8 20 | EDITTEXT 102, 10, 26, 120, 12, ES_PASSWORD | ES_AUTOHSCROLL 21 | DEFPUSHBUTTON "O&K", IDOK, 20, 42, 40, 14 22 | PUSHBUTTON "&Cancel", IDCANCEL, 80, 42, 40, 14 23 | END 24 | 25 | 211 DIALOG DISCARDABLE 0, 0, 330, 200 26 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 27 | CAPTION "Pageant Key List" 28 | FONT 8, "MS Shell Dlg" 29 | BEGIN 30 | LISTBOX 100, 10, 10, 310, 155, 31 | LBS_EXTENDEDSEL | LBS_HASSTRINGS | LBS_USETABSTOPS | WS_VSCROLL | WS_TABSTOP 32 | PUSHBUTTON "&Add Key", 101, 75, 162, 60, 14 33 | PUSHBUTTON "&Remove Key", 102, 195, 162, 60, 14 34 | PUSHBUTTON "&Help", 103, 10, 182, 50, 14 35 | DEFPUSHBUTTON "&Close", IDOK, 270, 182, 50, 14 36 | END 37 | 38 | /* Accelerators used: cl */ 39 | 213 DIALOG DISCARDABLE 140, 40, 136, 70 40 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 41 | CAPTION "About Pageant" 42 | FONT 8, "MS Shell Dlg" 43 | BEGIN 44 | DEFPUSHBUTTON "&Close", IDOK, 82, 52, 48, 14 45 | PUSHBUTTON "View &Licence", 101, 6, 52, 70, 14 46 | CTEXT "Pageant", 102, 10, 6, 120, 8 47 | CTEXT "", 100, 10, 16, 120, 16 48 | CTEXT "\251 1997-2011 Simon Tatham. All rights reserved.", 49 | 103, 10, 34, 120, 16 50 | END 51 | 52 | /* No accelerators used */ 53 | 214 DIALOG DISCARDABLE 50, 50, 226, 263 54 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 55 | CAPTION "PuTTY Licence" 56 | FONT 8, "MS Shell Dlg" 57 | BEGIN 58 | DEFPUSHBUTTON "OK", IDOK, 98, 243, 44, 14 59 | 60 | LTEXT "Copyright \251 1997-2011 Simon Tatham", 1000, 10, 10, 206, 8 61 | 62 | LTEXT "Portions copyright Robert de Bath, Joris van Rantwijk, Delian", 1001, 10, 26, 206, 8 63 | LTEXT "Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas", 1002, 10, 34, 206, 8 64 | LTEXT "Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa,", 1003, 10, 42, 206, 8 65 | LTEXT "Markus Kuhn, Colin Watson, and CORE SDI S.A.", 1004, 10, 50, 206, 8 66 | 67 | LTEXT "Permission is hereby granted, free of charge, to any person", 1005, 10, 66, 206, 8 68 | LTEXT "obtaining a copy of this software and associated documentation", 1006, 10, 74, 206, 8 69 | LTEXT "files (the ""Software""), to deal in the Software without restriction,", 1007, 10, 82, 206, 8 70 | LTEXT "including without limitation the rights to use, copy, modify, merge,", 1008, 10, 90, 206, 8 71 | LTEXT "publish, distribute, sublicense, and/or sell copies of the Software,", 1009, 10, 98, 206, 8 72 | LTEXT "and to permit persons to whom the Software is furnished to do so,", 1010, 10, 106, 206, 8 73 | LTEXT "subject to the following conditions:", 1011, 10, 114, 206, 8 74 | 75 | LTEXT "The above copyright notice and this permission notice shall be", 1012, 10, 130, 206, 8 76 | LTEXT "included in all copies or substantial portions of the Software.", 1013, 10, 138, 206, 8 77 | 78 | LTEXT "THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT", 1014, 10, 154, 206, 8 79 | LTEXT "WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,", 1015, 10, 162, 206, 8 80 | LTEXT "INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF", 1016, 10, 170, 206, 8 81 | LTEXT "MERCHANTABILITY, FITNESS FOR A PARTICULAR", 1017, 10, 178, 206, 8 82 | LTEXT "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", 1018, 10, 186, 206, 8 83 | LTEXT "COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES", 1019, 10, 194, 206, 8 84 | LTEXT "OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,", 1020, 10, 202, 206, 8 85 | LTEXT "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN", 1021, 10, 210, 206, 8 86 | LTEXT "CONNECTION WITH THE SOFTWARE OR THE USE OR", 1022, 10, 218, 206, 8 87 | LTEXT "OTHER DEALINGS IN THE SOFTWARE.", 1023, 10, 226, 206, 8 88 | 89 | END 90 | 91 | #include "version.rc2" 92 | 93 | #ifndef NO_MANIFESTS 94 | 1 RT_MANIFEST "pageant.mft" 95 | #endif /* NO_MANIFESTS */ 96 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PAGEANTS.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/PAGEANTS.ICO -------------------------------------------------------------------------------- /pe.old/WINDOWS/PLINK.RC: -------------------------------------------------------------------------------- 1 | #include "rcstuff.h" 2 | 3 | #define APPNAME "Plink" 4 | #define APPDESC "Command-line SSH, Telnet, and Rlogin client" 5 | 6 | 200 ICON "putty.ico" 7 | 8 | #include "version.rc2" 9 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PSCP.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/PSCP.ICO -------------------------------------------------------------------------------- /pe.old/WINDOWS/PSCP.RC: -------------------------------------------------------------------------------- 1 | #include "rcstuff.h" 2 | 3 | #define APPNAME "PSCP" 4 | #define APPDESC "Command-line SCP/SFTP client" 5 | 6 | 200 ICON "pscp.ico" 7 | 8 | #include "version.rc2" 9 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PSFTP.RC: -------------------------------------------------------------------------------- 1 | #include "rcstuff.h" 2 | 3 | #define APPNAME "PSFTP" 4 | #define APPDESC "Command-line interactive SFTP client" 5 | 6 | 200 ICON "pscp.ico" 7 | 8 | #include "version.rc2" 9 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTY-BACKUP.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/PUTTY-BACKUP.ICO -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTY.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/PUTTY.ICO -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTY.MFT: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | A network client and terminal emulator 12 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | 28 | true 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTY.RC: -------------------------------------------------------------------------------- 1 | #include "rcstuff.h" 2 | 3 | #define APPNAME "blank" 4 | #define APPDESC "about:blank" 5 | 6 | #include "win_res.rc2" 7 | 8 | #ifndef NO_MANIFESTS 9 | 1 RT_MANIFEST "putty.mft" 10 | #endif /* NO_MANIFESTS */ 11 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTYCFG.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/PUTTYCFG.ICO -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTYGEN.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/PUTTYGEN.ICO -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTYGEN.MFT: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | SSH key generator for PuTTY 12 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | 28 | true 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTYGEN.RC: -------------------------------------------------------------------------------- 1 | /* 2 | * Windows resources for PuTTYgen. 3 | */ 4 | 5 | #include "rcstuff.h" 6 | 7 | #define APPNAME "PuTTYgen" 8 | #define APPDESC "PuTTY SSH key generation utility" 9 | 10 | 200 ICON "puttygen.ico" 11 | 12 | 201 DIALOG DISCARDABLE 0, 0, 318, 270 13 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 14 | CAPTION "PuTTY Key Generator" 15 | FONT 8, "MS Shell Dlg" 16 | BEGIN 17 | END 18 | 19 | 210 DIALOG DISCARDABLE 0, 0, 140, 60 20 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 21 | CAPTION "PuTTYgen: Enter Passphrase" 22 | FONT 8, "MS Shell Dlg" 23 | BEGIN 24 | CTEXT "Enter passphrase for key", 100, 10, 6, 120, 8 25 | CTEXT "", 101, 10, 16, 120, 8 26 | EDITTEXT 102, 10, 26, 120, 12, ES_PASSWORD | ES_AUTOHSCROLL 27 | DEFPUSHBUTTON "O&K", IDOK, 20, 42, 40, 14 28 | PUSHBUTTON "&Cancel", IDCANCEL, 80, 42, 40, 14 29 | END 30 | 31 | /* Accelerators used: cl */ 32 | 213 DIALOG DISCARDABLE 140, 40, 136, 70 33 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 34 | CAPTION "About PuTTYgen" 35 | FONT 8, "MS Shell Dlg" 36 | BEGIN 37 | DEFPUSHBUTTON "&Close", IDOK, 82, 52, 48, 14 38 | PUSHBUTTON "View &Licence", 101, 6, 52, 70, 14 39 | CTEXT "PuTTYgen", 102, 10, 6, 120, 8 40 | CTEXT "", 100, 10, 16, 120, 16 41 | CTEXT "\251 1997-2011 Simon Tatham. All rights reserved.", 42 | 103, 10, 34, 120, 16 43 | END 44 | 45 | /* No accelerators used */ 46 | 214 DIALOG DISCARDABLE 50, 50, 226, 263 47 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 48 | CAPTION "PuTTY Licence" 49 | FONT 8, "MS Shell Dlg" 50 | BEGIN 51 | DEFPUSHBUTTON "OK", IDOK, 98, 243, 44, 14 52 | 53 | LTEXT "Copyright \251 1997-2011 Simon Tatham", 1000, 10, 10, 206, 8 54 | 55 | LTEXT "Portions copyright Robert de Bath, Joris van Rantwijk, Delian", 1001, 10, 26, 206, 8 56 | LTEXT "Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas", 1002, 10, 34, 206, 8 57 | LTEXT "Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa,", 1003, 10, 42, 206, 8 58 | LTEXT "Markus Kuhn, Colin Watson, and CORE SDI S.A.", 1004, 10, 50, 206, 8 59 | 60 | LTEXT "Permission is hereby granted, free of charge, to any person", 1005, 10, 66, 206, 8 61 | LTEXT "obtaining a copy of this software and associated documentation", 1006, 10, 74, 206, 8 62 | LTEXT "files (the ""Software""), to deal in the Software without restriction,", 1007, 10, 82, 206, 8 63 | LTEXT "including without limitation the rights to use, copy, modify, merge,", 1008, 10, 90, 206, 8 64 | LTEXT "publish, distribute, sublicense, and/or sell copies of the Software,", 1009, 10, 98, 206, 8 65 | LTEXT "and to permit persons to whom the Software is furnished to do so,", 1010, 10, 106, 206, 8 66 | LTEXT "subject to the following conditions:", 1011, 10, 114, 206, 8 67 | 68 | LTEXT "The above copyright notice and this permission notice shall be", 1012, 10, 130, 206, 8 69 | LTEXT "included in all copies or substantial portions of the Software.", 1013, 10, 138, 206, 8 70 | 71 | LTEXT "THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT", 1014, 10, 154, 206, 8 72 | LTEXT "WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,", 1015, 10, 162, 206, 8 73 | LTEXT "INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF", 1016, 10, 170, 206, 8 74 | LTEXT "MERCHANTABILITY, FITNESS FOR A PARTICULAR", 1017, 10, 178, 206, 8 75 | LTEXT "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", 1018, 10, 186, 206, 8 76 | LTEXT "COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES", 1019, 10, 194, 206, 8 77 | LTEXT "OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,", 1020, 10, 202, 206, 8 78 | LTEXT "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN", 1021, 10, 210, 206, 8 79 | LTEXT "CONNECTION WITH THE SOFTWARE OR THE USE OR", 1022, 10, 218, 206, 8 80 | LTEXT "OTHER DEALINGS IN THE SOFTWARE.", 1023, 10, 226, 206, 8 81 | 82 | END 83 | 84 | #include "version.rc2" 85 | 86 | #ifndef NO_MANIFESTS 87 | 1 RT_MANIFEST "puttygen.mft" 88 | #endif /* NO_MANIFESTS */ 89 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTYINS.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/PUTTYINS.ICO -------------------------------------------------------------------------------- /pe.old/WINDOWS/PUTTYTEL.RC: -------------------------------------------------------------------------------- 1 | #include "rcstuff.h" 2 | 3 | #define APPNAME "PuTTYtel" 4 | #define APPDESC "Telnet and Rlogin client" 5 | 6 | #include "win_res.rc2" 7 | 8 | #ifndef NO_MANIFESTS 9 | /* FIXME */ 10 | 1 RT_MANIFEST "putty.mft" 11 | #endif /* NO_MANIFESTS */ 12 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/RCSTUFF.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Miscellaneous stuff to include in all .rc files. 3 | */ 4 | 5 | #ifndef PUTTY_RCSTUFF_H 6 | #define PUTTY_RCSTUFF_H 7 | 8 | #ifdef __LCC__ 9 | #include 10 | #else 11 | 12 | /* Some compilers, like Borland, don't have winresrc.h */ 13 | #ifndef NO_WINRESRC_H 14 | #ifndef MSVC4 15 | #include 16 | #else 17 | #include 18 | #endif 19 | #endif 20 | 21 | #endif /* end #ifdef __LCC__ */ 22 | 23 | /* Some systems don't define this, so I do it myself if necessary */ 24 | #ifndef TCS_MULTILINE 25 | #define TCS_MULTILINE 0x0200 26 | #endif 27 | 28 | /* Likewise */ 29 | #ifndef RT_MANIFEST 30 | #define RT_MANIFEST 24 31 | #endif 32 | 33 | /* LCC is the offender here. */ 34 | #ifndef VS_FF_DEBUG 35 | #define VS_FF_DEBUG 1 36 | #endif 37 | #ifndef VS_FF_PRERELEASE 38 | #define VS_FF_PRERELEASE 2 39 | #endif 40 | #ifndef VS_FF_PRIVATEBUILD 41 | #define VS_FF_PRIVATEBUILD 8 42 | #endif 43 | #ifndef VOS__WINDOWS32 44 | #define VOS__WINDOWS32 4 45 | #endif 46 | #ifndef VFT_APP 47 | #define VFT_APP 1 48 | #endif 49 | 50 | #endif /* PUTTY_RCSTUFF_H */ 51 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/README.TXT: -------------------------------------------------------------------------------- 1 | PuTTY README 2 | ============ 3 | 4 | This is the README file for the PuTTY installer distribution. If 5 | you're reading this, you've probably just run our installer and 6 | installed PuTTY on your system. 7 | 8 | What should I do next? 9 | ---------------------- 10 | 11 | If you want to use PuTTY to connect to other computers, or use PSFTP 12 | to transfer files, you should just be able to run them from the 13 | Start menu. 14 | 15 | If you want to use the command-line-only file transfer utility PSCP, 16 | you will probably want to put the PuTTY installation directory on 17 | your PATH. How you do this depends on your version of Windows. On 18 | Windows NT, 2000, and XP, you can set it using Control Panel > System; 19 | on Windows 95, 98, and Me, you will need to edit AUTOEXEC.BAT. Consult 20 | your Windows manuals for details. 21 | 22 | Some versions of Windows will refuse to run HTML Help files (.CHM) 23 | if they are installed on a network drive. If you have installed 24 | PuTTY on a network drive, you might want to check that the help file 25 | works properly. If not, see http://support.microsoft.com/kb/896054 26 | for information on how to solve this problem. 27 | 28 | What do I do if it doesn't work? 29 | -------------------------------- 30 | 31 | The PuTTY home web site is 32 | 33 | http://www.chiark.greenend.org.uk/~sgtatham/putty/ 34 | 35 | Here you will find our list of known bugs and pending feature 36 | requests. If your problem is not listed in there, or in the FAQ, or 37 | in the manuals, read the Feedback page to find out how to report 38 | bugs to us. PLEASE read the Feedback page carefully: it is there to 39 | save you time as well as us. Do not send us one-line bug reports 40 | telling us `it doesn't work'. 41 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/SIZETIP.C: -------------------------------------------------------------------------------- 1 | /* 2 | * sizetip.c - resize tips for PuTTY(tel) terminal window. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "putty.h" 10 | 11 | static ATOM tip_class = 0; 12 | 13 | static HFONT tip_font; 14 | static COLORREF tip_bg; 15 | static COLORREF tip_text; 16 | 17 | static LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg, 18 | WPARAM wParam, LPARAM lParam) 19 | { 20 | 21 | switch (nMsg) { 22 | case WM_ERASEBKGND: 23 | return TRUE; 24 | 25 | case WM_PAINT: 26 | { 27 | HBRUSH hbr; 28 | HGDIOBJ holdbr; 29 | RECT cr; 30 | int wtlen; 31 | LPTSTR wt; 32 | HDC hdc; 33 | 34 | PAINTSTRUCT ps; 35 | hdc = BeginPaint(hWnd, &ps); 36 | 37 | SelectObject(hdc, tip_font); 38 | SelectObject(hdc, GetStockObject(BLACK_PEN)); 39 | 40 | hbr = CreateSolidBrush(tip_bg); 41 | holdbr = SelectObject(hdc, hbr); 42 | 43 | GetClientRect(hWnd, &cr); 44 | Rectangle(hdc, cr.left, cr.top, cr.right, cr.bottom); 45 | 46 | wtlen = GetWindowTextLength(hWnd); 47 | wt = (LPTSTR) snewn(wtlen + 1, TCHAR); 48 | GetWindowText(hWnd, wt, wtlen + 1); 49 | 50 | SetTextColor(hdc, tip_text); 51 | SetBkColor(hdc, tip_bg); 52 | 53 | TextOut(hdc, cr.left + 3, cr.top + 3, wt, wtlen); 54 | 55 | sfree(wt); 56 | 57 | SelectObject(hdc, holdbr); 58 | DeleteObject(hbr); 59 | 60 | EndPaint(hWnd, &ps); 61 | } 62 | return 0; 63 | 64 | case WM_NCHITTEST: 65 | return HTTRANSPARENT; 66 | 67 | case WM_DESTROY: 68 | DeleteObject(tip_font); 69 | tip_font = NULL; 70 | break; 71 | 72 | case WM_SETTEXT: 73 | { 74 | LPCTSTR str = (LPCTSTR) lParam; 75 | SIZE sz; 76 | HDC hdc = CreateCompatibleDC(NULL); 77 | 78 | SelectObject(hdc, tip_font); 79 | GetTextExtentPoint32(hdc, str, _tcslen(str), &sz); 80 | 81 | SetWindowPos(hWnd, NULL, 0, 0, sz.cx + 6, sz.cy + 6, 82 | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); 83 | InvalidateRect(hWnd, NULL, FALSE); 84 | 85 | DeleteDC(hdc); 86 | } 87 | break; 88 | } 89 | 90 | return DefWindowProc(hWnd, nMsg, wParam, lParam); 91 | } 92 | 93 | static HWND tip_wnd = NULL; 94 | static int tip_enabled = 0; 95 | 96 | void UpdateSizeTip(HWND src, int cx, int cy) 97 | { 98 | TCHAR str[32]; 99 | 100 | if (!tip_enabled) 101 | return; 102 | 103 | if (!tip_wnd) { 104 | NONCLIENTMETRICS nci; 105 | 106 | /* First make sure the window class is registered */ 107 | 108 | if (!tip_class) { 109 | WNDCLASS wc; 110 | wc.style = CS_HREDRAW | CS_VREDRAW; 111 | wc.lpfnWndProc = SizeTipWndProc; 112 | wc.cbClsExtra = 0; 113 | wc.cbWndExtra = 0; 114 | wc.hInstance = hinst; 115 | wc.hIcon = NULL; 116 | wc.hCursor = NULL; 117 | wc.hbrBackground = NULL; 118 | wc.lpszMenuName = NULL; 119 | wc.lpszClassName = "SizeTipClass"; 120 | 121 | tip_class = RegisterClass(&wc); 122 | } 123 | #if 0 124 | /* Default values based on Windows Standard color scheme */ 125 | 126 | tip_font = GetStockObject(SYSTEM_FONT); 127 | tip_bg = RGB(255, 255, 225); 128 | tip_text = RGB(0, 0, 0); 129 | #endif 130 | 131 | /* Prepare other GDI objects and drawing info */ 132 | 133 | tip_bg = GetSysColor(COLOR_INFOBK); 134 | tip_text = GetSysColor(COLOR_INFOTEXT); 135 | 136 | memset(&nci, 0, sizeof(NONCLIENTMETRICS)); 137 | nci.cbSize = sizeof(NONCLIENTMETRICS); 138 | SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 139 | sizeof(NONCLIENTMETRICS), &nci, 0); 140 | tip_font = CreateFontIndirect(&nci.lfStatusFont); 141 | } 142 | 143 | /* Generate the tip text */ 144 | 145 | sprintf(str, "%dx%d", cx, cy); 146 | 147 | if (!tip_wnd) { 148 | HDC hdc; 149 | SIZE sz; 150 | RECT wr; 151 | int ix, iy; 152 | 153 | /* calculate the tip's size */ 154 | 155 | hdc = CreateCompatibleDC(NULL); 156 | GetTextExtentPoint32(hdc, str, _tcslen(str), &sz); 157 | DeleteDC(hdc); 158 | 159 | GetWindowRect(src, &wr); 160 | 161 | ix = wr.left; 162 | if (ix < 16) 163 | ix = 16; 164 | 165 | iy = wr.top - sz.cy; 166 | if (iy < 16) 167 | iy = 16; 168 | 169 | /* Create the tip window */ 170 | 171 | tip_wnd = 172 | CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, 173 | MAKEINTRESOURCE(tip_class), str, WS_POPUP, ix, 174 | iy, sz.cx, sz.cy, NULL, NULL, hinst, NULL); 175 | 176 | ShowWindow(tip_wnd, SW_SHOWNOACTIVATE); 177 | 178 | } else { 179 | 180 | /* Tip already exists, just set the text */ 181 | 182 | SetWindowText(tip_wnd, str); 183 | } 184 | } 185 | 186 | void EnableSizeTip(int bEnable) 187 | { 188 | if (tip_wnd && !bEnable) { 189 | DestroyWindow(tip_wnd); 190 | tip_wnd = NULL; 191 | } 192 | 193 | tip_enabled = bEnable; 194 | } 195 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/VERSION.RC2: -------------------------------------------------------------------------------- 1 | /* 2 | * Standard Windows version information. 3 | * (For inclusion in other .rc files with appropriate macro definitions.) 4 | * FIXME: This file is called '.rc2' rather than '.rc' to avoid MSVC trying 5 | * to compile it on its own when using the project files. Nicer solutions 6 | * welcome. 7 | */ 8 | 9 | /* 10 | * Binary versions in Windows are major.minor.build.revision. Each 11 | * component is 16-bit. 12 | * Here we have: 13 | * major.minor 14 | * PuTTY version number (e.g. 0.58). (We've made a policy decision 15 | * that these will be numeric from now on.) 16 | * Present in releases and snapshots (for the sake of monotonicity 17 | * in version numbers). 18 | * build 19 | * In releases, always 0. 20 | * In snapshots, nearest Subversion revision. (It shouldn't be 21 | * assumed that only one binary will have a given build number, of 22 | * course.) 23 | * revision 24 | * Reserved; always 0. 25 | * 26 | * Examples of these version numbers: 27 | * Release: 0.58.0.0 (but 0.58 didn't have a VERSIONINFO resource) 28 | * Snapshot: 0.58.6356.0 (between 0.58 and the next release) 29 | * Local: 0.0.0.0 30 | */ 31 | 32 | /* 33 | * Mechanics of version naming/numbering. 34 | * (This is a ripoff of ../version.c.) 35 | */ 36 | 37 | #define STR1(x) #x 38 | #define STR(x) STR1(x) 39 | 40 | /* We keep this around even for snapshots, for monotonicity of version 41 | * numbering. It needs to be kept up to date. NB _comma_-separated. */ 42 | #define BASE_VERSION 0,61 43 | 44 | #if defined SNAPSHOT 45 | 46 | /* Make SVN_REV mandatory for snapshots, to avoid issuing binary 47 | * version numbers that look like full releases. */ 48 | #ifndef SVN_REV 49 | #error SVN_REV not defined/nonzero for snapshot build 50 | #endif 51 | 52 | #define VERSION_TEXT "Development snapshot " STR(SNAPSHOT) ":r" STR(SVN_REV) 53 | #ifdef MODIFIED 54 | #define BINARY_VERSION 0,0,0,0 55 | #else 56 | #define BINARY_VERSION BASE_VERSION,SVN_REV,0 57 | #endif 58 | 59 | #elif defined RELEASE 60 | 61 | #define VERSION_TEXT "Release " STR(RELEASE) 62 | #define BINARY_VERSION BASE_VERSION,0,0 63 | 64 | #elif defined SVN_REV 65 | 66 | #define VERSION_TEXT "Custom build r" STR(SVN_REV) 67 | #ifdef MODIFIED 68 | #define BINARY_VERSION 0,0,0,0 69 | #else 70 | #define BINARY_VERSION BASE_VERSION,SVN_REV,0 71 | #endif 72 | 73 | #else 74 | 75 | /* We can't reliably get the same date and time as version.c, so 76 | * we won't bother trying. */ 77 | #define VERSION_TEXT "Unidentified build" 78 | #define BINARY_VERSION 0,0,0,0 79 | 80 | #endif 81 | 82 | /* 83 | * The actual VERSIONINFO resource. 84 | */ 85 | VS_VERSION_INFO VERSIONINFO 86 | /* (None of this "fixed" info appears to be trivially user-visible on 87 | * Win98SE. The binary version does show up on Win2K.) */ 88 | FILEVERSION BINARY_VERSION 89 | PRODUCTVERSION BINARY_VERSION /* version of whole suite */ 90 | FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE | VS_FF_PRIVATEBUILD 91 | FILEFLAGS 0x0L 92 | #if defined DEBUG 93 | | VS_FF_DEBUG 94 | #endif 95 | #if defined SNAPSHOT 96 | | VS_FF_PRERELEASE 97 | #elif !defined RELEASE 98 | | VS_FF_PRIVATEBUILD 99 | #endif 100 | FILEOS VOS__WINDOWS32 101 | FILETYPE VFT_APP 102 | FILESUBTYPE 0x0L /* n/a for VFT_APP */ 103 | BEGIN 104 | /* (On Win98SE and Win2K, we can see most of this on the Version tab 105 | * in the file properties in Explorer.) */ 106 | BLOCK "StringFileInfo" 107 | BEGIN 108 | /* "lang-charset" LLLLCCCC = (UK English, Unicode) */ 109 | BLOCK "080904B0" 110 | BEGIN 111 | VALUE "CompanyName", "about:blank" /* required :/ */ 112 | VALUE "ProductName", "about:blank" 113 | VALUE "FileDescription", APPDESC 114 | VALUE "InternalName", APPNAME 115 | VALUE "OriginalFilename", APPNAME 116 | VALUE "FileVersion", VERSION_TEXT 117 | VALUE "ProductVersion", VERSION_TEXT 118 | VALUE "LegalCopyright", "Copyright \251 1997-2011" 119 | #if (!defined SNAPSHOT) && (!defined RELEASE) 120 | /* Only if VS_FF_PRIVATEBUILD. */ 121 | VALUE "PrivateBuild", VERSION_TEXT /* NBI */ 122 | #endif 123 | END 124 | END 125 | BLOCK "VarFileInfo" 126 | BEGIN 127 | /* Once again -- same meanings -- apparently necessary */ 128 | VALUE "Translation", 0x809, 1200 129 | END 130 | END 131 | 132 | #undef VERSION_TEXT 133 | #undef BASE_VERSION 134 | #undef BINARY_VERSION 135 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WEBSITE.URL: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://www.chiark.greenend.org.uk/~sgtatham/putty/ 3 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WINDEFS.C: -------------------------------------------------------------------------------- 1 | /* 2 | * windefs.c: default settings that are specific to Windows. 3 | */ 4 | 5 | #include "putty.h" 6 | 7 | #include 8 | 9 | FontSpec platform_default_fontspec(const char *name) 10 | { 11 | FontSpec ret; 12 | if (!strcmp(name, "Font")) { 13 | strcpy(ret.name, "Courier New"); 14 | ret.isbold = 0; 15 | ret.charset = ANSI_CHARSET; 16 | ret.height = 10; 17 | } else { 18 | ret.name[0] = '\0'; 19 | } 20 | return ret; 21 | } 22 | 23 | Filename platform_default_filename(const char *name) 24 | { 25 | Filename ret; 26 | if (!strcmp(name, "LogFileName")) 27 | strcpy(ret.path, "putty.log"); 28 | else 29 | *ret.path = '\0'; 30 | return ret; 31 | } 32 | 33 | char *platform_default_s(const char *name) 34 | { 35 | if (!strcmp(name, "SerialLine")) 36 | return dupstr("COM1"); 37 | return NULL; 38 | } 39 | 40 | int platform_default_i(const char *name, int def) 41 | { 42 | return def; 43 | } 44 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WINHELP.C: -------------------------------------------------------------------------------- 1 | /* 2 | * winhelp.c: centralised functions to launch Windows help files, 3 | * and to decide whether to use .HLP or .CHM help in any given 4 | * situation. 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "putty.h" 13 | 14 | #ifndef NO_HTMLHELP 15 | #include 16 | #endif /* NO_HTMLHELP */ 17 | 18 | static int requested_help; 19 | static char *help_path; 20 | static int help_has_contents; 21 | #ifndef NO_HTMLHELP 22 | DECL_WINDOWS_FUNCTION(static, HWND, HtmlHelpA, (HWND, LPCSTR, UINT, DWORD)); 23 | static char *chm_path; 24 | #endif /* NO_HTMLHELP */ 25 | 26 | void init_help(void) 27 | { 28 | char b[2048], *p, *q, *r; 29 | FILE *fp; 30 | 31 | GetModuleFileName(NULL, b, sizeof(b) - 1); 32 | r = b; 33 | p = strrchr(b, '\\'); 34 | if (p && p >= r) r = p+1; 35 | q = strrchr(b, ':'); 36 | if (q && q >= r) r = q+1; 37 | strcpy(r, PUTTY_HELP_FILE); 38 | if ( (fp = fopen(b, "r")) != NULL) { 39 | help_path = dupstr(b); 40 | fclose(fp); 41 | } else 42 | help_path = NULL; 43 | strcpy(r, PUTTY_HELP_CONTENTS); 44 | if ( (fp = fopen(b, "r")) != NULL) { 45 | help_has_contents = TRUE; 46 | fclose(fp); 47 | } else 48 | help_has_contents = FALSE; 49 | 50 | #ifndef NO_HTMLHELP 51 | strcpy(r, PUTTY_CHM_FILE); 52 | if ( (fp = fopen(b, "r")) != NULL) { 53 | chm_path = dupstr(b); 54 | fclose(fp); 55 | } else 56 | chm_path = NULL; 57 | if (chm_path) { 58 | HINSTANCE dllHH = load_system32_dll("hhctrl.ocx"); 59 | GET_WINDOWS_FUNCTION(dllHH, HtmlHelpA); 60 | if (!p_HtmlHelpA) { 61 | chm_path = NULL; 62 | if (dllHH) 63 | FreeLibrary(dllHH); 64 | } 65 | } 66 | #endif /* NO_HTMLHELP */ 67 | } 68 | 69 | void shutdown_help(void) 70 | { 71 | /* Nothing to do currently. 72 | * (If we were running HTML Help single-threaded, this is where we'd 73 | * call HH_UNINITIALIZE.) */ 74 | } 75 | 76 | int has_help(void) 77 | { 78 | /* 79 | * FIXME: it would be nice here to disregard help_path on 80 | * platforms that didn't have WINHLP32. But that's probably 81 | * unrealistic, since even Vista will have it if the user 82 | * specifically downloads it. 83 | */ 84 | return (help_path 85 | #ifndef NO_HTMLHELP 86 | || chm_path 87 | #endif /* NO_HTMLHELP */ 88 | ); 89 | } 90 | 91 | void launch_help(HWND hwnd, const char *topic) 92 | { 93 | if (topic) { 94 | int colonpos = strcspn(topic, ":"); 95 | 96 | #ifndef NO_HTMLHELP 97 | if (chm_path) { 98 | char *fname; 99 | assert(topic[colonpos] != '\0'); 100 | fname = dupprintf("%s::/%s.html>main", chm_path, 101 | topic + colonpos + 1); 102 | p_HtmlHelpA(hwnd, fname, HH_DISPLAY_TOPIC, 0); 103 | sfree(fname); 104 | } else 105 | #endif /* NO_HTMLHELP */ 106 | if (help_path) { 107 | char *cmd = dupprintf("JI(`',`%.*s')", colonpos, topic); 108 | WinHelp(hwnd, help_path, HELP_COMMAND, (DWORD)cmd); 109 | sfree(cmd); 110 | } 111 | } else { 112 | #ifndef NO_HTMLHELP 113 | if (chm_path) { 114 | p_HtmlHelpA(hwnd, chm_path, HH_DISPLAY_TOPIC, 0); 115 | } else 116 | #endif /* NO_HTMLHELP */ 117 | if (help_path) { 118 | WinHelp(hwnd, help_path, 119 | help_has_contents ? HELP_FINDER : HELP_CONTENTS, 0); 120 | } 121 | } 122 | requested_help = TRUE; 123 | } 124 | 125 | void quit_help(HWND hwnd) 126 | { 127 | if (requested_help) { 128 | #ifndef NO_HTMLHELP 129 | if (chm_path) { 130 | p_HtmlHelpA(NULL, NULL, HH_CLOSE_ALL, 0); 131 | } else 132 | #endif /* NO_HTMLHELP */ 133 | if (help_path) { 134 | WinHelp(hwnd, help_path, HELP_QUIT, 0); 135 | } 136 | requested_help = FALSE; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WINNOISE.C: -------------------------------------------------------------------------------- 1 | /* 2 | * Noise generation for PuTTY's cryptographic random number 3 | * generator. 4 | */ 5 | 6 | #include 7 | 8 | #include "putty.h" 9 | #include "ssh.h" 10 | #include "storage.h" 11 | 12 | /* 13 | * This function is called once, at PuTTY startup, and will do some 14 | * seriously silly things like listing directories and getting disk 15 | * free space and a process snapshot. 16 | */ 17 | 18 | void noise_get_heavy(void (*func) (void *, int)) 19 | { 20 | HANDLE srch; 21 | WIN32_FIND_DATA finddata; 22 | DWORD pid; 23 | char winpath[MAX_PATH + 3]; 24 | 25 | GetWindowsDirectory(winpath, sizeof(winpath)); 26 | strcat(winpath, "\\*"); 27 | srch = FindFirstFile(winpath, &finddata); 28 | if (srch != INVALID_HANDLE_VALUE) { 29 | do { 30 | func(&finddata, sizeof(finddata)); 31 | } while (FindNextFile(srch, &finddata)); 32 | FindClose(srch); 33 | } 34 | 35 | pid = GetCurrentProcessId(); 36 | func(&pid, sizeof(pid)); 37 | 38 | read_random_seed(func); 39 | /* Update the seed immediately, in case another instance uses it. */ 40 | random_save_seed(); 41 | } 42 | 43 | void random_save_seed(void) 44 | { 45 | int len; 46 | void *data; 47 | 48 | if (random_active) { 49 | random_get_savedata(&data, &len); 50 | write_random_seed(data, len); 51 | sfree(data); 52 | } 53 | } 54 | 55 | /* 56 | * This function is called every time the random pool needs 57 | * stirring, and will acquire the system time in all available 58 | * forms. 59 | */ 60 | void noise_get_light(void (*func) (void *, int)) 61 | { 62 | SYSTEMTIME systime; 63 | DWORD adjust[2]; 64 | BOOL rubbish; 65 | 66 | GetSystemTime(&systime); 67 | func(&systime, sizeof(systime)); 68 | 69 | GetSystemTimeAdjustment(&adjust[0], &adjust[1], &rubbish); 70 | func(&adjust, sizeof(adjust)); 71 | } 72 | 73 | /* 74 | * This function is called on a timer, and it will monitor 75 | * frequently changing quantities such as the state of physical and 76 | * virtual memory, the state of the process's message queue, which 77 | * window is in the foreground, which owns the clipboard, etc. 78 | */ 79 | void noise_regular(void) 80 | { 81 | HWND w; 82 | DWORD z; 83 | POINT pt; 84 | MEMORYSTATUS memstat; 85 | FILETIME times[4]; 86 | 87 | w = GetForegroundWindow(); 88 | random_add_noise(&w, sizeof(w)); 89 | w = GetCapture(); 90 | random_add_noise(&w, sizeof(w)); 91 | w = GetClipboardOwner(); 92 | random_add_noise(&w, sizeof(w)); 93 | z = GetQueueStatus(QS_ALLEVENTS); 94 | random_add_noise(&z, sizeof(z)); 95 | 96 | GetCursorPos(&pt); 97 | random_add_noise(&pt, sizeof(pt)); 98 | 99 | GlobalMemoryStatus(&memstat); 100 | random_add_noise(&memstat, sizeof(memstat)); 101 | 102 | GetThreadTimes(GetCurrentThread(), times, times + 1, times + 2, 103 | times + 3); 104 | random_add_noise(×, sizeof(times)); 105 | GetProcessTimes(GetCurrentProcess(), times, times + 1, times + 2, 106 | times + 3); 107 | random_add_noise(×, sizeof(times)); 108 | } 109 | 110 | /* 111 | * This function is called on every keypress or mouse move, and 112 | * will add the current Windows time and performance monitor 113 | * counter to the noise pool. It gets the scan code or mouse 114 | * position passed in. 115 | */ 116 | void noise_ultralight(unsigned long data) 117 | { 118 | DWORD wintime; 119 | LARGE_INTEGER perftime; 120 | 121 | random_add_noise(&data, sizeof(DWORD)); 122 | 123 | wintime = GetTickCount(); 124 | random_add_noise(&wintime, sizeof(DWORD)); 125 | 126 | if (QueryPerformanceCounter(&perftime)) 127 | random_add_noise(&perftime, sizeof(perftime)); 128 | } 129 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WINNOJMP.C: -------------------------------------------------------------------------------- 1 | /* 2 | * winnojmp.c: stub jump list functions for Windows executables that 3 | * don't update the jump list. 4 | */ 5 | 6 | void add_session_to_jumplist(const char * const sessionname) {} 7 | void remove_session_from_jumplist(const char * const sessionname) {} 8 | void clear_jumplist(void) {} 9 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WINTIME.C: -------------------------------------------------------------------------------- 1 | /* 2 | * wintime.c - Avoid trouble with time() returning (time_t)-1 on Windows. 3 | */ 4 | 5 | #include "putty.h" 6 | #include 7 | 8 | struct tm ltime(void) 9 | { 10 | SYSTEMTIME st; 11 | struct tm tm; 12 | 13 | GetLocalTime(&st); 14 | tm.tm_sec=st.wSecond; 15 | tm.tm_min=st.wMinute; 16 | tm.tm_hour=st.wHour; 17 | tm.tm_mday=st.wDay; 18 | tm.tm_mon=st.wMonth-1; 19 | tm.tm_year=(st.wYear>=1900?st.wYear-1900:0); 20 | tm.tm_wday=st.wDayOfWeek; 21 | tm.tm_yday=-1; /* GetLocalTime doesn't tell us */ 22 | tm.tm_isdst=0; /* GetLocalTime doesn't tell us */ 23 | return tm; 24 | } 25 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WINX11.C: -------------------------------------------------------------------------------- 1 | /* 2 | * winx11.c: fetch local auth data for X forwarding. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "putty.h" 10 | #include "ssh.h" 11 | 12 | void platform_get_x11_auth(struct X11Display *disp, const Config *cfg) 13 | { 14 | if (cfg->xauthfile.path[0]) 15 | x11_get_auth_from_authfile(disp, cfg->xauthfile.path); 16 | } 17 | 18 | const int platform_uses_x11_unix_by_default = FALSE; 19 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WIN_RES.H: -------------------------------------------------------------------------------- 1 | /* 2 | * win_res.h - constants shared between win_res.rc2 and the C code. 3 | */ 4 | 5 | #ifndef PUTTY_WIN_RES_H 6 | #define PUTTY_WIN_RES_H 7 | 8 | #define IDI_MAINICON 200 9 | #define IDI_CFGICON 201 10 | 11 | #define IDD_MAINBOX 102 12 | #define IDD_LOGBOX 110 13 | #define IDD_ABOUTBOX 111 14 | #define IDD_RECONF 112 15 | #define IDD_LICENCEBOX 113 16 | 17 | #define IDN_LIST 1001 18 | #define IDN_COPY 1002 19 | 20 | #define IDA_ICON 1001 21 | #define IDA_TEXT1 1002 22 | #define IDA_VERSION 1003 23 | #define IDA_TEXT2 1004 24 | #define IDA_LICENCE 1005 25 | #define IDA_WEB 1006 26 | 27 | #define IDC_TAB 1001 28 | #define IDC_TABSTATIC1 1002 29 | #define IDC_TABSTATIC2 1003 30 | #define IDC_TABLIST 1004 31 | #define IDC_HELPBTN 1005 32 | #define IDC_ABOUT 1006 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/WIN_RES.RC2: -------------------------------------------------------------------------------- 1 | /* 2 | * Windows resources shared between PuTTY and PuTTYtel, to be #include'd 3 | * after defining appropriate macros. 4 | * Note that many of these strings mention PuTTY. Due to restrictions in 5 | * VC's handling of string concatenation, this can't easily be fixed. 6 | * It's fixed up at runtime. 7 | * FIXME: This file is called '.rc2' rather than '.rc' to avoid MSVC trying 8 | * to compile it on its own when using the project files. Nicer solutions 9 | * welcome. 10 | */ 11 | 12 | #include "win_res.h" 13 | 14 | IDI_MAINICON ICON "putty.ico" 15 | 16 | /* Accelerators used: clw */ 17 | IDD_ABOUTBOX DIALOG DISCARDABLE 140, 40, 214, 70 18 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 19 | CAPTION "About PuTTY" 20 | FONT 8, "MS Shell Dlg" 21 | BEGIN 22 | 23 | END 24 | 25 | /* Accelerators used: aco */ 26 | IDD_MAINBOX DIALOG DISCARDABLE 0, 0, 300, 252 27 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 28 | CAPTION "PuTTY Configuration" 29 | FONT 8, "MS Shell Dlg" 30 | CLASS "PuTTYConfigBox" 31 | BEGIN 32 | END 33 | 34 | /* Accelerators used: co */ 35 | IDD_LOGBOX DIALOG DISCARDABLE 100, 20, 300, 119 36 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 37 | CAPTION "PuTTY Event Log" 38 | FONT 8, "MS Shell Dlg" 39 | BEGIN 40 | 41 | END 42 | 43 | /* No accelerators used */ 44 | IDD_LICENCEBOX DIALOG DISCARDABLE 50, 50, 226, 263 45 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 46 | CAPTION "PuTTY Licence" 47 | FONT 8, "MS Shell Dlg" 48 | BEGIN 49 | 50 | END 51 | 52 | #include "version.rc2" 53 | -------------------------------------------------------------------------------- /pe.old/WINDOWS/putty.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe.old/WINDOWS/putty.aps -------------------------------------------------------------------------------- /pe/Default.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Default", "Default\Default.vcxproj", "{1D850E93-9FB9-422F-B111-CE45EC72E323}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {1D850E93-9FB9-422F-B111-CE45EC72E323}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {1D850E93-9FB9-422F-B111-CE45EC72E323}.Debug|Win32.Build.0 = Debug|Win32 14 | {1D850E93-9FB9-422F-B111-CE45EC72E323}.Release|Win32.ActiveCfg = Release|Win32 15 | {1D850E93-9FB9-422F-B111-CE45EC72E323}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /pe/Default/Default.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | -------------------------------------------------------------------------------- /pe/Default/Default.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe/Default/Default.ico -------------------------------------------------------------------------------- /pe/Default/Default.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe/Default/Default.rc -------------------------------------------------------------------------------- /pe/Default/Default.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {1D850E93-9FB9-422F-B111-CE45EC72E323} 15 | Win32Proj 16 | Default 17 | 18 | 19 | 20 | Application 21 | true 22 | Unicode 23 | 24 | 25 | Application 26 | false 27 | true 28 | Unicode 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | true 42 | 43 | 44 | false 45 | 46 | 47 | 48 | Use 49 | Level3 50 | Disabled 51 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) 52 | 53 | 54 | Windows 55 | true 56 | 57 | 58 | 59 | 60 | Level3 61 | Use 62 | MaxSpeed 63 | true 64 | true 65 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 66 | MultiThreaded 67 | 68 | 69 | Windows 70 | true 71 | true 72 | true 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | Create 90 | Create 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /pe/Default/Default.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | Resource Files 21 | 22 | 23 | Resource Files 24 | 25 | 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | 49 | 50 | Resource Files 51 | 52 | 53 | -------------------------------------------------------------------------------- /pe/Default/Default.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /pe/Default/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | WIN32 APPLICATION : Default Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this Default application for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your Default application. 9 | 10 | 11 | Default.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | Default.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | Default.cpp 25 | This is the main application source file. 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | AppWizard has created the following resources: 29 | 30 | Default.rc 31 | This is a listing of all of the Microsoft Windows resources that the 32 | program uses. It includes the icons, bitmaps, and cursors that are stored 33 | in the RES subdirectory. This file can be directly edited in Microsoft 34 | Visual C++. 35 | 36 | Resource.h 37 | This is the standard header file, which defines new resource IDs. 38 | Microsoft Visual C++ reads and updates this file. 39 | 40 | Default.ico 41 | This is an icon file, which is used as the application's icon (32x32). 42 | This icon is included by the main resource file Default.rc. 43 | 44 | small.ico 45 | This is an icon file, which contains a smaller version (16x16) 46 | of the application's icon. This icon is included by the main resource 47 | file Default.rc. 48 | 49 | ///////////////////////////////////////////////////////////////////////////// 50 | Other standard files: 51 | 52 | StdAfx.h, StdAfx.cpp 53 | These files are used to build a precompiled header (PCH) file 54 | named Default.pch and a precompiled types file named StdAfx.obj. 55 | 56 | ///////////////////////////////////////////////////////////////////////////// 57 | Other notes: 58 | 59 | AppWizard uses "TODO:" comments to indicate parts of the source code you 60 | should add to or customize. 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | -------------------------------------------------------------------------------- /pe/Default/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Default.rc 4 | // 5 | 6 | #define IDS_APP_TITLE 103 7 | 8 | #define IDR_MAINFRAME 128 9 | #define IDD_DEFAULT_DIALOG 102 10 | #define IDD_ABOUTBOX 103 11 | #define IDM_ABOUT 104 12 | #define IDM_EXIT 105 13 | #define IDI_DEFAULT 107 14 | #define IDI_SMALL 108 15 | #define IDC_DEFAULT 109 16 | #define IDC_MYICON 2 17 | #ifndef IDC_STATIC 18 | #define IDC_STATIC -1 19 | #endif 20 | // Next default values for new objects 21 | // 22 | #ifdef APSTUDIO_INVOKED 23 | #ifndef APSTUDIO_READONLY_SYMBOLS 24 | 25 | #define _APS_NO_MFC 130 26 | #define _APS_NEXT_RESOURCE_VALUE 129 27 | #define _APS_NEXT_COMMAND_VALUE 32771 28 | #define _APS_NEXT_CONTROL_VALUE 1000 29 | #define _APS_NEXT_SYMED_VALUE 110 30 | #endif 31 | #endif 32 | -------------------------------------------------------------------------------- /pe/Default/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackedteam/vector-default/57b273a08790c7e0cefdf68ea33f83bda5a95416/pe/Default/small.ico -------------------------------------------------------------------------------- /pe/Default/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Default.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /pe/Default/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | // C RunTime Header Files 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | 21 | // TODO: reference additional headers your program requires here 22 | -------------------------------------------------------------------------------- /pe/Default/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | --------------------------------------------------------------------------------