Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce XNET, XONLINES database v2 #758

Merged
merged 10 commits into from Oct 11, 2017
Merged

Introduce XNET, XONLINES database v2 #758

merged 10 commits into from Oct 11, 2017

Conversation

jarupxx
Copy link
Contributor

@jarupxx jarupxx commented Oct 7, 2017

Known revision found is
 XNETS 3911, 4039, 4361, 4721
 XNETN 5344
 XONLINES 4831 to 5849
Checked other revisions by the Dxbx Patterns.

XnInit is for only XNETS library. XNET library is different one.

Verified with
Halo - Combat Evolved (3911)
Tony Hawk's Pro Skater 3 (4039)
Verified with
MotoGP (4361)
Verified this PR with
- XNETS
[3911] Halo
[4039] Tony Hawk's Pro Skater 3
[4361] MotoGP
[4721] TimeSplitters 2

- XNETN
[5344] Stake

- XONLINES
[4831] NBA2K3
[4928] Unreal Championship
[5028] Capcom vs. SNK 2 EO
[5120] Muzzle Flash
[5233] MotoGP 2
[5344] Burnout 2
[5455] Ghost Recon Island Thunder
[5558] XIII
[5659] Plus Plum 2
[5788] All-Star Baseball '05
[5849] Kingdom Under Fire: The Crusaders
@PatrickvL
Copy link
Member

Well done again!

I do wish to ask a favor;

Please insert an empty line before #if and after #endif, otherwise the code gets cramped.
(Empty lines also result in better output in difference-compare-tools.)

Thanks in advance.

@RadWolfie
Copy link
Member

I'm providing a share research to know what's the difference between XOnline, XOnlines, etc.

XOnline Library Versions for Xbox Live

Library Description
XOnline Standard
XOnlined Debug
XOnlines Secure
XOnlinesd Secure debug

XNet Library Versions

Library Description
XNet Standard
XNetd Debug
XNets Secure
XNetsd Secure debug
XNetn "Neutered" (only for demos of Xbox Live titles)
XNetns.lib Neutered secure debug(?)

Anyhow, I had researched some titles and found out as mentioned in #723, some libraries actually require yet is not mentioned in library versions array within the title's xbe such as below.

//{ { Lib_XONLINES , LIB_XONLINE }, Sec_XONLINE, XONLINE_OOVPAV2, XONLINE_OOVPA_SIZEV2 },

//{ { Lib_XONLINES, LIB_XNETS, LIB_XNET }, Sec_XNET, XNET_OOVPAV2, XNET_OOVPA_SIZEV2 },

By not using the above method will cause problem with most of the titles. Except, I did not implement support for it...

P.S. For myself and others, { Lib_XONLINES,{ Sec_text, Sec_XONLINE, Sec_XNET }, XONLINES_OOVPAV2, XONLINES_OOVPA_SIZEV2 }, is not the correct way to do it with Sec_XNET included since it is a different library.

@@ -209,7 +204,7 @@ const HLEDataV2 HLEDataBaseV2[] = {
//{ Lib_XONLINE,{ Sec_XONLINE }, XONLINES_OOVPAV2, XONLINES_OOVPA_SIZEV2 },

// Fun fact, XONLINES are split into 2 header sections.
//{ Lib_XONLINES,{ Sec_XONLINE, Sec_XNET }, XONLINES_OOVPAV2, XONLINES_OOVPA_SIZEV2 },
{ Lib_XONLINES,{ Sec_text, Sec_XONLINE, Sec_XNET }, XONLINES_OOVPAV2, XONLINES_OOVPA_SIZEV2 },
Copy link
Member

Choose a reason for hiding this comment

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

Okay, now I'm asking what's the reason to have Sec_text included? Like which function is inline?

Copy link
Member

@PatrickvL PatrickvL Oct 7, 2017

Choose a reason for hiding this comment

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

I have no answer, but inlined functions are worrisome, because if we need to patch them, how can we ever be sure there's only one occurrence in the Xbe?

Copy link
Member

Choose a reason for hiding this comment

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

Since XAPI functions exist in .text rather in an XAPI segment, it's very possible that other libraries add functions to .text too.

I don't think this necessarily means the functions are being inlined, as that would alter the signature.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, then we need another term;

Inline is when a function is embedded into the caller. Which means multiple callers result in multiple inclusions.

But right now we're taking about something else. Namely, when a function is linked into an Xbe (but not in it's own section), and not inlined, thus it only appears once. What shall we call these?
"Out-of-section functions" is descriptive and clear, but too long.

We could call them "embedded functions", "roaming functions" or "foreign functions". Maybe something else - what do you guys think?

Copy link
Member

Choose a reason for hiding this comment

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

@PatrickvL TBD (To be determined), it still need more research and accuracy data before we can say "yeah, it is embedded/inline function". My wip research about this XOnline and XNet libraries are showing otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

XNetGetEthernetLinkStatus function has it in Sec_text. Other functions seem has it in Sec_XONLINE or Sec_XNET.

Copy link
Member

@RadWolfie RadWolfie Oct 8, 2017

Choose a reason for hiding this comment

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

Strange, I can confirm what jarupxx is saying about XNetGetEthernetLinkStatus is in Sec_text section. It is indeed match perfectly. Even the callers is exactly the same.

Copy link
Member

Choose a reason for hiding this comment

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

@PatrickvL turns out it is not inline function. Odd huh?

@RadWolfie
Copy link
Member

@LukeUsher, I remember you were saying XOnline and XNet are completely separate thing. My current wip research and committed in this PR, are showing it differently. Both XOnline and XNet indeed have:

(XNet OOVPA registers, yet is registers in XOnline)

  • XnInit (introduced in later revision)
  • WSAStartup
  • XNetStartup
  • XNetGetEthernetLinkStatus
  • bind
  • connect
  • listen
  • recv
  • ioctlsocket
  • socket

I'll investigate this with Unreal Championship title base on @jarupxx's note stating all are found.

@jarupxx
Copy link
Contributor Author

jarupxx commented Oct 7, 2017

I inserted an empty line before #if and after #endif, it looks good!

@jarupxx
Copy link
Contributor Author

jarupxx commented Oct 7, 2017

@RadWolfie { Lib_XONLINES,{ Sec_text, Sec_XONLINE, Sec_XNET}, XONLINES_OOVPAV2, XONLINES_OOVPA_SIZEV2 }, is this wrong?
OOVPA refers to XNET, It is intended to be OOVPA of XONLINES exactly.
I do make generic OOVPA XONLINES plus XNET, because the signatures are similar.

@RadWolfie
Copy link
Member

Here's what I discover by choosing specific section to scan.

text:

  • XNetGetEthernetLinkStatus

xnet:

  • WSAStartup
  • XNetStartup
  • XnInit
  • bind
  • connect
  • ioctlsocket
  • listen
  • recv
  • send
  • socket

xonline:

  • CXo_XOnlineLogon
  • XOnlineLogon
  • XoUpdateLaunchNewImageInternal

LukeUsher is pretty much right. XOnline for any xonline functionality (doesn't matter if it has bind, listen, recv, etc functions in it). XNet for any general networking usage.

I find it odd how Xbox dev team process this into xbe build a bit differently than I thought.

@RadWolfie
Copy link
Member

RadWolfie commented Oct 8, 2017

@jarupxx What I think is XOnline__ library is built right on top of XNet library. Aka a combo. Currently it is correct. Except... we need to separate XNet and XOnline identically. Something like this...

//XOnline section
REGISTER_OOVPAS(XOnlineLogon, PATCH, 4361),
...

//XNet section
REGISTER_OOVPAS(bind, PATCH, 3911, 4627),
...

What do you guys think?

@LukeUsher I don't think we can avoid XNet OOVPAs registrations being include in XOnline OOVPAs registrations? Since it might be randomly include of those 3 sections over time? Please provide feedback if you can to straighten this out with a solution.

@jarupxx
Copy link
Contributor Author

jarupxx commented Oct 9, 2017

@RadWolfie I got it. Added a note for reader.

@RadWolfie RadWolfie merged commit aa0d626 into Cxbx-Reloaded:WIP_HLEDB_v2 Oct 11, 2017
@RadWolfie
Copy link
Member

Merged since no other solution is available.

@jarupxx jarupxx deleted the XNet_DB branch October 14, 2017 09:55
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.

None yet

4 participants