Skip to content

Commit

Permalink
uGecko 1.3.2
Browse files Browse the repository at this point in the history
Fixed a crash when using the upload function
  • Loading branch information
vincent-coding authored Dec 31, 2021
1 parent c1720c9 commit 0f3d16e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"Documentation": "https://github.com/vincent-coding/uGecko/tree/master/docs",
"Issue Tracker": "https://github.com/vincent-coding/uGecko/issues"
},
version = "1.3.1",
version = "1.3.2",
packages = packages,
license = "MIT",
description = "Python library for use with TCPGecko. Requires kernel exploit to use.",
Expand Down
2 changes: 1 addition & 1 deletion ugecko/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
__author__ = "WiiuDev, VCoding"
__license__ = "MIT"
__copyright__ = "Copyright 2015-present wiiudev, 2021-present VCoding"
__version__ = "1.3.0"
__version__ = "1.3.2"

from .uGecko import *
6 changes: 3 additions & 3 deletions ugecko/uGecko.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,13 @@ def free(self, address: int) -> None:
self.call(addr, address)

def __upload(self, startAddress: int, data: bytes) -> None:
self.__socket.send(b'\x41')
self.__socket.send(Commands.UPLOAD_MEMORY.value)
req = struct.pack(">II",startAddress, startAddress+len(data))
self.__socket.send(req) # first let the server know the length
self.__socket.send(data) # then send the data

def upload(self, startAddress: int, data: bytes, debug_print:bool = False) -> None:
if self.connected:
if self.__connected:
length = len(data)
maxLength = self.getDataBufferSize()
if length > maxLength:
Expand All @@ -342,4 +342,4 @@ def upload(self, startAddress: int, data: bytes, debug_print:bool = False) -> No
pos += maxLength; length-=maxLength; startAddress+=maxLength
if length != 0: self.__upload(startAddress, data[pos:pos+length])
else: self.__upload(startAddress, data)
else: raise Exception("No connection is in progress!")
else: raise ConnectionIsNotInProgressException("No connection is in progress!")

0 comments on commit 0f3d16e

Please sign in to comment.