From ed7a22df87da2d615e0c414569cc3382a7b08fd1 Mon Sep 17 00:00:00 2001 From: cyd01 Date: Wed, 27 Nov 2019 09:35:22 +0100 Subject: [PATCH] Prepare for cross-compile --- 0.73_My_PuTTY/putty.h | 4 ++-- 0.73_My_PuTTY/windows/MAKEFILE.MINGW | 10 +++++++++- 0.73_My_PuTTY/windows/window.c | 7 ++----- 0.73_My_PuTTY/windows/winstuff.h | 5 +++++ kitty_commun.c | 2 +- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/0.73_My_PuTTY/putty.h b/0.73_My_PuTTY/putty.h index 3b8864a..63082a5 100644 --- a/0.73_My_PuTTY/putty.h +++ b/0.73_My_PuTTY/putty.h @@ -38,8 +38,8 @@ int switch_private_key_flag( void ) ; /* Ajout de declaration de DLL manquante dans MinGW*/ //DLL_DIRECTORY_COOKIE WINAPI AddDllDirectory( PCWSTR NewDirectory ); -BOOL WINAPI SetDefaultDllDirectories( DWORD DirectoryFlags ) ; -BOOL WINAPI CryptProtectMemory( LPVOID pData, DWORD cbData, DWORD dwFlags ); +BOOL WINAPI __declspec(dllimport) SetDefaultDllDirectories( DWORD DirectoryFlags ) ; +BOOL WINAPI __declspec(dllimport) CryptProtectMemory( LPVOID pData, DWORD cbData, DWORD dwFlags ); #endif #ifdef MOD_PRINTCLIP #define PRINT_TO_CLIPBOARD_STRING "Windows clipboard" diff --git a/0.73_My_PuTTY/windows/MAKEFILE.MINGW b/0.73_My_PuTTY/windows/MAKEFILE.MINGW index b85aa85..3ab1896 100644 --- a/0.73_My_PuTTY/windows/MAKEFILE.MINGW +++ b/0.73_My_PuTTY/windows/MAKEFILE.MINGW @@ -140,7 +140,7 @@ FDJFLAG = FDJ1 RCFLAGS += -I ../../ -DMOD_PERSO -D$(FDJFLAG) -CFLAGS += -DAUTO_WINSOCK -DCOVERITY -DNO_MULTIMON -DNO_HTMLHELP +CFLAGS += -DNO_SECUREZEROMEMORY -DCOVERITY -DNO_MULTIMON -DNO_HTMLHELP CFLAGS += -D$(FDJFLAG) CFLAGS += -I.././ -I../../ \ -DMOD_PERSO \ @@ -2131,6 +2131,14 @@ putty_portable.exe: agentf.o aqsync.o be_all_s.o be_misc.o callback.o cmdline.o clean: rm -f *.o *.exe *.res.o *.so *.map +cross: + sed -i 's#^typedef enum _WTS_VIRTUAL_CLASS #// typedef enum _WTS_VIRTUAL_CLASS #' window.c + make -e TOOLPATH=/usr/bin/i686-w64-mingw32- -f MAKEFILE.MINGW putty.exe + upx --best --compress-icons=2 --compress-exports=0 putty.exe + wine /usr/bin/MD5sign.exe putty.exe + mv putty.exe /build/kitty.exe + rm *.o + 9bis: putty.exe putty_portable.exe plink.exe pscp.exe psftp.exe pageant.exe puttygen.exe # AJOUTER diff --git a/0.73_My_PuTTY/windows/window.c b/0.73_My_PuTTY/windows/window.c index 519ab01..3a28dfc 100644 --- a/0.73_My_PuTTY/windows/window.c +++ b/0.73_My_PuTTY/windows/window.c @@ -259,7 +259,7 @@ void SendStrToTerminal( const char * str, const int len ) { for( i=0 ; i #endif #if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) diff --git a/0.73_My_PuTTY/windows/winstuff.h b/0.73_My_PuTTY/windows/winstuff.h index 7f28992..16be821 100644 --- a/0.73_My_PuTTY/windows/winstuff.h +++ b/0.73_My_PuTTY/windows/winstuff.h @@ -8,6 +8,11 @@ #ifndef AUTO_WINSOCK #include #endif + +#ifdef MOD_PERSO +#include +#endif + #include #include /* for FILENAME_MAX */ diff --git a/kitty_commun.c b/kitty_commun.c index 6227912..30e9dd8 100644 --- a/kitty_commun.c +++ b/kitty_commun.c @@ -279,7 +279,7 @@ void SetSSHConnected( int flag ) { } #endif -PVOID SecureZeroMemory( PVOID ptr, SIZE_T cnt) { return memset( ptr, 0, cnt ) ; } +//PVOID SecureZeroMemory( PVOID ptr, SIZE_T cnt) { return memset( ptr, 0, cnt ) ; } // Fonction permettant de changer le statut du stockage automatique des ssh host keys void SetAutoStoreSSHKey( void ) {