Skip to content

Comments

NetHook2 emsg descriptors 'fix' for steam client beta#765

Merged
yaakov-h merged 1 commit intoSteamRE:masterfrom
m4dEngi:netHook_beta
May 16, 2020
Merged

NetHook2 emsg descriptors 'fix' for steam client beta#765
yaakov-h merged 1 commit intoSteamRE:masterfrom
m4dEngi:netHook_beta

Conversation

@m4dEngi
Copy link
Contributor

@m4dEngi m4dEngi commented Oct 28, 2019

It's still possible to get descriptors after msglist initialization.

@codecov
Copy link

codecov bot commented Oct 28, 2019

Codecov Report

Merging #765 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #765      +/-   ##
==========================================
+ Coverage   22.75%   22.77%   +0.02%     
==========================================
  Files          94       95       +1     
  Lines        9309     9329      +20     
  Branches      763      772       +9     
==========================================
+ Hits         2118     2125       +7     
- Misses       7064     7069       +5     
- Partials      127      135       +8
Impacted Files Coverage Δ
SteamKit2/SteamKit2/Base/ClientMsg.cs 22.98% <0%> (-0.58%) ⬇️
...SteamKit2/Networking/Steam3/NetFilterEncryption.cs 0% <0%> (ø) ⬆️
SteamKit2/SteamKit2/Util/ZipUtil.cs 0% <0%> (ø) ⬆️
SteamKit2/SteamKit2/Util/Utils.cs 25% <0%> (ø) ⬆️
SteamKit2/SteamKit2/Util/DebugNetworkListener.cs 0% <0%> (ø) ⬆️
...mKit2/SteamKit2/Networking/Steam3/UdpConnection.cs 0% <0%> (ø) ⬆️
...2/Networking/Steam3/NetFilterEncryptionWithHMAC.cs 0% <0%> (ø) ⬆️
...SteamKit2/Networking/Steam3/WebSocketConnection.cs 0% <0%> (ø) ⬆️
...mKit2/SteamKit2/Networking/Steam3/TcpConnection.cs 0% <0%> (ø) ⬆️
SteamKit2/SteamKit2/Util/ILogContext.cs 100% <0%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3077fa2...18a9cf2. Read the comment docs.

Copy link
Member

@xPaw xPaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and this works.

@m4dEngi
Copy link
Contributor Author

m4dEngi commented Oct 31, 2019

It's still a bad piece of code, because we can no longer tell even the correct size of emsg list without overcomplicating code. Maybe it'll be a better idea to use CMessageList::FindMessageInfoForEMsg instead and get names using returned MsgInfo_t structs for incoming/outgoing packets?

@m4dEngi m4dEngi marked this pull request as ready for review November 18, 2019 18:01
@yaakov-h yaakov-h self-assigned this Nov 18, 2019
@WhiteRabbitHS

This comment has been minimized.

@yaakov-h
Copy link
Member

yaakov-h commented Mar 6, 2020

Confirmed as working.

Interestingly, instead of (null) being the placeholder for "I don't know what this EMsg is", it's now Unknown.

Is there anything we can do to preserve emsg_list.txt/emsg_list_detailed.txt, or do we basically lose the ability to keep track of all EMsgs?

@WhiteRabbitHS

This comment has been minimized.

@m4dEngi
Copy link
Contributor Author

m4dEngi commented Mar 6, 2020

Is there anything we can do to preserve emsg_list.txt/emsg_list_detailed.txt, or do we basically lose the ability to keep track of all EMsgs?

There is, probably, I'm just too stupid/lazy to do it.

It looks like they changed emsglist class internals. EMsgs are now dynamically pushed on vector. Old EMsg structs are still there, but i'm not sure that whole list can be safely read sequentially, because its size is unknown( on windows list populated in a while loop until it hits record with emsgid 0xFFFFFFFF, on osx it's the same while loop but until it hits next symbol ) and string descriptors are not populated before constructor is called.

The reasons why i switched to using PchMsgNameFromEMsg

  • It's easier to find and it's signature is more or less stable.
  • It's guaranteed to call msglist constructor.
  • It's easier than re-implementing everything to do lookup properly using msglist interface while emsg list dumps are available @steamdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants