--- core/Sys/plUuid.cpp.orig
@@ -69,6 +69,9 @@ void plUuid::read(const unsigned char* buffer) {
fData1 = *(unsigned int* )(buffer );
fData2 = *(unsigned short*)(buffer + 4);
fData3 = *(unsigned short*)(buffer + 6);
+ fData1 = LESWAP32(fData1);
+ fData2 = LESWAP16(fData2);
+ fData3 = LESWAP16(fData3);
memcpy(fData4, buffer + 8, 8);
@@ -80,9 +83,9 @@ void plUuid::write(hsStream* S) {
void plUuid::write(unsigned char* buffer) const {
- *(unsigned int* )(buffer ) = fData1;
- *(unsigned short*)(buffer + 4) = fData2;
- *(unsigned short*)(buffer + 6) = fData3;
+ *(unsigned int* )(buffer ) = LESWAP32(fData1);
+ *(unsigned short*)(buffer + 4) = LESWAP16(fData2);
+ *(unsigned short*)(buffer + 6) = LESWAP16(fData3);
memcpy(buffer + 8, fData4, 8);
--- net/auth/pnAuthClient.cpp.orig 2011-11-08 10:52:52.000000000 -0600
+++ net/auth/pnAuthClient.cpp 2011-11-08 10:52:52.000000000 -0600
sock->recv(&msgId, sizeof(uint16_t));
+ msgId = LESWAP16(msgId);
const pnNetMsg* msgDesc = GET_Auth2Cli(msgId);
plDebug::Error("Got invalid message ID (%u)", msgId);
uint8_t connectHeader[51]; // ConnectHeader + AuthConnectHeader
/* Begin ConnectHeader */
*(uint8_t* )(connectHeader ) = kConnTypeCliToAuth;
- *(uint16_t*)(connectHeader + 1) = 31;
- *(uint32_t*)(connectHeader + 3) = fBuildId;
- *(uint32_t*)(connectHeader + 7) = fBuildType;
- *(uint32_t*)(connectHeader + 11) = fBranchId;
+ *(uint16_t*)(connectHeader + 1) = LESWAP16(31);
+ *(uint32_t*)(connectHeader + 3) = LESWAP32(fBuildId);
+ *(uint32_t*)(connectHeader + 7) = LESWAP32(fBuildType);
+ *(uint32_t*)(connectHeader + 11) = LESWAP32(fBranchId);
fProductId.write(connectHeader + 15);
/* Begin AuthConnectHeader */
- *(uint32_t*)(connectHeader + 31) = 20;
+ *(uint32_t*)(connectHeader + 31) = LESWAP32(20);
memset(connectHeader + 35, 0, 16);
fSock->send(connectHeader, 51);
} else if (msg == kNetCliSrv2CliError) {
fSock->recv(&errorCode, sizeof(uint32_t));
+ errorCode = LESWAP32(errorCode);
plDebug::Error("Error connecting to Auth server: %s",
--- net/pnSocket.cpp.orig