Hooking/Scraping .NET application - automation

I would like to create a trading bot for Magic Online. If it's a concern, doing that would not violate the terms of use, and several vendors for such a bot exist. I initially started out with the DLL injection/API hooking path, but that doesn't work as it doesn't seem to call any of the standard GDI functions. My code works fine on Notepad, but does nothing on MTGO_NET. Same result with third party hooking libraries.
I then "gave up", and decided to try to use OCR. However, this weird thing happens when I try to do a screenshot of the client window: I only get the game's splash screen, no matter what the client is actually displaying. The main window device context is always the splash screen. I am guessing the client uses a separate device context to actually render the game, and I have to somehow figure out what that DC is. Does anyone have experience encountering this issue? I would gladly take any advice regarding either hooking .NET applications or how to take a screenshot.
I am testing all this on Windows Vista Ultimate 64 bit. I haven't tested this on a 32 bit installation, but I hope that isn't an issue.

I suggest you look here: http://www.mtgnews.com/showthread.php?t=191879
Which provides a link to source code for a 'working' bot.
The result of a google search............

Related

Applying Non-Standard Power Assertions & Creating Virtual HIDs

I've got a big ask here, but I am hoping someone might be able to help me. If there's another site you think this should be posted on, please let me know.
I'm the developer of the free app Amphetamine for macOS and I'm hoping to add a new feature to the app - keeping a Mac awake while in closed-display (clamshell) mode while not having a keyboard/mouse/power adapter/display connected to the Mac. I get requests to add this feature on an almost daily basis.
I've been working on a solution (and it's mostly ready) which uses a non-App Store helper app that must be download and installed separately. I could still go with that solution, but I want to explore one more option before pushing the separate app solution out to the world.
An Amphetamine user tipped me off that another app, AntiSleep can keep a Mac awake while in closed-display mode, while not meeting Apple's requirements. I've tested this claim, and it's true. After doing a bit of digging into how AntiSleep might be accomplishing this, I've come up with 2 possible theories so far (though there may be more to it):
In addition to the standard power assertion types, it looks like AntiSleep is using (a) private framework(s) to apply non-standard power assertions. The following non-standard power assertion types are active when AntiSleep is keeping a Mac awake: DenySystemSleep, UserIsActive, RequiresDisplayAudio, & InternalPreventDisplaySleep. I haven't been able to find much information on these power assertion types beyond what appears in IOPMLibPrivate.h. I'm not familiar at all with using private frameworks, but I assume I could theoretically add the IOPMLibPrivate header file to a project and then create these power assertion types. I understand that would likely result in an App Store review rejection for Amphetamine, of course. What about non-App Store apps? Would Apple notarize an app using this? Beyond that, could someone help me confirm that the only way to apply these non-standard power assertions is to use a private framework?
I suspect that AntiSleep may also be creating a virtual keyboard and mouse. Certainly, the idea of creating a virtual keyboard and mouse to get around Apple's requirement of having a keyboard and mouse connected to the Mac when using closed-display mode is an intriguing idea. After doing some searching, I found foohid. However, I ran into all kinds of errors trying to add and use the foohid files in a test project. Would someone be willing to take a look at the foohid project and help me understand whether it is theoretically possible to include this functionality in an App Store compatible app? I'm not asking for code help with that (yet). I'd just like some help determining whether it might be possible to do.
Thank you in advance for taking a look.
Would Apple notarize an app using this?
I haven't seen any issues with notarising code that uses private APIs. Currently, Apple only seems to use notarisation for scanning for inclusion of known malware.
Would someone be willing to take a look at the foohid project and help me understand whether it is theoretically possible to include this functionality in an App Store compatible app?
Taking a quick glance at the code of that project, it's clear it implements a kernel extension (kext). Those are not allowed on the App Store.
However, since macOS 10.15 Catalina, there's a new way to write HID drivers, using DriverKit. The idea is that the APIs are very similar to the kernel APIs, although I suspect it'll be a rewrite of the kext as a DriverKit driver, rather than a simple port.
DriverKit drivers are permitted to be included in App Store apps.
I don't know if a DriverKit based HID driver will solve your specific power management issue.
If you go with a DriverKit solution, this will only work on 10.15+.
I suspect that AntiSleep may also be creating a virtual keyboard and mouse.
I haven't looked at AntiSleep, but I do know that in addition to writing an outright HID driver, it's possible to generate HID events using user space APIs such as IOHIDPostEvent(). I don't know if those are allowed on the App Store, but as far as I'm aware, IOKitLib is generally fine.
It's possible you might be able to implement your virtual input device using those.

Is it possible to record screen with Titanium / Appcelerator?

We're in process of developing a desktop application which needs to record user's screen once he clicks a button. I read a tutorial about Adobe AIR, which says it is easy to do with AIR: http://www.adobe.com/devnet/air/flex/articles/air_screenrecording.html
But our preference is Titanium as we've explored it a little bit. So I want to know is that even possible? If yes, how can we get started with?
There's also an interesting solution which uses Java applet for recording, as demonstrated here: http://www.screencast-o-matic.com/create?step=info&sid=default&itype=choose
But again, we're not sure about JAVA and would like to know how can it be done? or if its even possible to run a JAVA applet in Titanium?
When you say "record screen", I'm assuming you mean video. Correct?
The only way to do this in Titanium Desktop right now is to take a bunch of screenshots and string them together (encoding would probably need to be done server-side).
Depending on how long your videos need to be, this probably won't work for you. I'm also not confident in how quickly you could capture screenshots, and if it would have a high enough frame rate to be usable.
Past that, a module could be developed for Desktop to support some native APIs to record video. That's not something I see on the horizon, though.
I hope this helps, albiet a rather dismal answer. -Dawson

Quickest way to convert a VB.Net desktop application to a mobile web application?

I have an application that is written in VB.NET, using the System.Windows.Forms.Form as the front-end GUI.
It runs perfectly on my Windows machine however recently there is a business requirement to convert this application to run as a web application so that people could view them in their blackberries when they go to the URL.
Is there any quick way to perform such a conversion or I will have to translate the code line-by-line for such cases?
Any help is appreciated!
Thanks!
Is there any quick way to perform such a conversion
No, not that meets your requirements. You can build custom winforms controls that can be hosted in internet explorer, but that won't help users accessing your app from a blackberry.
will I have to translate the code line-by-line for such cases?
No, it's much worse than that. Many of the things you do in a Winforms app just won't translate to the web well. You'll have to re-write and re-think a lot of your existing code. Essentially, you're not only re-building the app from from scratch, but you're doing it for a platform with which you have no prior experience. In other words, it might even take longer than building the original.
I know it's not what you were hoping to hear, but thems the breaks.

Convert Smart Device Dll to ActiveX control for Windows Mobile

I am using C# and Visual Studio 2008.
I have a class that will turn on the scanner of my Windows Mobile Device and then will capture the read of the scanner when pressed. It will also shut down appropriately and cleanly. I am using a vendor provided SDK to do a lot of the heavy lifting.
I have this working correctly in a Mobile App, but I also need the dll to be able to be called via COM/ActiveX from a web site. I have been going around and around about how to do this. I've bounced between various settings and project types. I've tried converting it over to C++ and ATL. But so far nothing works.
I get conflicting information depending upon where I look. I need help. Can only C++ do this? Is there something I'm missing? I can't be the only person needing to do this. How can I do this?
You cannot create ActiveX/COM components in managed code with the Compact Framework. There is not EE Hosting support, so it simply cannot be done. You will have to write this in C++ (not managed C++, but old-fashioned native).
As a side note that is sometimes overlooked on COM controls, you also have to implement IObjectSafety for the control to work in a browser.

Access the stage in the Flash CS4 IDE

The stage in the Flash CS4 Authoring Enviroment is a running SWF. That what makes thing like the 3D and Bone Tools to work in the IDE.
Is it possible to access that swf ? I suspect the immediate answer would be no because that would raise some security issues maybe and cause lots of developers to crash the IDE every 5 minutes :).
That said I don't expect this to be a straight forward process, but I guess there should be a way to access that.
Any thoughts ?
I can only tell you how components work on the stage, where we've attempted the type of access you talk about.
I suspect that at their core, the 3d and bone tools are implemented using component-like tech to display the "live" stage instance. In general this would involve a compiled instance of a live preview swf that is placed on the stage. It is misleading to think of the stage as a single player. Each component preview runs in its own sandbox that, as far as I can tell, has no means of communication with other component previews on the IDE stage. There is no common storage location.
Of course, if you were in charge of the preview swf (as with the case of a component), you could try LocalConnection to chat, but the previews you want to penetrate are closed. I suspect if you dig hard enough, you'd find the bone/3d preview hidden in the installation folders (perhaps in a swc.. ik.swc looks interesting) and might be able to hack about at it with a decompiler, but straight out the box, I'm not sure there's a solution to what you ask.