From 32734e0de3c072476f2b49273427ce29e4f10dcb Mon Sep 17 00:00:00 2001 From: Hazim Gazov Date: Wed, 28 Apr 2010 08:51:12 -0300 Subject: [PATCH] got mac and id0 spoofing working --- indra/newview/app_settings/settings.xml | 211 ++++++++++++++++-- indra/newview/dofloaterhex.cpp | 1 + indra/newview/doinventorybackup.cpp | 8 +- indra/newview/doinventorybackup.h | 7 + indra/newview/llpanellogin.cpp | 95 +++++++- indra/newview/llpanellogin.h | 9 + indra/newview/llstartup.cpp | 32 ++- indra/newview/lluserauth.cpp | 20 ++ .../skins/default/xui/en-us/panel_login.xml | 26 ++- 9 files changed, 385 insertions(+), 24 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3e2a991ca..8796e4d84 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -23,6 +23,17 @@ Value 0 + AO.Enabled + + Comment + Enable animation overrider + Persist + 1 + Type + Boolean + Value + 0 + UserChatColor Comment @@ -3776,6 +3787,22 @@ 0 + FloaterVFSRect + + Comment + Rectangle for local assets window. + Persist + 1 + Type + Rect + Value + + 0 + 0 + 0 + 0 + + FloaterBumpRect Comment @@ -4493,6 +4520,54 @@ 0 + FloaterAORect + + Comment + Rectangle for AO editor. + Persist + 1 + Type + Rect + Value + + 0 + 0 + 0 + 0 + + + FloaterAvatarsRect + + Comment + Rectangle for avatar radar. + Persist + 1 + Type + Rect + Value + + 200 + 905 + 396 + 734 + + + FloaterInterceptorRect + + Comment + Rectangle for interceptor floater. + Persist + 1 + Type + Rect + Value + + 0 + 0 + 0 + 0 + + FloaterKeyToolRect Comment @@ -4995,6 +5070,28 @@ Value 9.0 + ForceNotecardDragCargoPermissive + + Comment + For testing what does and does not work when using HTTPS upload + Persist + 1 + Type + Boolean + Value + 0 + + ForceNotecardDragCargoAcceptance + + Comment + For testing what does and does not work when using HTTPS upload + Persist + 1 + Type + Boolean + Value + 0 + ForceShowGrid Comment @@ -5876,7 +5973,7 @@ Type Boolean Value - 1 + 0 LipSyncAah @@ -8278,17 +8375,17 @@ Value 1 - RenderQualityPerformance - - Comment - Which graphics settings you've chosen - Persist - 1 - Type - U32 - Value - 1 - + ReSit + + Comment + Sit again if unsat + Persist + 0 + Type + Boolean + Value + 0 + SpecifyMAC Comment @@ -8320,7 +8417,7 @@ Type String Value - Imprudence + Snowglobe SpecifiedMAC @@ -8729,6 +8826,94 @@ Value 1 + ShowMapDestinationInChat + + Comment + Show llMapDestination as slurl in chat + Persist + 1 + Type + Boolean + Value + 0 + + DisableScriptTeleportRequest + + Comment + Don't allow scripts to pop the map + Persist + 1 + Type + Boolean + Value + 0 + + DisableClickSit + + Comment + Never sit by clicking a prim + Persist + 1 + Type + Boolean + Value + 1 + + PlayIMSound + + Comment + Play sound when receiving an IM + Persist + 1 + Type + Boolean + Value + 1 + + IMSoundID + + Comment + UUID of sound to play if PlayIMSound enabled + Persist + 1 + Type + String + Value + 4c366008-65da-2e84-9b74-f58a392b94c6 + + OpenIMOnTyping + + Comment + Open IM tab when typing message received + Persist + 1 + Type + Boolean + Value + 1 + + EnableGestures + + Comment + Enables gestures + Persist + 1 + Type + Boolean + Value + 1 + + DisableAgentUpdates + + Comment + Stops regular agent updates + Persist + 0 + Type + Boolean + Value + 0 + ScaleShowAxes Comment diff --git a/indra/newview/dofloaterhex.cpp b/indra/newview/dofloaterhex.cpp index 3af60083b..d66208b52 100644 --- a/indra/newview/dofloaterhex.cpp +++ b/indra/newview/dofloaterhex.cpp @@ -24,6 +24,7 @@ #include "llappviewer.h" // gLocalInventoryRoot #include "llfloaterperms.h" //get default perms + std::list DOFloaterHex::sInstances; S32 DOFloaterHex::sUploadAmount = 10; diff --git a/indra/newview/doinventorybackup.cpp b/indra/newview/doinventorybackup.cpp index 1221dd8b8..a28bc16f0 100644 --- a/indra/newview/doinventorybackup.cpp +++ b/indra/newview/doinventorybackup.cpp @@ -144,7 +144,7 @@ void DOFloaterInventoryBackupSettings::onClickNext(void* userdata) std::vector::iterator _cat_end = order->mCats.end(); for( ; _cat_iter != _cat_end; ++_cat_iter) { - std::string path = filename + "\\" + DOInventoryBackup::getPath(*_cat_iter, order->mCats); + std::string path = filename + OS_SEP + DOInventoryBackup::getPath(*_cat_iter, order->mCats); LLFile::mkdir(path); } @@ -481,7 +481,7 @@ std::string DOInventoryBackup::getPath(LLInventoryCategory* cat, std::vectorgetCategory(cat->getParentUUID()); while(parent && (std::find(cats.begin(), cats.end(), parent) != cats.end())) { - path = LLDir::getScrubbedFileName(parent->getName()) + "\\" + path; + path = LLDir::getScrubbedFileName(parent->getName()) + OS_SEP + path; parent = model->getCategory(parent->getParentUUID()); } return path; @@ -719,7 +719,7 @@ void DOFloaterInventoryBackup::imageCallback(BOOL success, return; } - std::string filename = floater->mPath + "\\" + DOInventoryBackup::getPath(gInventory.getCategory(item->getParentUUID()), floater->mCats) + "\\" + LLDir::getScrubbedFileName(item->getName()); + std::string filename = floater->mPath + OS_SEP + DOInventoryBackup::getPath(gInventory.getCategory(item->getParentUUID()), floater->mCats) + OS_SEP + LLDir::getScrubbedFileName(item->getName()); filename = DOInventoryBackup::getUniqueFilename(filename, DOInventoryBackup::getExtension(item)); LLPointer image_tga = new LLImageTGA; @@ -778,7 +778,7 @@ void DOFloaterInventoryBackup::assetCallback(LLVFS *vfs, file.read((U8*)buffer, size); // Write it back out... - std::string filename = floater->mPath + "\\" + DOInventoryBackup::getPath(gInventory.getCategory(item->getParentUUID()), floater->mCats) + "\\" + LLDir::getScrubbedFileName(item->getName()); + std::string filename = floater->mPath + OS_SEP + DOInventoryBackup::getPath(gInventory.getCategory(item->getParentUUID()), floater->mCats) + OS_SEP + LLDir::getScrubbedFileName(item->getName()); filename = DOInventoryBackup::getUniqueFilename(filename, DOInventoryBackup::getExtension(item)); std::ofstream export_file(filename.c_str(), std::ofstream::binary); diff --git a/indra/newview/doinventorybackup.h b/indra/newview/doinventorybackup.h index fbd9df894..6f56f53b1 100644 --- a/indra/newview/doinventorybackup.h +++ b/indra/newview/doinventorybackup.h @@ -11,6 +11,13 @@ #ifndef DO_DOINVENTORYBACKUP_H #define DO_DOINVENTORYBACKUP_H +#if LL_WINDOWS +#define OS_SEP "\\" +#else +#define OS_SEP "/" +#endif + + #include "llviewerinventory.h" #include "llfolderview.h" #include "llfilepicker.h" diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 2214f0d49..0eea61dd2 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -366,9 +366,82 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // std::string specified_channel = gSavedSettings.getString("SpecifiedChannel"); getChild("channel_edit")->setText(specified_channel); - // -} + bool specify_mac = gSavedSettings.getBOOL("SpecifyMAC"); + bool specify_id0 = gSavedSettings.getBOOL("SpecifyID0"); + std::string specified_mac = gSavedSettings.getString("SpecifiedMAC"); + std::string specified_id0 = gSavedSettings.getString("SpecifiedID0"); + + // Don't allow specify for empty strings (just in case) + if(specified_mac.length() == 0) specify_mac = false; + if(specified_id0.length() == 0) specify_id0 = false; + + gSavedSettings.setBOOL("SpecifyMAC", specify_mac); + gSavedSettings.setBOOL("SpecifyID0", specify_id0); + + getChild("mac_check")->setValue(specify_mac); + getChild("mac_edit")->setEnabled(specify_mac); + getChild("id0_check")->setValue(specify_id0); + getChild("id0_edit")->setEnabled(specify_id0); + + fillMAC(); + fillID0(); + + childSetCommitCallback("mac_check", onCheckMAC, this); + childSetCommitCallback("id0_check", onCheckID0, this); + // +} + +// +void LLPanelLogin::fillMAC() +{ + if(gSavedSettings.getBOOL("SpecifyMAC")) + { + getChild("mac_edit")->setText(gSavedSettings.getString("SpecifiedMAC")); + } + else + { + char hashed_mac_string[MD5HEX_STR_SIZE]; + LLMD5 hashed_mac; + hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES ); + hashed_mac.finalize(); + hashed_mac.hex_digest(hashed_mac_string); + getChild("mac_edit")->setText(std::string(hashed_mac_string)); + } +} + +void LLPanelLogin::fillID0() +{ + if(gSavedSettings.getBOOL("SpecifyID0")) + { + getChild("id0_edit")->setText(gSavedSettings.getString("SpecifiedID0")); + } + else + { + getChild("id0_edit")->setText(LLAppViewer::instance()->getSerialNumber()); + } +} + +// static +void LLPanelLogin::onCheckMAC(LLUICtrl* ctrl, void* userData) +{ + LLPanelLogin* panel = (LLPanelLogin*)userData; + bool enabled = ((LLCheckBoxCtrl*)ctrl)->getValue(); + gSavedSettings.setBOOL("SpecifyMAC", enabled); + panel->getChild("mac_edit")->setEnabled(enabled); + panel->fillMAC(); +} + +// static +void LLPanelLogin::onCheckID0(LLUICtrl* ctrl, void* userData) +{ + LLPanelLogin* panel = (LLPanelLogin*)userData; + bool enabled = ((LLCheckBoxCtrl*)ctrl)->getValue(); + gSavedSettings.setBOOL("SpecifyID0", enabled); + panel->getChild("id0_edit")->setEnabled(enabled); + panel->fillID0(); +} +// void LLPanelLogin::setSiteIsAlive( bool alive ) { @@ -1099,9 +1172,23 @@ void LLPanelLogin::onClickConnect(void *) { if (sInstance && sInstance->mCallback) { - // save identity settings for login + // save identity settings for login + bool specify_mac = sInstance->getChild("mac_check")->getValue(); + bool specify_id0 = sInstance->getChild("id0_check")->getValue(); + gSavedSettings.setBOOL("SpecifyMAC", specify_mac); + gSavedSettings.setBOOL("SpecifyID0", specify_id0); + if(specify_mac) + { + std::string specified_mac = sInstance->getChild("mac_edit")->getText(); + gSavedSettings.setString("SpecifiedMAC", specified_mac); + } + if(specify_id0) + { + std::string specified_id0 = sInstance->getChild("id0_edit")->getText(); + gSavedSettings.setString("SpecifiedID0", specified_id0); + } std::string specified_channel = sInstance->getChild("channel_edit")->getText(); - gSavedSettings.setString("SpecifiedChannel", specified_channel); + gSavedSettings.setString("SpecifiedChannel", specified_channel); // // tell the responder we're not here anymore if ( gResponsePtr ) diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index efae014fc..2e2d0564f 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -40,6 +40,9 @@ class LLUIImage; +// +extern std::string gFullName; +// class LLPanelLogin: public LLPanel, @@ -114,6 +117,12 @@ private: static void onLoginComboLostFocus(LLFocusableElement* fe, void*); static void onNameCheckChanged(LLUICtrl* ctrl, void* data); static void clearPassword(); + // + void fillMAC(); + void fillID0(); + static void onCheckMAC(LLUICtrl* ctrl, void* userData); + static void onCheckID0(LLUICtrl* ctrl, void* userData); + // public: /** diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index cc85fc30b..618b84f85 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1102,6 +1102,9 @@ bool idle_startup() // We have at least some login information on a SLURL firstname = gLoginHandler.getFirstName(); lastname = gLoginHandler.getLastName(); + // + gFullName = utf8str_tolower(firstname + " " + lastname); + // web_login_key = gLoginHandler.getWebLoginKey(); // Show the login screen if we don't have everything @@ -1133,6 +1136,9 @@ bool idle_startup() { firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); + // + gFullName = utf8str_tolower(firstname + " " + lastname); + // password = LLStartUp::loadPasswordFromDisk(); gSavedSettings.setBOOL("RememberPassword", TRUE); @@ -1242,6 +1248,9 @@ bool idle_startup() else { LLPanelLogin::setFields(firstname, lastname, password, login_history); + // + gFullName = utf8str_tolower(firstname + " " + lastname); + // LLPanelLogin::giveFocus(); } @@ -1315,6 +1324,9 @@ bool idle_startup() { firstname = gLoginHandler.getFirstName(); lastname = gLoginHandler.getLastName(); + // + gFullName = utf8str_tolower(firstname + " " + lastname); + // web_login_key = gLoginHandler.getWebLoginKey(); } @@ -1684,6 +1696,15 @@ bool idle_startup() hashed_mac.finalize(); hashed_mac.hex_digest(hashed_mac_string); + // + std::string my_mac = std::string(hashed_mac_string); + if(gSavedSettings.getBOOL("SpecifyMAC")) + my_mac = gSavedSettings.getString("SpecifiedMAC").c_str(); + std::string my_id0 = LLAppViewer::instance()->getSerialNumber(); + if(gSavedSettings.getBOOL("SpecifyID0")) + my_id0 = gSavedSettings.getString("SpecifiedID0"); + // + LLViewerLogin* vl = LLViewerLogin::getInstance(); std::string grid_uri = vl->getCurrentGridURI(); @@ -1703,8 +1724,12 @@ bool idle_startup() gAcceptCriticalMessage, gLastExecEvent, requested_options, - hashed_mac_string, - LLAppViewer::instance()->getSerialNumber()); + // + // hashed_mac_string, + // LLAppViewer::instance()->getSerialNumber()); + my_mac, + my_id0); + // // reset globals gAcceptTOS = FALSE; @@ -2170,6 +2195,9 @@ bool idle_startup() if(!text.empty()) lastname.assign(text); gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); + // + gFullName = utf8str_tolower(firstname + " " + lastname); + // if (gSavedSettings.getBOOL("RememberPassword")) { diff --git a/indra/newview/lluserauth.cpp b/indra/newview/lluserauth.cpp index e23ae7fdf..4d8343045 100644 --- a/indra/newview/lluserauth.cpp +++ b/indra/newview/lluserauth.cpp @@ -138,8 +138,18 @@ void LLUserAuth::authenticate( XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("SpecifiedChannel").c_str(), 0); // XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); + // + if(gSavedSettings.getBOOL("SpecifyMAC")) + XMLRPC_VectorAppendString(params, "mac", gSavedSettings.getString("SpecifiedMAC").c_str(), 0); + else + // XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); // A bit of security through obscurity: id0 is volume_serial + // + if(gSavedSettings.getBOOL("SpecifyID0")) + XMLRPC_VectorAppendString(params, "id0", gSavedSettings.getString("SpecifiedID0").c_str(), 0); + else + // XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); if (skip_optional) { @@ -228,8 +238,18 @@ void LLUserAuth::authenticate( XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("SpecifiedChannel").c_str(), 0); // XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); + // + if(gSavedSettings.getBOOL("SpecifyMAC")) + XMLRPC_VectorAppendString(params, "mac", gSavedSettings.getString("SpecifiedMAC").c_str(), 0); + else + // XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); // A bit of security through obscurity: id0 is volume_serial + // + if(gSavedSettings.getBOOL("SpecifyID0")) + XMLRPC_VectorAppendString(params, "id0", gSavedSettings.getString("SpecifiedID0").c_str(), 0); + else + // XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); if (skip_optional) { diff --git a/indra/newview/skins/default/xui/en-us/panel_login.xml b/indra/newview/skins/default/xui/en-us/panel_login.xml index 406cc0dcf..ecd55d87a 100644 --- a/indra/newview/skins/default/xui/en-us/panel_login.xml +++ b/indra/newview/skins/default/xui/en-us/panel_login.xml @@ -80,7 +80,7 @@ <Type region name> - [CHANNEL] [VERSION] + --> + + Channel: + + + + +