Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flashex.mem;
- import flashex.io;
- import std.random;
- import flash.vm;
- import flash.vmex;
- import flash.swf;
- import flash.minimap;
- import Network;
- import licence;
- import base.win;
- import base.ini;
- import std.io;
- import base.gui;
- import std.string;
- import std.time;
- import std.file;
- Dialog ref toc;
- HWND text1;
- CheckBox check1,check2;
- bool rew = false;
- int[] Sig_Basnea_NaBok;
- int ItoSig;
- int[] ParPovFreez;
- bool BoolPPF;
- char[] IntToHex(int x){char[] ret;
- int a = x, i = 0; int[500] mass;
- do{x /= 16; a %= 16;
- mass[i] = a; i++; a = x;
- }while(x > 16); mass[i] = a;
- for (int j = i; j > -1; j--){
- if(mass[j] == 10) ret = ret+"A";
- else if (mass[j] == 11) ret = ret+"B";
- else if (mass[j] == 12) ret = ret+"C";
- else if (mass[j] == 13) ret = ret+"D";
- else if (mass[j] == 14) ret = ret+"E";
- else if (mass[j] == 15) ret = ret+"F";
- else ret = ret + mass[j].str();}
- if(ret.size==8){return "0"+ret;}else{
- return ret;}}
- char[] IntToSig(int a){
- char[] x = IntToHex(a);
- char[8] tazik; tazik[0] = x[6];
- tazik[1] = x[7];tazik[2] = x[4];
- tazik[3] = x[5];tazik[4] = x[2];
- tazik[5] = x[3];tazik[6] = x[0];
- tazik[7] = x[1];return ""+tazik+"";}
- void GetSetAddresPPF(){FlashObject OSGi = FlashObjectFind("ServersDropDownList");
- OSGi.GetObject("list",OSGi); if(OSGi._address > 10){
- ParPovFreez = {(OSGi._address+328)}; ItoSig = OSGi._address+328;
- Signature.Replace( ParPovFreez, "00 00 00 00 00 00 E0 3F");
- Signature.FindAndReplace("F2 0F 10 15 ?? ?? ?? ?? F2 0F 59 EA F2 0F 58 C5",
- "F2 0F 10 15 "+IntToSig(ItoSig)+" F2 0F 59 EA F2 0F 58 C5", false, true);
- BoolPPF = true; }else{BoolPPF = false;}
- }
- class HotKeyInfo{ char c; bool alt; bool ctrl; bool shift;
- void HotKeyInfo(char _c, bool _alt, bool _ctrl, bool _shift){
- c = _c; alt = _alt; ctrl = _ctrl; shift = _shift;}}
- HotKeyInfo hotkeyTest1 = HotKeyInfo('B', false, false, false);
- HotKeyControl hotKey1;
- HotKeyInfo hotkeyTest2 = HotKeyInfo('Z', false, false, true);
- HotKeyControl hotKey2;
- void EventHotKey2(Dialog ref dlg, int param)
- {
- Signature.Replace(ParPovFreez, "00 00 00 00 00 00 E0 7F"); /*Переворот*/
- Sleep(70); // Ждем 0.7 секунд
- Signature.Replace(ParPovFreez, "00 00 00 00 00 00 E0 3F"); /*Норма*/
- Beep(800,100); // ЗВУК
- }
- void EventHotKey1(Dialog ref dlg, int param)
- {
- if(!rew)
- {
- Signature.Replace(Sig_Basnea_NaBok, "90 90 90 90 90");
- text1.SetText("Башня на бок Активирована");
- }else{
- Signature.Replace(Sig_Basnea_NaBok, "F3 0F 7E 5A 38");
- text1.SetText("Башня на бок Деактивирована");
- }
- rew =! rew;
- }
- void HotKeyEvent2(Dialog ref dlg, int lparam){
- dlg.DelHotKey(hotkeyTest2.c, hotkeyTest2.alt, hotkeyTest2.ctrl, hotkeyTest2.shift);
- hotKey1.Get(hotkeyTest2.c, hotkeyTest2.alt, hotkeyTest2.ctrl, hotkeyTest2.shift); if(hotkeyTest2.c != 0)
- dlg.AddHotKey(hotkeyTest2.c, hotkeyTest2.alt, hotkeyTest2.ctrl, hotkeyTest2.shift, EventHotKey1, 1);}
- void HotKeyEvent(Dialog ref dlg, int lparam){
- dlg.DelHotKey(hotkeyTest1.c, hotkeyTest1.alt, hotkeyTest1.ctrl, hotkeyTest1.shift);
- hotKey1.Get(hotkeyTest1.c, hotkeyTest1.alt, hotkeyTest1.ctrl, hotkeyTest1.shift); if(hotkeyTest1.c != 0)
- dlg.AddHotKey(hotkeyTest1.c, hotkeyTest1.alt, hotkeyTest1.ctrl, hotkeyTest1.shift, EventHotKey1, 1);}
- void SetHotKey2(Dialog ref dlg, int param)
- {
- if(check2.IsChecked())
- {
- GetSetAddresPPF(); // Находим сигнатуру, и делаем махинации с ней.
- if(BoolPPF==true){
- Beep(1000, 200);
- hotKey2.GetHWND().Enable(true);
- dlg.AddHotKey(hotkeyTest2.c, hotkeyTest2.alt, hotkeyTest2.ctrl, hotkeyTest2.shift, EventHotKey2, 1);}
- else{MessageBox("Не получилось найти свободный адрес","Ошибка !");}
- }else{
- Beep(500, 200);
- hotKey2.GetHWND().Enable(false);//сделаем серым
- dlg.DelHotKey(hotkeyTest2.c, hotkeyTest2.alt, hotkeyTest2.ctrl, hotkeyTest2.shift);
- }
- }
- void SetHotKey1(Dialog ref dlg, int param)
- {
- if(check1.IsChecked())
- {
- Sig_Basnea_NaBok = Signature.Find("F3 0F 7E 5A 38 66 0F D6 9D B8 FE FF FF", false, true);
- if(Sig_Basnea_NaBok.size){
- Beep(1000, 200); Signature.Replace(Sig_Basnea_NaBok, "90 90 90 90 90");
- hotKey1.GetHWND().Enable(true);
- dlg.AddHotKey(hotkeyTest1.c, hotkeyTest1.alt, hotkeyTest1.ctrl, hotkeyTest1.shift, EventHotKey1, 1);
- }else{
- check1.Checked(0); hotKey1.GetHWND().Enable(false);
- dlg.DelHotKey(hotkeyTest1.c, hotkeyTest1.alt, hotkeyTest1.ctrl, hotkeyTest1.shift);
- }
- }else{Beep(500, 200); Signature.Replace(Sig_Basnea_NaBok, "F3 0F 7E 5A 38");
- hotKey1.GetHWND().Enable(false);//сделаем серым
- dlg.DelHotKey(hotkeyTest1.c, hotkeyTest1.alt, hotkeyTest1.ctrl, hotkeyTest1.shift);
- }
- }
- void closeDlg(Dialog ref Dialog, int param){
- Signature.Replace(Sig_Basnea_NaBok, "F3 0F 7E 5A 38");}
- toc = CreateDialog("Башня на бок", 200, 200, 290, 170, closeDlg);
- hotKey1 = toc.AddHotKeyControl(120, 13, 70,19, HotKeyEvent, 0);
- hotKey1.GetHWND().Enable(false);
- hotKey1.Set(hotkeyTest1.c, hotkeyTest1.alt, hotkeyTest1.ctrl, hotkeyTest1.shift);
- check1 = toc.AddCheckBox("Башня на бок", 7, 15, 100, 20, SetHotKey1, 1);
- hotKey2 = toc.AddHotKeyControl(120, 43, 70,19, HotKeyEvent2, 0);
- hotKey2.GetHWND().Enable(false);
- hotKey2.Set(hotkeyTest2.c, hotkeyTest2.alt, hotkeyTest2.ctrl, hotkeyTest2.shift);
- check2 = toc.AddCheckBox("Антипереворот", 7, 45, 100, 20, SetHotKey2, 1);
- text1 = toc.AddStatic("Tекст", 30, 80, 300, 20);
- toc.Show(true);
- toc.OnTop(1);
- toc.WaitClose();
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement