mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
More replacements from open() to codecs.open(). conf.dataEncoding has to be used only for non-binary files.
This commit is contained in:
parent
84778f0e6c
commit
89c721a451
7 changed files with 35 additions and 19 deletions
|
|
@ -22,6 +22,7 @@ with sqlmap; if not, write to the Free Software Foundation, Inc., 51
|
|||
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
"""
|
||||
|
||||
import codecs
|
||||
import os
|
||||
import re
|
||||
import stat
|
||||
|
|
@ -357,7 +358,7 @@ class Metasploit:
|
|||
|
||||
self.__resource += "exploit\n"
|
||||
|
||||
self.resourceFp = open(self.resourceFile, "w")
|
||||
self.resourceFp = codecs.open(self.resourceFile, "w", conf.dataEncoding)
|
||||
self.resourceFp.write(self.__resource)
|
||||
self.resourceFp.close()
|
||||
|
||||
|
|
@ -546,7 +547,7 @@ class Metasploit:
|
|||
errMsg = "failed to create the shellcode (%s)" % payloadStderr.replace("\n", "")
|
||||
raise sqlmapFilePathException, errMsg
|
||||
|
||||
self.__shellcodeFP = open(self.__shellcodeFilePath, "rb")
|
||||
self.__shellcodeFP = codecs.open(self.__shellcodeFilePath, "rb", conf.dataEncoding)
|
||||
self.shellcodeString = self.__shellcodeFP.read()
|
||||
self.__shellcodeFP.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue