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
Fix crash in Wii games using IPCHLE networking. #2102
Conversation
Address passed from IOS to PowerPC should be in the 0x90000000 range, not 0x10000000. Issue 8264.
u32 wii_addr = BufferOut + 4 * 3 + 2 * 2; | ||
|
||
// TODO: This is really hacky; is it actually what IOS does? | ||
u32 wii_addr = 0x80000000 | (BufferOut + 4 * 3 + 2 * 2); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Fix crash in Wii games using IPCHLE networking.
This is wrong and should never have been committed. The returned values are not dereferenced directly, there is likely another bug causing the underlying issue. |
@tueidj I'm happy to revert this if you have a better idea of how this is supposed to work... but I traced the code, and the value was dereferenced directly. |
Can you paste the disassembled code showing that? |
NTSC Brawl has a call to memcpy at 0x8035cc7c; the source (r4) appears to come straight from the IPC result buffer (r29). It's possible there's something subtle going on here that I'm missing, but that's the obvious interpretation. Here's a bit of the nearby code:
|
Backtrack to the actual IOS_Ioctl call and you should see the values in the result buffer being converted to logical address: |
I'm not seeing that... it's sort of hard to trace backwards, but nothing is writing to the address In question. |
Here is a dump of what IOS places in the 0x460 byte output buffer for a lookup of google.com:
You can see the "pointers" returned for h_name, h_aliases and h_addr_list are all invalid. That's because the entire output buffer is copied from a static block of IOS memory. To correct them the code on the PowerPC side does the following:
This is all done by the PowerPC code in the gist I linked to earlier, which occurs immediately after IOS returns. |
Oh! Thanks for the explanation. I probably should have figured that out from the code snippet you pasted; sorry about the trouble. |
Address passed from IOS to PowerPC should be in the 0x90000000 range, not
0x10000000.
Issue 8264.