def apply(trophyId, npCommId, year, month, day, hour, minute, second):
    month = [
        "January", "Febuary", "March", "April", "May", "June", "July",
        "August", "September", "October", "November", "December"
    ].index(month) + 1
    try:
        timestamp = VitaTime.encodeTimestamp("{}-{}-{} {}:{}:{}.{}".format(
            year, month, day, hour, minute, second, 0))
    except:
        tkMessageBox.showerror(title="THAT MAKES NO SENSE!",
                               message="You entered an impossible time.")
    ParseTRPTRNS.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
    ParseTRPTITLE.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
    ParseTRPTRNS.writeTimestamp(ParseTRPTRNS.findDataBlockForTrophy(trophyId),
                                timestamp)
    ParseTRPTITLE.writeTimestamp(trophyId, timestamp)

    global lastTime
    lastTime = timestamp

    destroy_window()
    psvtrophyisgoodModTRP.vp_start_gui(npCommId)
    sys.stdout.flush()
Пример #2
0
def lockALL(npCommId):
    ParseTRPSFM.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/conf/" + npCommId + "/TROP.SFM")
    numTrophys = ParseTRPSFM.getNumberOfTrophies()
    trophyId = 0
    while trophyId != numTrophys:
        ParseTRPTRNS.init(
            os.path.dirname(os.path.realpath(__file__)) +
            "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
        ParseTRPTITLE.init(
            os.path.dirname(os.path.realpath(__file__)) +
            "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
        ParseTRPTITLE.lockTrophy(trophyId)

        if ParseTRPTRNS.findDataBlockForTrophy(trophyId) == -1:
            ParseTRPTRNS.unlockTrophy(trophyId)
            ParseTRPTRNS.init(
                os.path.dirname(os.path.realpath(__file__)) +
                "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
            ## Program could crash when trying to lock a trophy found in TRPTITLE but not TRPTRANS.
            ## This fixes that.

        ParseTRPTRNS.lockTrophy(trophyId, True)
        trophyId += 1
    destroy_window()
    psvtrophyisgoodModTRP.vp_start_gui(npCommId)
Пример #3
0
def selectSet(indexTitle):
    if len(indexTitle) == 0:
        tkMessageBox.showerror(title="Fail!", message="You have no trophys imported.")
    else:
        npCommId = indexTitle[indexTitle.index("[")+1:]
        npCommId = npCommId[:-1]
        #print "Decrypting "+npCommId
        #PFS.decryptPFS(os.getcwd()+"/data/"+npCommId)
        destroy_window()
        psvtrophyisgoodModTRP.vp_start_gui(npCommId)
Пример #4
0
def unlockTrophy(npCommId, trophy):
    destroy_window()
    trophyId = getTrophyId(trophy)
    ParseTRPTRNS.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
    ParseTRPTITLE.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
    ParseTRPTITLE.unlockTrophy(trophyId)
    ParseTRPTRNS.unlockTrophy(trophyId)
    psvtrophyisgoodModTRP.vp_start_gui(npCommId)
def apply(npCommId, byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8):
    destroy_window()
    aid = byte1 + byte2 + byte3 + byte4 + byte5 + byte6 + byte7 + byte8
    ParseTRPTRNS.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
    ParseTRPTITLE.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
    ParseTRPTRNS.setAccountId(aid)
    ParseTRPTITLE.setAccountId(aid)
    psvtrophyisgoodModTRP.vp_start_gui(npCommId)
Пример #6
0
def unlockAll(npCommId):
    ParseTRPSFM.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/conf/" + npCommId + "/TROP.SFM")
    numTrophys = ParseTRPSFM.getNumberOfTrophies()
    trophyId = 0
    while trophyId != numTrophys:
        ParseTRPTRNS.init(
            os.path.dirname(os.path.realpath(__file__)) +
            "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
        ParseTRPTITLE.init(
            os.path.dirname(os.path.realpath(__file__)) +
            "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
        ParseTRPTITLE.unlockTrophy(trophyId)
        ParseTRPTRNS.unlockTrophy(trophyId)
        trophyId += 1
    destroy_window()
    psvtrophyisgoodModTRP.vp_start_gui(npCommId)
Пример #7
0
def lockTrophy(npCommId, trophy):
    destroy_window()
    trophyId = getTrophyId(trophy)
    ParseTRPTITLE.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
    ParseTRPTRNS.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
    if ParseTRPTRNS.findDataBlockForTrophy(trophyId) == -1:
        ParseTRPTRNS.unlockTrophy(trophyId)
        ParseTRPTRNS.init(
            os.path.dirname(os.path.realpath(__file__)) +
            "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
        ## Program could crash when trying to lock a trophy found in TRPTITLE but not TRPTRANS.
        ## This fixes that.
    ParseTRPTITLE.lockTrophy(trophyId)
    ParseTRPTRNS.lockTrophy(trophyId)
    psvtrophyisgoodModTRP.vp_start_gui(npCommId)
Пример #8
0
def rngStamp(npCommId, trophy):
    destroy_window()
    trophyId = getTrophyId(trophy)

    psvtrophyisgoodRandomTime.vp_start_gui()
    timestamps = psvtrophyisgoodRandomTime_support.getTimestamps()
    timestamp = VitaTime.genRandomTime(timestamps[0], timestamps[1])

    ParseTRPTRNS.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
    ParseTRPTITLE.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
    if ParseTRPTITLE.parseDataBlock(trophyId)["unlocked"]:
        if ParseTRPTRNS.findDataBlockForTrophy(trophyId) == -1:
            ParseTRPTRNS.unlockTrophy(trophyId)
            ParseTRPTITLE.unlockTrophy(trophyId)
            ParseTRPTRNS.init(
                os.path.dirname(os.path.realpath(__file__)) +
                "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
            ParseTRPTITLE.init(
                os.path.dirname(os.path.realpath(__file__)) +
                "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
        ParseTRPTRNS.init(
            os.path.dirname(os.path.realpath(__file__)) +
            "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
        ParseTRPTITLE.init(
            os.path.dirname(os.path.realpath(__file__)) +
            "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
        ParseTRPTRNS.writeTimestamp(
            ParseTRPTRNS.findDataBlockForTrophy(trophyId), timestamp)
        ParseTRPTITLE.writeTimestamp(trophyId, timestamp)
    else:
        tkMessageBox.showerror(
            title="Uhh..",
            message="You cant set a timestamp for a locked trophy!")
    psvtrophyisgoodModTRP.vp_start_gui(npCommId)
    sys.stdout.flush()
Пример #9
0
def randomAll(npCommId):
    destroy_window()
    trophyId = 0
    ParseTRPSFM.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/conf/" + npCommId + "/TROP.SFM")
    ParseTRPTRNS.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
    ParseTRPTITLE.init(
        os.path.dirname(os.path.realpath(__file__)) +
        "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
    numTrophys = ParseTRPSFM.getNumberOfTrophies()
    psvtrophyisgoodRandomTime.vp_start_gui()
    timestamps = psvtrophyisgoodRandomTime_support.getTimestamps()
    while trophyId != numTrophys:
        if ParseTRPTITLE.parseDataBlock(trophyId)["unlocked"]:
            if ParseTRPTRNS.findDataBlockForTrophy(trophyId) == -1:
                ParseTRPTRNS.unlockTrophy(trophyId)
                ParseTRPTITLE.unlockTrophy(trophyId)
                ParseTRPTRNS.init(
                    os.path.dirname(os.path.realpath(__file__)) +
                    "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
                ParseTRPTITLE.init(
                    os.path.dirname(os.path.realpath(__file__)) +
                    "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
            ParseTRPTRNS.init(
                os.path.dirname(os.path.realpath(__file__)) +
                "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
            ParseTRPTITLE.init(
                os.path.dirname(os.path.realpath(__file__)) +
                "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
            timestamp = VitaTime.genRandomTime(timestamps[0], timestamps[1])
            ParseTRPTRNS.writeTimestamp(
                ParseTRPTRNS.findDataBlockForTrophy(trophyId), timestamp)
            ParseTRPTITLE.writeTimestamp(trophyId, timestamp)
        trophyId += 1
    psvtrophyisgoodModTRP.vp_start_gui(npCommId)
Пример #10
0
def stealFromPsn(npCommId):
    destroy_window()

    window = Tkinter.Tk()
    window.wm_withdraw()

    userInfoCookie = ""
    ##Throwaway account i dont care about ^

    onlineId = tkSimpleDialog.askstring(
        title="Trophy Stealer",
        prompt="Enter a PSN Username of someone who has this trophy set.")
    if onlineId == None:
        window.destroy()
        psvtrophyisgoodModTRP.vp_start_gui(npCommId)

    headers = {
        "Accept":
        "application/json, text/javascript, */*; q=0.01",
        "Accept-Encoding":
        "zip, deflate, br",
        "Accept-Language":
        "en-GB,en-US;q=0.9,en;q=0.8",
        "Connection":
        "keep-alive",
        "Host":
        "io.playstation.com",
        "Origin":
        "https://www.playstation.com",
        "Referer":
        "https://www.playstation.com/en-ca/my/compare-game-trophies/",
        "User-Agent":
        "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/64.0.3282.167 Chrome/64.0.3282.167 Safari/537.36"
    }  ##So that where not saying "Hello im a bot!" to sony.
    url = "https://io.playstation.com/playstation/psn/profile/compareGames/trophies/data"
    params = (("gameId", npCommId), ("userIds",
                                     onlineId + "," + onlineId.lower()),
              ("userInfoCookie", userInfoCookie))
    try:
        print "Connecting to PSN..."
        trophyData = json.loads(
            requests.get(url=url, params=params, headers=headers).content)
    except:
        tkMessageBox.showerror(title="Connection Failed.",
                               message="Could not contact server.")
        window.destroy()
        psvtrophyisgoodModTRP.vp_start_gui(npCommId)
        return -1
    try:
        trophyData = trophyData['users']
        trophyData = trophyData[0]
        trophyData = trophyData['list']
        if trophyData != []:
            print trophyData

            ## Lock all trophys

            ParseTRPSFM.init(
                os.path.dirname(os.path.realpath(__file__)) +
                "/trophyDownloaded/conf/" + npCommId + "/TROP.SFM")
            a = 0
            while a != ParseTRPSFM.getNumberOfTrophies():
                ParseTRPTRNS.init(
                    os.path.dirname(os.path.realpath(__file__)) +
                    "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
                ParseTRPTITLE.init(
                    os.path.dirname(os.path.realpath(__file__)) +
                    "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
                ParseTRPTITLE.lockTrophy(a)
                if ParseTRPTRNS.findDataBlockForTrophy(a) != -1:
                    ParseTRPTRNS.lockTrophy(a, True)
                a += 1

            ## Unlock Trophys

            a = 0
            ParseTRPSFM.init(
                os.path.dirname(os.path.realpath(__file__)) +
                "/trophyDownloaded/conf/" + npCommId + "/TROP.SFM")
            while a != ParseTRPSFM.getNumberOfTrophies():
                tropInfo = trophyData[a]
                if tropInfo['trophyWon'] != 0:
                    ParseTRPTRNS.init(
                        os.path.dirname(os.path.realpath(__file__)) +
                        "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
                    ParseTRPTITLE.init(
                        os.path.dirname(os.path.realpath(__file__)) +
                        "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
                    ParseTRPTITLE.unlockTrophy(a)
                    ParseTRPTRNS.unlockTrophy(a)

                    ## Write timestamps
                    unlockDate = datetime.datetime.strptime(
                        tropInfo['trophyStamp'], "%Y-%m-%dT%H:%M:%SZ")
                    unlockDate = str(unlockDate)
                    timestamp = VitaTime.encodeTimestamp(unlockDate + ".00")
                    ParseTRPTRNS.init(
                        os.path.dirname(os.path.realpath(__file__)) +
                        "/trophyDownloaded/data/" + npCommId + "/TRPTRANS.DAT")
                    ParseTRPTITLE.init(
                        os.path.dirname(os.path.realpath(__file__)) +
                        "/trophyDownloaded/data/" + npCommId + "/TRPTITLE.DAT")
                    print ParseTRPTRNS.findDataBlockForTrophy(a)
                    ParseTRPTRNS.writeTimestamp(
                        ParseTRPTRNS.findDataBlockForTrophy(a), timestamp)
                    print a
                    ParseTRPTITLE.writeTimestamp(a, timestamp)

                a += 1

        else:
            tkMessageBox.showerror(
                title="Trophy Set Not Found",
                message="The user you specified does not have this trophy set."
            )
    except:
        tkMessageBox.showerror(
            title="Trophy Set Not Found",
            message="The user you specified does not have this trophy set.")
    window.destroy()

    psvtrophyisgoodModTRP.vp_start_gui(npCommId)