diff --git a/0.73_My_PuTTY/windows/MAKEFILE.MINGW b/0.73_My_PuTTY/windows/MAKEFILE.MINGW index 304fc27..b85aa85 100644 --- a/0.73_My_PuTTY/windows/MAKEFILE.MINGW +++ b/0.73_My_PuTTY/windows/MAKEFILE.MINGW @@ -97,6 +97,7 @@ # TOOLPATH = c:\cygwin\bin\ # or similar, if you're running Windows # TOOLPATH = /pkg/mingw32msvc/i386-mingw32msvc/bin/ # TOOLPATH = i686-w64-mingw32- +# make -e TOOLPATH=/usr/bin/i686-w64-mingw32- -f MAKEFILE.MINGW putty.exe CC = $(TOOLPATH)gcc RC = $(TOOLPATH)windres # Uncomment the following two lines to compile under Winelib @@ -107,8 +108,8 @@ RC = $(TOOLPATH)windres # CFLAGS = -Wall -O2 -std=gnu99 -Wvla -D_WINDOWS -DWIN32S_COMPAT \ -CFLAGS = -Wall -O2 -D_WINDOWS -DWIN32S_COMPAT \ - -D_NO_OLDNAMES -I.././ \ +CFLAGS = -Wall -O2 -std=gnu99 -Wvla -D_WINDOWS -DWIN32S_COMPAT \ + -D_NO_OLDNAMES -D__USE_MINGW_ANSI_STDIO=1 -I.././ \ -I../charset/ -I../windows/ -I../unix/ LDFLAGS = -s RCFLAGS = $(RCINC) --define WIN32=1 --define _WIN32=1 --define WINVER=0x0400 \ @@ -141,7 +142,8 @@ RCFLAGS += -I ../../ -DMOD_PERSO -D$(FDJFLAG) CFLAGS += -DAUTO_WINSOCK -DCOVERITY -DNO_MULTIMON -DNO_HTMLHELP CFLAGS += -D$(FDJFLAG) -CFLAGS += -DMOD_PERSO \ +CFLAGS += -I.././ -I../../ \ + -DMOD_PERSO \ -DMOD_STARTBUTTON \ -DMOD_SAVEDUMP \ -DMOD_DISABLEALTGR \ @@ -157,10 +159,11 @@ CFLAGS += -DMOD_PERSO \ -DMOD_RUTTY \ -DMOD_ADB \ -DMOD_BACKGROUNDIMAGE \ - -I.././ -I../../ \ -I../charset/ -I../windows/ -I../unix/ -I../mac/ \ -I../macosx \ - -I../../base64 -I../../bcrypt -I../../md5 -I../../regex -I../../url -I../../wincrypt -I../../rutty + -I../../base64 \ + -I../../bcrypt \ + -I../../md5 -I../../regex -I../../url -I../../wincrypt -I../../rutty # -DMOD_CYGTERM \ # -DUSE_CAPI -DMOD_WINCRYPT \ diff --git a/0.73_My_PuTTY/windows/window.c b/0.73_My_PuTTY/windows/window.c index f858c0e..519ab01 100644 --- a/0.73_My_PuTTY/windows/window.c +++ b/0.73_My_PuTTY/windows/window.c @@ -3255,17 +3255,17 @@ else if((UINT_PTR)wParam == TIMER_INIT) { // Initialisation char bufpass[1024]; strcpy(bufpass,conf_get_str(conf,CONF_password)) ; MASKPASS(bufpass); strcat(buffer,bufpass); memset(bufpass,0,strlen(bufpass)); strcat( buffer, "\\n" ) ; - } } + } if( strlen( conf_get_str(conf,CONF_autocommand) ) > 0 ) { strcat( buffer, "\\n\\p" ) ; strcat( buffer, conf_get_str(conf,CONF_autocommand) ) ; strcat( buffer, "\\n" ) ; - } + } if( strlen(buffer) > 0 ) { conf_set_str( conf, CONF_autocommand, buffer ); - } } + } // Envoi automatiquement dans le systeme tray si besoin if( GetAutoSendToTray() ) ManageToTray( hwnd ) ; @@ -3284,11 +3284,11 @@ else if((UINT_PTR)wParam == TIMER_INIT) { // Initialisation if( strlen( conf_get_str(conf,CONF_autocommand) ) > 0 ) { SetTimer(hwnd, TIMER_AUTOCOMMAND, autocommand_delay, NULL) ; - } + } if( conf_get_int(conf,CONF_logtimerotation) > 0 ) { SetTimer(hwnd, TIMER_LOGROTATION, (int)( conf_get_int(conf,CONF_logtimerotation)*1000), NULL) ; lp_eventlog(default_logpolicy, "Start log rotation" ); - } + } RefreshBackground( hwnd ) ; } @@ -3334,7 +3334,7 @@ else if((UINT_PTR)wParam == TIMER_AUTOCOMMAND) { // Autocommand au demarrage del( AutoCommand, 1, i ) ; //AutoCommand += i ; if( strlen( buffer ) > 0 ) { SendAutoCommand( hwnd, buffer ) ; } - if( AutoCommand[0] == '\0' ) { + if( AutoCommand[0] == '\0' ) { free( AutoCommand ) ; AutoCommand = NULL ; InvalidateRect( hwnd, NULL, true ) ; } @@ -3658,17 +3658,19 @@ else if((UINT_PTR)wParam == TIMER_LOGROTATION) { // log rotation SetNewIcon( hwnd, conf_get_filename(conf,CONF_iconefile)->path, 0, SI_INIT ) ; is_backend_connected = 0 ; start_backend(); - if( (!backend || !is_backend_connected) && GetAutoreconnectFlag() ) { + //if( (!backend || !is_backend_connected) && GetAutoreconnectFlag() ) { + if( (!backend) && GetAutoreconnectFlag() ) { if ( conf_get_int(conf,CONF_failure_reconnect) && is_backend_first_connected ) { SetTimer(hwnd, TIMER_RECONNECT, GetReconnectDelay()*1000, NULL) ; lp_eventlog(default_logpolicy, "Unable to connect, trying to reconnect...") ; - } - break; + } + break; } #else is_backend_connected = 0 ; start_backend(); #endif + is_backend_connected = 1 ; SetTimer(hwnd, TIMER_INIT, init_delay, NULL) ; #else start_backend(); diff --git a/bcrypt/nbcrypt.h b/bcrypt/nbcrypt.h new file mode 100644 index 0000000..d2933d9 --- /dev/null +++ b/bcrypt/nbcrypt.h @@ -0,0 +1,65 @@ + +#ifndef __BCRYPT +#define __BCRYPT + +#include +#include +#include +#include + +/* Cas de la construction de la DLL */ +#ifdef BUILD_DLL +#define LINKDLL extern "C" __declspec(dllexport) +#define LINKDLLCPP __declspec(dllexport) +#else +#define LINKDLL +#define LINKDLLCPP +#endif + +/* code retour +1 si tout va bien +0 en cas d'erreur +*/ + +LINKDLL void bcrypt_init( const long t ) ; + +LINKDLL int bcrypt_string( const char * st_in, char * st_out, const unsigned int length, const char * init_pattern, const char * key, const unsigned int maxlinesize ) ; +LINKDLL int buncrypt_string( const char * st_in, char * st_out, const unsigned int length + , const char * init_pattern, const char * key ) ; + +LINKDLL int bcrypt_string_printable( const char * st_in, char * st_out + , const unsigned int length, const char * key, const unsigned int maxlinesize ) ; +LINKDLL int buncrypt_string_printable( const char * st_in, char * st_out + , const unsigned int length, const char * key ) ; + +LINKDLL int bcrypt_string_base64( const char * st_in, char * st_out + , const unsigned int length, const char * key, const unsigned int maxlinesize ) ; +LINKDLL int buncrypt_string_base64( const char * st_in, char * st_out + , const unsigned int length, const char * key ) ; + +LINKDLL int bcrypt_string_auto( char * st, const unsigned int length + , const char * init_pattern, const char * key, const unsigned int maxlinesize ) ; +LINKDLL int buncrypt_string_auto( char * st, const unsigned int length + , const char * init_pattern, const char * key ) ; + +LINKDLL int bcrypt_file( const char * filename_in, const char * filename_out + , const char * init_pattern, const char * key, const int unsigned maxlinesize ) ; +LINKDLL int buncrypt_file( const char * filename_in, const char * filename_out + , const char * init_pattern, const char * key ) ; + +LINKDLL int bcrypt_file_printable( const char * filename_in, const char * filename_out + , const char * key, const unsigned int maxlinesize ) ; +LINKDLL int buncrypt_file_printable( const char * filename, const char * filename_out + , const char * key ) ; + +LINKDLL int bcrypt_file_base64( const char * filename_in, const char * filename_out + , const char * key, const unsigned int maxlinesize ) ; +LINKDLL int buncrypt_file_base64( const char * filename, const char * filename_out + , const char * key ) ; + +LINKDLL int bcrypt_file_auto( const char * filename + , const char * init_pattern, const char * key, const int unsigned maxlinesize ) ; +LINKDLL int buncrypt_file_auto( const char * filename + , const char * init_pattern, const char * key ) ; + +#endif diff --git a/kitty.c b/kitty.c index ba01d8a..341e454 100644 --- a/kitty.c +++ b/kitty.c @@ -11,17 +11,17 @@ #include #include -// Include specifiques Windows (windows.h doit imperativement etre declare en premier) -#include -#include -#include - // Includes de PuTTY #include "putty.h" #include "terminal.h" #include "ldisc.h" #include "win_res.h" +// Include specifiques Windows (windows.h doit imperativement etre declare en premier) +#include +#include +#include + // Includes de KiTTY #include "kitty.h" #include "kitty_commun.h" @@ -1234,39 +1234,34 @@ void CreateDefaultIniFile( void ) { writeINI( KittyIniFile, "Agent", "#messageonkeyusage", "no" ) ; writeINI( KittyIniFile, "Agent", "#askconfirmation", "auto" ) ; - writeINI( KittyIniFile, "ConfigBox", "height", "21" ) ; - writeINI( KittyIniFile, "ConfigBox", "filter", "yes" ) ; writeINI( KittyIniFile, "ConfigBox", "#default", "yes" ) ; writeINI( KittyIniFile, "ConfigBox", "#defaultsettings", "yes" ) ; + writeINI( KittyIniFile, "ConfigBox", "filter", "yes" ) ; + writeINI( KittyIniFile, "ConfigBox", "height", "21" ) ; writeINI( KittyIniFile, "ConfigBox", "#noexit", "no" ) ; writeINI( KittyIniFile, "ConfigBox", "#windowheight", "600" ) ; +#ifdef MOD_ADB + writeINI( KittyIniFile, INIT_SECTION, "#adb", "yes" ) ; +#endif + writeINI( KittyIniFile, INIT_SECTION, "#antiidle=", " \\k08\\" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#antiidledelay", "60" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#autostoresshkey", "no" ) ; #if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) writeINI( KittyIniFile, INIT_SECTION, "backgroundimage", "no" ) ; #endif + writeINI( KittyIniFile, INIT_SECTION, "#bcdelay", "0" ) ; writeINI( KittyIniFile, INIT_SECTION, "capslock", "no" ) ; writeINI( KittyIniFile, INIT_SECTION, "conf", "yes" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#configdir", "" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#CtHelperPath", "" ) ; #ifndef FDJ writeINI( KittyIniFile, INIT_SECTION, "cygterm", "no" ) ; #else writeINI( KittyIniFile, INIT_SECTION, "cygterm", "no" ) ; #endif - writeINI( KittyIniFile, INIT_SECTION, "icon", "no" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#iconfile", DEFAULT_EXE_FILE ) ; - sprintf( buffer, "%d", NB_ICONES ) ; - writeINI( KittyIniFile, INIT_SECTION, "#numberoficons", buffer ) ; - writeINI( KittyIniFile, INIT_SECTION, "paste", "no" ) ; - writeINI( KittyIniFile, INIT_SECTION, "print", "yes" ) ; - - writeINI( KittyIniFile, INIT_SECTION, "scriptfilefilter", "All files (*.*)|*.*" ) ; - writeINI( KittyIniFile, INIT_SECTION, "size", "no" ) ; -#ifdef FDJ - writeINI( KittyIniFile, INIT_SECTION, "shortcuts", "no" ) ; - writeINI( KittyIniFile, INIT_SECTION, "mouseshortcuts", "no" ) ; -#else - writeINI( KittyIniFile, INIT_SECTION, "shortcuts", "yes" ) ; - writeINI( KittyIniFile, INIT_SECTION, "mouseshortcuts", "yes" ) ; -#endif +// writeINI( KittyIniFile, INIT_SECTION, "debug", "#no" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#downloaddir", "" ) ; #ifdef MOD_HYPERLINK #ifdef FDJ writeINI( KittyIniFile, INIT_SECTION, "hyperlink", "yes" ) ; @@ -1274,6 +1269,31 @@ void CreateDefaultIniFile( void ) { writeINI( KittyIniFile, INIT_SECTION, "hyperlink", "no" ) ; #endif #endif + writeINI( KittyIniFile, INIT_SECTION, "icon", "no" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#iconfile", DEFAULT_EXE_FILE ) ; + writeINI( KittyIniFile, INIT_SECTION, "mouseshortcuts", "yes" ) ; + sprintf( buffer, "%d", NB_ICONES ) ; + writeINI( KittyIniFile, INIT_SECTION, "#numberoficons", buffer ) ; + writeINI( KittyIniFile, INIT_SECTION, "paste", "no" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#PlinkPath", "" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#PSCPPath", "" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#PSCPOptions", "-scp -r" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#remotedir", "" ) ; +#ifdef MOD_PORTABLE + writeINI( KittyIniFile, INIT_SECTION, "savemode", "dir" ) ; +#else + sprintf( buffer, "%s\\%s\\%s", getenv("APPDATA"), INIT_SECTION, DEFAULT_SAV_FILE ); + writeINI( KittyIniFile, INIT_SECTION, "sav", buffer ) ; + writeINI( KittyIniFile, INIT_SECTION, "savemode", "registry" ) ; +#endif + writeINI( KittyIniFile, INIT_SECTION, "#scriptfilefilter", "All files (*.*)|*.*" ) ; +#ifdef FDJ + writeINI( KittyIniFile, INIT_SECTION, "shortcuts", "no" ) ; +#else + writeINI( KittyIniFile, INIT_SECTION, "shortcuts", "yes" ) ; +#endif + writeINI( KittyIniFile, INIT_SECTION, "size", "no" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#sshversion", "OpenSSH_5.5" ) ; #ifndef MOD_NOTRANSPARENCY #ifdef FDJ writeINI( KittyIniFile, INIT_SECTION, "transparency", "yes" ) ; @@ -1281,21 +1301,19 @@ void CreateDefaultIniFile( void ) { writeINI( KittyIniFile, INIT_SECTION, "transparency", "no" ) ; #endif #endif - writeINI( KittyIniFile, INIT_SECTION, "#configdir", "" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#downloaddir", "" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#uploaddir", "" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#remotedir", "" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#PSCPPath", "" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#PSCPOptions", "-scp -r" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#PlinkPath", "" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#WinSCPPath", "" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#CtHelperPath", "" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#antiidle=", " \\k08\\" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#antiidledelay", "60" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#sshversion", "OpenSSH_5.5" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#WinSCPProtocol", "sftp" ) ; - writeINI( KittyIniFile, INIT_SECTION, "#autostoresshkey", "no" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#uploaddir", "." ) ; writeINI( KittyIniFile, INIT_SECTION, "#UserPassSSHNoSave", "no" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#WinSCPPath", "" ) ; + writeINI( KittyIniFile, INIT_SECTION, "#WinSCPProtocol", "sftp" ) ; +#ifdef MOD_ZMODEM + writeINI( KittyIniFile, INIT_SECTION, "zmodem", "yes" ) ; +#endif + + + + + + writeINI( KittyIniFile, INIT_SECTION, "#ctrltab", "yes" ) ; writeINI( KittyIniFile, INIT_SECTION, "#KiClassName", "PuTTY" ) ; writeINI( KittyIniFile, INIT_SECTION, "maxblinkingtime", "5" ) ; @@ -1306,18 +1324,7 @@ void CreateDefaultIniFile( void ) { #ifdef MOD_RUTTY writeINI( KittyIniFile, INIT_SECTION, "#scriptmode", "yes" ) ; #endif -#ifdef MOD_RUTTY - writeINI( KittyIniFile, INIT_SECTION, "#adb", "yes" ) ; -#endif -#ifdef MOD_PORTABLE - writeINI( KittyIniFile, INIT_SECTION, "savemode", "dir" ) ; -#else - sprintf( buffer, "%s\\%s\\%s", getenv("APPDATA"), INIT_SECTION, DEFAULT_SAV_FILE ); - writeINI( KittyIniFile, INIT_SECTION, "sav", buffer ) ; - writeINI( KittyIniFile, INIT_SECTION, "savemode", "registry" ) ; -#endif - writeINI( KittyIniFile, INIT_SECTION, "#bcdelay", "0" ) ; writeINI( KittyIniFile, INIT_SECTION, "#commanddelay", "0.05" ) ; writeINI( KittyIniFile, INIT_SECTION, "#initdelay", "2.0" ) ; writeINI( KittyIniFile, INIT_SECTION, "#internaldelay", "10" ) ; @@ -1325,9 +1332,6 @@ void CreateDefaultIniFile( void ) { writeINI( KittyIniFile, INIT_SECTION, "slidedelay", "0" ) ; writeINI( KittyIniFile, INIT_SECTION, "winroll", "yes" ) ; writeINI( KittyIniFile, INIT_SECTION, "wintitle", "yes" ) ; -#ifdef MOD_ZMODEM - writeINI( KittyIniFile, INIT_SECTION, "zmodem", "yes" ) ; -#endif writeINI( KittyIniFile, "Print", "height", "100" ) ; writeINI( KittyIniFile, "Print", "maxline", "60" ) ; writeINI( KittyIniFile, "Print", "maxchar", "85" ) ; @@ -1336,9 +1340,6 @@ void CreateDefaultIniFile( void ) { writeINI( KittyIniFile, "Launcher", "reload", "yes" ) ; - writeINI( KittyIniFile, "Print", "height", "100" ) ; - writeINI( KittyIniFile, "Print", "maxline", "60" ) ; - writeINI( KittyIniFile, "Print", "maxchar", "85" ) ; writeINI( KittyIniFile, "Shortcuts", "#switchlogmode", "{SHIFT}{F5}" ) ; writeINI( KittyIniFile, "Shortcuts", "#showportforward", "{SHIFT}{F6}" ) ; diff --git a/kitty.h b/kitty.h index a13d08b..6a169ea 100644 --- a/kitty.h +++ b/kitty.h @@ -277,7 +277,7 @@ void routine_SaveRegistryKey( void * st ) ; void SetNewIcon( HWND hwnd, char * iconefile, int icone, const int mode ) ; int WINAPI Notepad_WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow) ; void InitWinMain( void ) ; -char * getcwd (char * buf, size_t size); +char * getcwd (char * buf, int size); int chdir(const char *path); char * InputBox( HINSTANCE hInstance, HWND hwnd ) ; char *itoa(int value, char *string, int radix); diff --git a/kitty_commun.h b/kitty_commun.h index 5e47bbc..f8e3383 100644 --- a/kitty_commun.h +++ b/kitty_commun.h @@ -3,10 +3,10 @@ #include #include -#include +#include "putty.h" #include "winstuff.h" -#include "putty.h" +#include // Flag permettant d'activer l'acces a du code particulier permettant d'avoir plus d'info dans le kitty.dmp extern int debug_flag ; @@ -76,7 +76,7 @@ extern int is_backend_first_connected ; void SetSSHConnected( int flag ) ; -PVOID SecureZeroMemory( PVOID ptr, SIZE_T cnt) ; +//PVOID WINAPI SecureZeroMemory( PVOID ptr, SIZE_T cnt) ; // Fonction permettant de changer le statut du stockage automatique des ssh host keys void SetAutoStoreSSHKey( void ) ; diff --git a/kitty_crypt.h b/kitty_crypt.h index 5e8d570..af04a68 100644 --- a/kitty_crypt.h +++ b/kitty_crypt.h @@ -1,7 +1,7 @@ #ifndef KITTYCRYPT_H #define KITTYCRYPT_H -#include "bcrypt.h" +#include "nbcrypt.h" extern char PassKey[1024] ; diff --git a/kitty_win.h b/kitty_win.h index 8145313..5070a8f 100644 --- a/kitty_win.h +++ b/kitty_win.h @@ -3,8 +3,8 @@ #include #include -#include #include "putty.h" +#include void SetTransparency( HWND hwnd, int value ) ; void GetOSInfo( char * version ) ;