neowutran / ShinraMeter

Tera DPS Meter
https://neowutran.ovh/updates/?C=M;O=D
MIT License
114 stars 80 forks source link

Meter don't show the DPS #98

Closed srubiolpz closed 8 years ago

srubiolpz commented 8 years ago

I have been using ShinraMeter from 2 weeks ago. Today I decided to update my v0.85 to v.087 as I usually do (clicking "yes" as soon as the update window pops up and wait, then clicking the .exe again). I don't know why but this time the updater seemed to crash; after that I got an error every time I tried to open v0.85. I deleted v0.85 and downloaded the new version from the cloud.

The point is that now I'm not able to see the DPS from me or my party. The UI opens fine but not showing the DPS as soon as I hit something.

I'm playing in EU/Killian, not using VPN, SO Windows 10 and wired internet conection. I was using the meter with WinPcap, and I have tried to disable it and enable Raw Sockets but nothing happens.

I updated my .NET framework to 4.6.1 (I think I did not even have 4.6 installed before, but I was able to use the meter) from here: https://www.microsoft.com/es-es/download/details.aspx?id=49981 I also have the firewall exception added.

Any help will be welcome. Thank you.

neowutran commented 8 years ago

Use raw socket, disable your firewall & check to be sure

Gl0 commented 8 years ago

May be side effect of enabled checksum validation on some adapters with offloading? May be add some debug output when it happens?

srubiolpz commented 8 years ago

Problem solved.

I used raw socket, disabled my firewall and it works. Activating the firewall makes the meter not showing the dps again, so the problem was in the "ShinraMeter.exe" path in the exception rule.

I have made a new one using: C:\Users\Desktop\ShinraMeterV0.87\ShinraMeter.exe instead of: %USERPROFILE%\Desktop\ShinraMeterV0.87\ShinraMeter.exe , and now seems to work as fine as usual. I don't know why I have been using the meter during this 2 weeks without .NET 4.6 and the old exception rule path, anyway this should be the right way to go.

Thank you for all your help.

neowutran commented 8 years ago

yup, indeed, debug for that can be usefull ^^. But that won't solve the problem ~ checksum, offloading etc... I just want to delete winpcap support & switch everything to raw socket x)
Do you have an idea?

Gl0 commented 8 years ago

Not sure that there is no setups where winpcap works but raw sockets not. At least I'll left it as an option.

neowutran commented 8 years ago

If we put that

   var checksum = ipPacket.Checksum;
            if (ipPacket.CalculateIPChecksum() != checksum)
            {
                return;
            }

Instead of that https://github.com/neowutran/ShinraMeter/blob/master/NetworkSniffer/IpSnifferWinPcap.cs#L106

? reading the checksum header, computing the checksum & checking?

Gl0 commented 8 years ago

Current code checks not only ip checksum, but tcp one as well, as far as I understand.

winpcap also give the way to use meter on other machine than playing tera, so that it is 100% undetectable by any protection.

neowutran commented 8 years ago

Yup, won't delete winpcap, just raging against it. I just don't understand how to make it work as we want

Gl0 commented 8 years ago

btw, all offloading issues should affect only outgoing traffic, which can be safely ignored by meter.

Gl0 commented 8 years ago

Or we can just check for correct totallength to get rid of runtime error and forget about checksums.=)

Gl0 commented 8 years ago

But first it should be better to add some debug output to see whether it is definitely global problem with checksums, on my comp it never triggered.

neowutran commented 8 years ago

^^ trying few thing & I push

neowutran commented 8 years ago

added the invalid checksum as an exception, so logged in error.log + over network

Gl0 commented 8 years ago

2 users on RU forum have the same issue. may be checksum validation was bad idea...

neowutran commented 8 years ago

The idea was to test what happen if we use checksum validation ^^ now we know

Gl0 commented 8 years ago

Enable checksum offloading on my machine (was switched off due to some virtualization or vpn issues, don't remember now) - faced with same issue. So the only way is to check for correct packet length and leave checksum validation off.

neowutran commented 8 years ago

ok ^^ and we can keep checksum validation for incoming packet only

neowutran commented 8 years ago

(Huuuue how did you enabled offloading on your os? I saw that: https://msdn.microsoft.com/en-us/library/windows/hardware/ff571012%28v=vs.85%29.aspx , but it seems that offloading is already activated on my computer & no problem with the meter)

Gl0 commented 8 years ago

In my case it was disabled in adapter preferences.

Gl0 commented 8 years ago

btw, it triggered not on incoming game server connection, but on login server outgoing, since winpcap filter is set to the whole subnet.

neowutran commented 8 years ago

ok, thx. Will try to make it crash on my computer.

Gl0 commented 8 years ago

But we still need first packets of client-to-server connection to calculate keys.

Gl0 commented 8 years ago

thats why it fails to process game data when validation is on.

Gl0 commented 8 years ago

So we can't validate checksums until we get all keys

neowutran commented 8 years ago

huuue, we can just make the checksum validation for incoming packet using the packet destination & the list of Tera server ?

Gl0 commented 8 years ago

Yes, working fine here

Gl0 commented 8 years ago

but not destination, source )

neowutran commented 8 years ago

I m unable to activate offloading on my card, does this work for you?

    if (!ipPacket.ValidChecksum)
            {
                if (_servers.IndexOf(ipPacket.DestinationAddress.ToString()) == -1)
                {
                    //Bad checksum on incoming packet
                    return;
                }
            }
Gl0 commented 8 years ago

Exception is to check only, to be replaced by return.

neowutran commented 8 years ago

ok ^^ I m making a release, I keep the exception, so we will maybe see it in debug.txt

neowutran commented 8 years ago

released & cleared http://diclah.com/~yukikoo/debug/debug.txt