import base64

hex_str = "4141414141414142414173764d533976626c4a6c6333567364414145626e567362414141417145524367734244584e30595852316377514243325679636d39794241414864576c6b42496a786668567a5a584e7a6157397561325635426c466c4e3245354d3245774f57597a4d5451334d544a6d5a575a684357686863326747675145315a6d466d5a6d4e6a4d324d784f4759314e57557a4e7a6869595455795a6d56694d7a497a4f474e6d593255774d4459304d545533597a63354f4751794e445a6a4e6a4d325a4749315a4441345a574e6a4f444d7a46334e356333526c625639306157316c4269464e56474d79546d70424d55353651586c505554303944324a68626d356c636e4d4a4177454a4177454b4377454864584a73426d6c6f64485277637a6f764c32357a4c57467a63325630637935756157357159584e685a32557561575176644731774c324e795a58646662576c7562335268645849756347356e4357316c626e554743554e795a58634c64476c30624755474b303170626d39305958567949476c7a4945463259576c7359574a735a5131685933527062323447453239775a573436625756756451454e5a585a6c626e527a43534d42426874335a57786a6232316c58324a76626e567a42694e7465584e305a584a666148567564475679587a49774d6a4d474957527959576476626c396f64573530587a49774d6a5147493270316333527059325574596d466b5a3255794d4449304268396e61585a6c595864686553316a5a5735305a5849474632786c5957526c636d4a7659584a6b4268643059576c735a5752695a57467a644159565a47467062486c6e59574e6f595159585a484a685a3239755a32466a61474547473256346233527059334268593274685a32554747326868624778766432566c626a49774d6a55474c574e76626d5a79623235306157356e4c57526c5958526f4c5449774d6a55474958526f5957357263326470646d6c755a7a49774d6a5547475756735a57316c626e5268624746796378646a6247467558334e6c59584e76626759464e44555859334a6c6431397a5a57467a623234474254457a45334e3358334e6c59584e76626759464d546b46583138474955564265453479545652315a4749355a314d3064326b42"

try:
    # 1. Decode Hex to ASCII String
    ascii_str = bytes.fromhex(hex_str).decode('ascii')
    print(f"ASCII: {ascii_str[:100]}...")
    
    # 2. It looks like the ASCII string is ITSELF a Base64 string (starts with AAAAA...)
    # Decode Base64
    decoded_bytes = base64.b64decode(ascii_str)
    print(f"Decoded Bytes (first 100): {decoded_bytes[:100]}")
    
    # 3. Try to decode as text or inspect if it's AMF
    try:
        print(f"Decoded Text: {decoded_bytes.decode('utf-8')[:200]}")
    except:
        print("Binary data")
        
except Exception as e:
    print(f"Error: {e}")
