dethredic / WC3StreamerOverlay

A simple tool for wc3 streamers to display their opponent's race and stats
GNU General Public License v3.0
30 stars 7 forks source link

UnicodeDecodeError #9

Closed koin612 closed 5 years ago

koin612 commented 5 years ago

Error Messages:

Exception in thread Thread-2:
Traceback (most recent call last):
    File "threading.py", line 917, in _bootstrap_inner
    File "bnet_player_monitor.py", line 84, in run
    File "site-packages\scapy\sendrecv.py", in line 886, in sniff
    File "bnet_player_monitor.py", line 71, in __packet_callback
    File "bnet_player_monitor.py", line 40, in __parse_player_packet
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9f in position 0: invalid start byte

and One with the same Stacktrace but with the Exception: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 4: invalid continuation byte

What I've tryed:

I don't know how to recreate this, it wasn't on my system ether. It worked fine for 1-2 Games and then startet throwing above errors. Are the packages send always utf-8 or does it depends on the OS you're using?

dethredic commented 5 years ago

Are you running master?

koin612 commented 5 years ago

Yes, I was running master.

dethredic commented 5 years ago

TLDR: The commit https://github.com/dethredic/WC3StreamerOverlay/commit/e41e04448761adb0f658aa9c0cca9bd47a4823a0 is not working as intended. It is letting packets from all IPs through, so my program is trying to parse some non battlenet packet. Revert that and you should be good to go.

Some backstory in case you want the info / can help me fix it. For some reason net was only capturing INCOMING packets and not OUTGOING packets for a small percentage of people. I'm not sure why, and it only happened for some people. I made a quick fix for someone by changing net to host, which seemed to resolve the issue, but I didn't verify it fully as it started allowing packets from ALL IPs through.

I'll have to dig into scapy a bit more to see if I can understand what's going on, but I can't test it which makes things hard. I may just end up creating my own filtering function, but I'm not sure what the performance implications of that will be.

koin612 commented 5 years ago

Yes, I've noticed this parsing behavior. On Sunday I'll also have a look at scapy. I'll let you know here if I find out anything.

This looks quite Interessting: http://biot.com/capstats/bpf.html

dethredic commented 5 years ago

Yah, that was my reference. Based on the descriptions, I'm not sure why host isn't working, and I'm not sure what the real difference between net and host is.

koin612 commented 5 years ago

Do you have any information or contact from the net not working people? I fear that it isn't scapy, might be an OS/Firewall issue?

dethredic commented 5 years ago

I worked with with one of them on discord for about 2 hours trying different things. Disabling Firewall / Anti-virus was one of the steps I tried. The user didn't have a VPN