Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Criado oficialmente por TheGuruSupremacy
- // Script Atualizado, Corrigido, Traduzido por Bruno da SIlva
- // www.ips-team.blogspot.com
- var PatchOld = "\x0F\x85\x9E\x00\x00\x00"
- var PatchNew = "\xE9\x9F\x00\x00\x00\x90"
- var PatchAddress9
- var Active = new Boolean();
- var ShowToast = new Boolean();
- var PatchOldUnlimitedNudge = "\x8B\x86\x60\x03\x00\x00"
- var PatchNewUnlimitedNudge = "\x33\xC0\x40\x90\x90\x90";
- var PatchIconOld = "\x53"
- var PatchIconNew = "\x50"
- var AddressIcon
- var Address
- var delay = new Array()
- var NudgesNumber = new Array()
- var Installed = new Boolean()
- var WNDAbout
- var i
- function OnAboutWNDEvent_CtrlClicked(PlusWnd, ControlId)
- {
- WNDAbout = PlusWnd
- if (ControlId == "Button2")
- {
- PlusWnd.Close(1)
- }
- else if (ControlId == "LinkID")
- {
- new ActiveXObject("WScript.Shell").run("http://pastebin.com/Rc6yTtWh")
- }
- else if (ControlId == "Button3")
- {
- new ActiveXObject("WScript.Shell").run("http://pastebin.com/Rc6yTtWh")
- }
- }
- function OnNDSOptionsEvent_CtrlClicked(PlusWnd, ControlId)
- {
- if (ControlId == "BtnOk")
- {
- var oShell = new ActiveXObject("WScript.Shell")
- if (PlusWnd.Button_IsChecked("ShowToast") == true)
- {
- oShell.RegWrite(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\ShowToast", true & 1, "REG_DWORD");
- }
- else if (PlusWnd.Button_IsChecked("ShowToast") == false)
- {
- oShell.RegWrite(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\ShowToast", false & 1, "REG_DWORD");
- }
- PlusWnd.Close(1)
- }
- }
- function GetTempPath()
- {
- var sBuffer = Interop.Allocate((260 + 1) * 2);
- Interop.Call('kernel32', 'GetTempPathW', 100, sBuffer);
- return sBuffer.ReadString(0);
- }
- function DownloadFile(FileName)
- {
- try
- {
- var Path = GetTempPath() + "\\NDS.plsc"
- Debug.Trace(Path)
- MsgPlus.DownloadFile(FileName, Path)
- }
- catch (exception)
- {
- MsgPlus.DisplayToast("NudgesToolsSCRIPT", exception)
- }
- }
- function OnEvent_DownloadFileComplete(Url, OutFile, Success)
- {
- if (Url == "http://pastebin.com/Rc6yTtWh")
- {
- if (Success == true)
- {
- try
- {
- Debug.Trace("Instalando ..")
- Interop.Call('shell32', 'ShellExecuteW', 0, 'open', OutFile, '', '', 1)
- }
- catch (exception)
- {
- MsgPlus.DisplayToast("NudgesToolsSCRIPT", exception)
- }
- }
- }
- }
- function OnEvent_Initialize(bMessengerStart)
- {
- if (Messenger.MyStatus > 0) OnEvent_Signin();
- }
- function OnEvent_Signin(sEmail)
- {
- PatchAddress9=[0x562E3E,0x564266,0x564A4F,0x4FACB7]
- Address=[0x562EE2,0x56430A,0x564AF3,0x5647EC]
- if (Messenger.Version <= 8.5)
- {
- MsgPlus.DisplayToast("NudgesTools", "NudgesToolsScript 2.0 não é compactível com sua versão atual do msn", "", "Nova Versao", "http://pastebin.com/Rc6yTtWh")
- return ""
- }
- else if(Messenger.VersionBuild==8050){i=0}else if(Messenger.VersionBuild==8064){i=1}else if(Messenger.VersionBuild==8089){i=2}else if(Messenger.VersionBuild==8117){i=3}
- Installed = true
- var oShell = new ActiveXObject("WScript.Shell");
- var hProc = Interop.Call("Kernel32", "GetCurrentProcess");
- var Handle = Interop.Call("Kernel32", "GetModuleHandleW", null)
- Debug.Trace(Handle.toString(16))
- Address[i] = (Address[i] - 0x00400000) + Handle
- AddressIcon[i] = (AddressIcon[i] - 0x00400000) + Handle
- PatchAddress9[i] = (PatchAddress9[i] - 0x00400000) + Handle
- Debug.Trace(Address[i])
- var sBuffer = Interop.Allocate(PatchOld.length);
- Interop.Call("Kernel32", "ReadProcessMemory", hProc, PatchAddress9[i], sBuffer.DataPtr, PatchOld.length, 0);
- var sReturn = "";
- for (var j = 0; j < sBuffer.size; j++) sReturn += String.fromCharCode(sBuffer.GetAt(j) & 0xFF);
- Debug.Trace(sReturn)
- if (sReturn === PatchOld || sReturn === PatchNew)
- {
- try
- {
- Active = Boolean(oShell.RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\NudgesTools"));
- }
- catch (exception)
- {
- Active = false;
- }
- if (Active == false)
- {
- Patch(PatchAddress9[i], PatchOld)
- Patch(Address[i], PatchOldUnlimitedNudge)
- Patch(AddressIcon[i], PatchIconOld)
- }
- else
- {
- Patch(PatchAddress9[i], PatchNew)
- Patch(Address[i], PatchNewUnlimitedNudge)
- Patch(AddressIcon[i], PatchIconNew)
- }
- oShell.RegWrite(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\NudgesTools", Active & 1, "REG_DWORD");
- try
- {
- ShowToast = Boolean(oShell.RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\ShowToast"));
- }
- catch (exception)
- {
- ShowToast = false;
- Installed = false
- }
- if (Installed == false)
- {
- oShell.RegWrite(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\ShowToast", true & 1, "REG_DWORD");
- MsgPlus.DisplayToast("NudgesTools", "Nudges Tools Script " + (Active ? "Ativado" : "Disabled"));
- }
- if (ShowToast != false)
- {
- MsgPlus.DisplayToast("NudgesTools", "Nudges Tools Script " + (Active ? "Ativado" : "Disabled"));
- }
- return;
- }
- Address = 0
- MsgPlus.DisplayToast("NudgesTools", "Windows Live Messenger " + Messenger.Version.toFixed(1) + ".0" + Messenger.VersionBuild + "\n não é suportado");
- }
- function OnGetScriptMenu(nLocation)
- {
- if (Address !== 0) return "<ScriptMenu>" + "<MenuEntry Id=\"MnuNudgesTools\">" + (Active ? "Desativado" : "Ativado") + "</MenuEntry>" + "<MenuEntry Id=\"MnuNudgesToolsOption\">" + ("Opções") + "</MenuEntry>" + "<MenuEntry Id=\"MnuNudgesToolsAbout\">" + ("Sobre") + "</MenuEntry>" + "</ScriptMenu>";
- }
- function OnGetScriptCommands()
- {
- var commands = "<ScriptCommands>";
- commands += " <Command>"
- commands += " <Name>sendnudge</Name>"
- commands += " <Description>Enviar atenções automáticamente</Description>"
- commands += " </Command>"
- commands += " <Command>"
- commands += " <Name>stopnudge</Name>"
- commands += " <Description>Para de enviar as atenções</Description>"
- commands += " </Command>"
- commands += "</ScriptCommands>"
- return commands;
- }
- function OnEvent_ChatWndSendMessage(ChatWnd, Message)
- {
- if (Message == "/stopnudge")
- {
- NudgesNumber[ChatWnd.Handle] = 0
- return "";
- }
- var Splitter = Message.substring(11, Message.length)
- if (Message.substring(0, 10) == "/sendnudge")
- {
- if (Active == false)
- {
- Interop.Call("user32", "MessageBoxW", null, "Nudges Tool encontra-se desabilitado, olhe as configurações", "Okay", 0)
- return ""
- }
- else
- {
- Splitter = Splitter.split(" ")
- if (Splitter[1] != null)
- {
- delay[ChatWnd.Handle] = Splitter[1]
- }
- else
- {
- delay[ChatWnd.Handle] = 1000
- }
- NudgesNumber[ChatWnd.Handle] = Splitter[0]
- MsgPlus.AddTimer(ChatWnd.Handle, delay[ChatWnd.Handle])
- return "";
- }
- }
- }
- function Enable()
- {
- var oShell = new ActiveXObject("WScript.Shell")
- if (Active == true)
- {
- Patch(Address[i], PatchOldUnlimitedNudge)
- Patch(PatchAddress9[i], (Active = !Active) ? PatchNew : PatchOld)
- Patch(AddressIcon[i], PatchIconOld)
- }
- else if (Active == false)
- {
- Patch(Address[i], PatchNewUnlimitedNudge)
- Patch(PatchAddress9[i], (Active = !Active) ? PatchNew : PatchOld)
- Patch(AddressIcon[i], PatchIconNew)
- }
- oShell.RegWrite(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\NudgesTools", Active & 1, "REG_DWORD");
- MsgPlus.DisplayToast("NudgesTools", "Nudges Tools Script " + (Active ? "Enabled" : "Disabled"));
- }
- function OnEvent_MenuClicked(sMenuId, nLocation, iOriginWnd)
- {
- if (sMenuId == "MnuNudgesToolsOption")
- {
- ShowOptionsWindow()
- }
- else if (sMenuId == "MnuNudgesToolsAbout")
- {
- var WindowOptions = MsgPlus.CreateWnd("About.xml", "AboutWND")
- }
- else
- {
- Enable()
- }
- }
- function Patch(nAddress, sByteString)
- {
- var sBuffer = Interop.Allocate(++sByteString.length);
- for (var j = 0; j < sByteString.length; j++) sBuffer.WriteWORD(j, sByteString.charCodeAt(j));
- var hProc = Interop.Call("Kernel32", "GetCurrentProcess");
- Interop.Call("Kernel32", "WriteProcessMemory", hProc, nAddress, sBuffer.DataPtr, sByteString.length, 0);
- }
- function ShowOptionsWindow()
- {
- var oShell = new ActiveXObject("WScript.Shell")
- var WindowOptions = MsgPlus.CreateWnd("Options.xml", "NDSOptions")
- var Show = new Boolean()
- Show = Boolean(oShell.RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\ShowToast"));
- if (Show == true)
- {
- WindowOptions.Button_SetCheckState("ShowToast", true)
- }
- }
- function OnEvent_Timer(Timerid)
- {
- var ChatWnd
- var WMCOMMAND = 273
- for (var e = new Enumerator(Messenger.CurrentChats); !e.atEnd(); e.moveNext())
- {
- var ChatWindow = e.item();
- if (ChatWindow.Handle == Timerid)
- {
- ChatWnd = ChatWindow
- break
- }
- }
- if (ChatWnd != null)
- {
- if (NudgesNumber[Timerid] == 0)
- {}
- else
- {
- var Window = ChatWnd.Handle
- Interop.Call("user32", "SendMessageW", Window, WMCOMMAND, 689, 0)
- NudgesNumber[Timerid]--MsgPlus.AddTimer(Timerid, delay[ChatWnd.Handle])
- }
- }
- else
- {
- delete NudgesNumber[Timerid];
- delete delay[ChatWnd.Handle];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement