Esempio n. 1
0
 public void DragDrop(string srcName, string dstName, int srcOffsetX = 10, int srcOffsetY = 10, int dstOffsetX = 10, int dstOffsetY = 10)
 {
     LogErr(CppDll.EBLeftDown(mHwnd, srcName, srcOffsetX, srcOffsetY));
     Thread.Sleep(CD);
     LogErr(CppDll.EBMoveTo(mHwnd, dstName, dstOffsetX, dstOffsetY));
     Thread.Sleep(CD);
     LogErr(CppDll.EBLeftUp(mHwnd, dstName, dstOffsetX, dstOffsetY));
     Thread.Sleep(CD);
 }
Esempio n. 2
0
        // helpers

        public void Children(string objName, string retName = null)
        {
            string name = retName != null ? retName : "_children";

            LogErr(CppDll.EBGetAttr(objName, "children", name));
            LogErr(CppDll.EBGetAttr(name, "_childrenObjects", name));
            if (retName == null)
            {
                Trace(CppDll.EBStr(name));
            }
        }
Esempio n. 3
0
        public int IsTrue(string objName)
        {
            int result = CppDll.EBIsTrue(objName);

            if (result < 0)
            {
                LogErr("Call EBIsTrue on " + objName + "failed.");
                return(-1);
            }
            return(result);
        }
Esempio n. 4
0
 public void Run(RemoteHooking.IContext context, String channelName, String workingDir, String initPath, String scriptPath)
 {
     try
     {
         CppDll.EBInit();
         adapter.Run(workingDir, initPath, scriptPath);
     }
     catch (Exception ex)
     {
         injector.ReportException(ex);
     }
     return;
 }
Esempio n. 5
0
 public void Press(string input)
 {
     string[] tokens = ParseInput(input);
     for (int i = 0; i < tokens.Length; ++i)
     {
         CppDll.EBKeyDown(mHwnd, mKeys[tokens[i]]);
         Thread.Sleep(InnerCD);
     }
     Thread.Sleep(CD);
     for (int i = tokens.Length - 1; i >= 0; --i)
     {
         CppDll.EBKeyUp(mHwnd, mKeys[tokens[i]]);
         Thread.Sleep(InnerCD);
     }
     Thread.Sleep(CD);
 }
Esempio n. 6
0
        private void PushArgs(object[] args)
        {
            LogErr(CppDll.EBClearArgBuff());
            if (args == null)
            {
                return;
            }

            for (int i = 0; i < args.Length; ++i)
            {
                object o = args[i];
                Type   t = o.GetType();
                if (t == typeof(string))
                {
                    string s = (string)o;
                    if (s.Contains(OBJ_PREFIX))
                    {
                        LogErr(CppDll.EBPushObject(s.Substring(OBJ_PREFIX.Length)));
                    }
                    else
                    {
                        LogErr(CppDll.EBPushString(s));
                    }
                }
                else if (t == typeof(bool))
                {
                    LogErr(CppDll.EBPushBool((bool)o));
                }
                else if (t == typeof(double))
                {
                    LogErr(CppDll.EBPushDouble((double)o));
                }
                else
                {
                    LogErr("Unknow arg type: " + o.ToString());
                }
            }
        }
Esempio n. 7
0
 public void Wheel(string objName, int dz, int offsetX = 10, int offsetY = 10)
 {
     LogErr(CppDll.EBWheel(mHwnd, objName, dz, offsetX, offsetY));
     Thread.Sleep(CD);
 }
Esempio n. 8
0
        // mouse

        public void MoveTo(string objName, int offsetX = 10, int offsetY = 10)
        {
            LogErr(CppDll.EBMoveTo(mHwnd, objName, offsetX, offsetY));
            Thread.Sleep(CD);
        }
Esempio n. 9
0
 public void GetParent(string objName, string retName)
 {
     LogErr(CppDll.EBGetAttr(objName, "parent", retName));
 }
Esempio n. 10
0
 public void FindChild(string objName, string childName, string retName)
 {
     LogErr(CppDll.EBClearArgBuff());
     LogErr(CppDll.EBPushString(childName));
     LogErr(CppDll.EBCallMemberMethod(objName, "_FindChildByName", retName));
 }
Esempio n. 11
0
 public string ToStr(string objName)
 {
     return(CppDll.EBStr(objName));
 }
Esempio n. 12
0
 public void CallMemberMethod(string varName, string methodName, string argStr = null, string retName = null)
 {
     PushArgs(ParseArgStr(argStr));
     LogErr(CppDll.EBCallMemberMethod(varName, methodName, retName));
 }
Esempio n. 13
0
 public void GetModuleObject(string moduleName, string objectName, string varName)
 {
     LogErr(CppDll.EBGetDictItem(moduleName + "dict", objectName, varName));
 }
Esempio n. 14
0
 public void Dir(string objName)
 {
     Trace(CppDll.EBDir(objName));
 }
Esempio n. 15
0
 public double GetDouble(string varName, string attrName)
 {
     return(CppDll.EBGetFloat(varName, attrName));
 }
Esempio n. 16
0
 public long GetInt(string varName, string attrName)
 {
     return(CppDll.EBGetInt(varName, attrName));
 }
Esempio n. 17
0
 public void GetAttr(string varName1, string attrName, string varName2)
 {
     LogErr(CppDll.EBGetAttr(varName1, attrName, varName2));
 }
Esempio n. 18
0
 public void GetTupleItem(string dictName, int index, string varName)
 {
     LogErr(CppDll.EBGetTupleItem(dictName, index, varName));
 }
Esempio n. 19
0
 public void GetDictItem(string dictName, string itemName, string varName)
 {
     LogErr(CppDll.EBGetDictItem(dictName, itemName, varName));
 }
Esempio n. 20
0
 public void DoubleClick(string objName, int offsetX = 10, int offsetY = 10)
 {
     LogErr(CppDll.EBDoubleClick(mHwnd, objName, offsetX, offsetY));
     Thread.Sleep(CD);
 }
Esempio n. 21
0
 public string GetString(string varName, string attrName)
 {
     return(CppDll.EBGetString(varName, attrName));
 }
Esempio n. 22
0
 public void Import(string moduleName)
 {
     LogErr(CppDll.EBImportModule(moduleName));
     LogErr(CppDll.EBGetModuleDict(moduleName, moduleName + "dict"));
 }
Esempio n. 23
0
 public int GetBool(string varName, string attrName)
 {
     return(CppDll.EBGetBool(varName, attrName));
 }
Esempio n. 24
0
        // python

        public void Str(string objName)
        {
            Trace(CppDll.EBStr(objName));
        }