Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/markus-wa/go-unassert v0.1.3
github.com/markus-wa/gobitread v0.2.5-0.20241202000432-3c3e0bc797c6
github.com/markus-wa/godispatch v1.4.1
github.com/markus-wa/ice-cipher-go v0.0.0-20230901094113-348096939ba7
github.com/markus-wa/quickhull-go/v2 v2.2.0
github.com/oklog/ulid/v2 v2.1.1
github.com/pkg/errors v0.9.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ github.com/markus-wa/gobitread v0.2.5-0.20241202000432-3c3e0bc797c6 h1:VNn0S4GFv
github.com/markus-wa/gobitread v0.2.5-0.20241202000432-3c3e0bc797c6/go.mod h1:PcWXMH4gx7o2CKslbkFkLyJB/aHW7JVRG3MRZe3PINg=
github.com/markus-wa/godispatch v1.4.1 h1:Cdff5x33ShuX3sDmUbYWejk7tOuoHErFYMhUc2h7sLc=
github.com/markus-wa/godispatch v1.4.1/go.mod h1:tk8L0yzLO4oAcFwM2sABMge0HRDJMdE8E7xm4gK/+xM=
github.com/markus-wa/ice-cipher-go v0.0.0-20230901094113-348096939ba7 h1:aR9pvnlnBxifXBmzidpAiq2prLSGlkhE904qnk2sCz4=
github.com/markus-wa/ice-cipher-go v0.0.0-20230901094113-348096939ba7/go.mod h1:JIsht5Oa9P50VnGJTvH2a6nkOqDFJbUeU1YRZYvdplw=
github.com/markus-wa/quickhull-go/v2 v2.2.0 h1:rB99NLYeUHoZQ/aNRcGOGqjNBGmrOaRxdtqTnsTUPTA=
github.com/markus-wa/quickhull-go/v2 v2.2.0/go.mod h1:EuLMucfr4B+62eipXm335hOs23LTnO62W7Psn3qvU2k=
github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s=
Expand Down
9 changes: 9 additions & 0 deletions pkg/demoinfocs/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,15 @@ const (
WarnTypeStringTableParsingFailure // Should happen only with CS2 POV demos
WarnTypePacketEntitiesPanic
WarnTypeUnknownProtobufMessage

// WarnTypeMissingNetMessageDecryptionKey occurs when encrypted net-messages are encountered and the decryption key is missing.
// See ParserConfig.NetMessageDecryptionKey
WarnTypeMissingNetMessageDecryptionKey

// WarnTypeCantReadEncryptedNetMessage occurs when an encrypted net-message can't be decrypted even though the decryption key is set.
// May occur because the decryption key used is incorrect.
// See ParserConfig.NetMessageDecryptionKey
WarnTypeCantReadEncryptedNetMessage
)

// WarnTypeUnknownDemoCommandMessageType occurs when a demo-command message type is unknown - contact a maintainer.
Expand Down
26 changes: 26 additions & 0 deletions pkg/demoinfocs/matchinfo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package demoinfocs

import (
"fmt"
"strings"

"github.com/markus-wa/demoinfocs-golang/v5/pkg/demoinfocs/msg"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
)

// MatchInfoDecryptionKey extracts the net-message decryption key stored in `match730_*.dem.info`.
// Pass the whole contents of `match730_*.dem.info` to this function to get the key.
// See also: ParserConfig.NetMessageDecryptionKey
func MatchInfoDecryptionKey(b []byte) ([]byte, error) {
m := new(msg.CDataGCCStrike15V2_MatchInfo)

err := proto.Unmarshal(b, m)
if err != nil {
return nil, errors.Wrap(err, "failed to unmarshal MatchInfo message")
}

k := []byte(strings.ToUpper(fmt.Sprintf("%016x", m.GetWatchablematchinfo().GetClDecryptdataKeyPub())))

return k, nil
}
15 changes: 12 additions & 3 deletions pkg/demoinfocs/msg/cs_gameevents.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading