Wie kann ich den Py3AMF-Codefehler beheben?

  • Python

    Wie kann ich den Py3AMF-Codefehler beheben?

    Ich versuche, Benutzerinformationen aus einem Flash-Spiel zu erhalten.

    Ich habe den Python 2.7-Code im Internet gefunden und in Python Version 3.8 übersetzt

    Ich erhalte jedoch einen Py3AMF-Fehler. | Hinweis: (Alle Anforderungen wurden installiert.)

    In Python 2.7 geschriebener Code: guidedhacking.com/threads/how-…orial-python-client.7970/


    (repl.it site) Ich bekomme diesen Fehler :

    Python-Quellcode

    1. Traceback (most recent call last):
    2. File "grabber.py", line 70, in <module>
    3. main()
    4. File "grabber.py", line 62, in main
    5. decoded = remoting.decode(data)
    6. File "C:\Python38\lib\site-packages\pyamf\remoting\__init__.py", line 631, in decode
    7. raise pyamf.DecodeError(pyamf.DecodeError: Malformed stream (amfVersion=15393)


    Mein Code ist hier :

    Python-Quellcode

    1. # -*- coding: utf-8 -*-
    2. #Created on Mon Sep 10 20:46:18 2020
    3. #@author: UnKnown
    4. #@contributor: UnKnown
    5. def main():
    6. try:
    7. import os
    8. from time import sleep
    9. import http.client
    10. from pyamf import AMF3
    11. from pyamf import remoting
    12. except:
    13. os.system('color 4')
    14. print('Import Error Please Install All Requirements...')
    15. print('\tOR PRESS ENTER!')
    16. input(' ')
    17. os.system('cls')
    18. print('INSTALLING REQUIREMENTS')
    19. os.system('pip install Py3AMF')
    20. os.system('cls')
    21. print('ALL REQUIREMENTS INSTALLED')
    22. input('Press Enter!')
    23. os.system('python grabber.py')
    24. # GET VERIABLES FROM USER
    25. os.system('color a')
    26. login = input('Username > ')
    27. password = input('Password > ')
    28. try:
    29. os.system('color a')
    30. os.system('cls')
    31. # SET HEADERS AND HOST
    32. headers = { "Host":"ws-tr.mspapis.com", "Origin":"https://moviestarplanet.com.tr/", "X-Requested-With":"ShockwaveFlash/17.0.0.188", "User-Agent":"Chrome/43.0.2357.81", "Content-Type":"application/x-amf", "Accept":"*/*" }
    33. host = "ws-tr.mspapis.com"
    34. # SET ALL VERIABLES
    35. requestTarget = "MovieStarPlanet.WebService.User.AMFUserServiceWeb.Login"
    36. loginInfo = [ login, password, [ 1234567890.0 ], None ]
    37. message = remoting.Envelope(amfVersion=AMF3)
    38. message['/1'] = remoting.Request(target=requestTarget, body=loginInfo)
    39. # SEND REQUEST TO SERVER
    40. body = remoting.encode(message).getvalue()
    41. connection = http.client.HTTPConnection(host)
    42. connection.request("POST", "/msp/91.0.5/Gateway.aspx?", body, headers)
    43. response = connection.getresponse()
    44. # GET RESPONSE ABD READ
    45. data = response.read()
    46. connection.close()
    47. except:
    48. os.system('color 4')
    49. print('AN ERROR HAS OCCURRED WHILE SENDING REQUEST...')
    50. print('Please check code...')
    51. # DECODE RESPONSE AND PRINT TO SCREEN
    52. print("Successfully connected to the server")
    53. decoded = remoting.decode(data)
    54. playerId = decoded['/1'].body.get('loginStatus').get('actor').get('ActorId')
    55. ticket = decoded['/1'].body.get('loginStatus').get('ticket')
    56. print("Player ID : " + str(playerId))
    57. print("Ticket : " + str(ticket))
    58. print('Sleeping...')
    59. input(' ')
    60. main()


    Code-Tags angepasst ~ EaranMaleasi

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „EaranMaleasi“ ()