From 7c61931b96d3eb2e037a54df9a9003e2093a3fea Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Tue, 12 Apr 2011 09:53:52 +0000 Subject: [PATCH] Added notes on how to compile and get small shared libraries for UDF --- extra/udfhack/README.txt | 8 +++--- extra/udfhack/linux/README.txt | 25 ++++++++++++------- extra/udfhack/windows/README.txt | 43 +++++++++++++++++++------------- 3 files changed, 45 insertions(+), 31 deletions(-) diff --git a/extra/udfhack/README.txt b/extra/udfhack/README.txt index 155ce6510..e876f8a17 100644 --- a/extra/udfhack/README.txt +++ b/extra/udfhack/README.txt @@ -1,7 +1,7 @@ -Files in this folder can be used to compile shared objects that define -some user-defined functions for MySQL and PostgreSQL. They are licensed -under the terms of the GNU Lesser General Public License and their -compiled versions are available on the official sqlmap subversion +Files in this folder can be compiled as shared libraries. These define +some user-defined functions (UDF) for MySQL and PostgreSQL. They are +licensed under the terms of the GNU Lesser General Public License and +their compiled versions are available on the official sqlmap subversion repository[1]. [1] https://svn.sqlmap.org/sqlmap/trunk/sqlmap/udf/ diff --git a/extra/udfhack/linux/README.txt b/extra/udfhack/linux/README.txt index a15b58895..2edf5e57c 100644 --- a/extra/udfhack/linux/README.txt +++ b/extra/udfhack/linux/README.txt @@ -1,22 +1,29 @@ Before compiling, you need to adapt the following to your environment: -Variables in install.sh script: --------------------------------------------------------------------------- -Variable name Variable description --------------------------------------------------------------------------- +Variables in install.sh script: +-------------------------------------------------------------------------- +Variable name Variable description +-------------------------------------------------------------------------- USER Database management system administrative username PORT Database management system port VERSION Database management system version (PostgreSQL only) -Variable in Makefile (MySQL only): --------------------------------------------------------------------------- -Variable name Variable description --------------------------------------------------------------------------- +Variables in Makefile: +-------------------------------------------------------------------------- +Variable name Variable description +-------------------------------------------------------------------------- LIBDIR Database management system absolute file system - path for third party libraries + path for third party libraries (MySQL only) Then you can launch './install.sh' if you want to compile the shared object from the source code and create the user-defined functions on the database management system. If you only want to compile the shared object, you need to call only the 'make' command. + + +Notes: + +To get as small shared libraries as possible compile with GCC 4.3 on +both 32-bit and 64-bit architecture and strip the libraries with 'strip' +command. diff --git a/extra/udfhack/windows/README.txt b/extra/udfhack/windows/README.txt index c14e9406d..bf7472f04 100644 --- a/extra/udfhack/windows/README.txt +++ b/extra/udfhack/windows/README.txt @@ -4,22 +4,29 @@ PLATFORM_SDK_DIR and MYSQL_SERVER_DIR have to be set, while for project lib_postgresqludf_sys variables PLATFORM_SDK_DIR and POSTGRESQL_SERVER_DIR. -Variables: --------------------------------------------------------------------------- -Variable name Variable description --------------------------------------------------------------------------- -PLATFORM_SDK_DIR Directory where the Platform SDK is installed -MYSQL_SERVER_DIR Directory where the MySQL is installed -POSTGRESQL_SERVER_DIR Directory where the PostgreSQL is installed - -Procedure for setting environment variables: -My Computer -> Properties -> Advanced -> Environment Variables -User variables -> New - -Sample values: --------------------------------------------------------------------------- -Variable name Variable value --------------------------------------------------------------------------- -PLATFORM_SDK_DIR C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2 -MYSQL_SERVER_DIR C:\Program Files\MySQL\MySQL Server 5.1 +Variables: +-------------------------------------------------------------------------- +Variable name Variable description +-------------------------------------------------------------------------- +PLATFORM_SDK_DIR Directory where the Platform SDK is installed +MYSQL_SERVER_DIR Directory where the MySQL is installed +POSTGRESQL_SERVER_DIR Directory where the PostgreSQL is installed + +Procedure for setting environment variables: +My Computer -> Properties -> Advanced -> Environment Variables +User variables -> New + +Sample values: +-------------------------------------------------------------------------- +Variable name Variable value +-------------------------------------------------------------------------- +PLATFORM_SDK_DIR C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2 +MYSQL_SERVER_DIR C:\Program Files\MySQL\MySQL Server 5.1 POSTGRESQL_SERVER_DIR C:\Program Files\PostgreSQL\8.4 + + +Notes: + +To get as small shared libraries as possible compile as follows: +* MySQL Windows 32-bit DLL: use Visual C++ 2005 and strip the library with UPX +* TODO