Reverse Engineering / Log or intercept program instructions - reverse-engineering

I'm trying to find a way of replicating the action / instruction that a physical button being pushed on a control panel sends to the software of a CNC machine of ours.
Ultimately I would like to integrate this instruction into an executable file I could make using AutoIT, but that is further down the line!
After some googling, resulting in all kinds of weird and wonderful results, I'm at a loss of how to begin this task. I believe I need to either use debugging software to find the instruction as it takes place, or possibly Process Monitor?
The machine runs off of a Windows XP machine.
Unfortunately obtaining this information from the manufacturer is not an option.
If anyone could help point me in the right direction that would be appreciated,
Thanks
Edit: I have since come across Windows Hooks, Detours and Interception, but still haven't made much progress!

Your topic is too broad ... You might as well be asking "How do I reverse engineer?" First thing I would do would be to load up the program in a debugger, put a breakpoint in the callback function and find out what the button is doing. What you will most likely find is that it's pushing some information onto the stack and making a call to an external .DLL such as an API or device driver ( you could probably find out which DLL using Process Monitor too ). Just load that .DLL up into your new program and make the same call.

Related

Google Chrome Crash Report Analysis

I am new to the field of crash analysis. I recently, by accident, happened to crash Google Chrome. I do not know the reason as to why the crash really happened. I'd like to know it in depth though.
When the crash happened, there was a Crash report that was generated. I have saved that report in a text file on my system, as I did not know what to do with it at the out start.
Now I have heard people in the info sec world talk about things like, analyzing and reversing a crash dump, fuzzing a crash dump etc. and trying to reproduce the crash.
I am interested in understanding how these things are done and in the first place what they actually are. I need help with resources that can help me understand how to analyze and reproduce a crash etc. I happened to come across: -Chrome: Found a crash, is it a security vulnerability? and Best way to triage crashes found via fuzzing, on Linux? but these resources seemed a bit advance and not very basic. Also googling up gave me some resources of how to analyze a BSOD in Windows, but I could not find anything relevant for Google Chrome Crash Analysis.
Please help provide some good resources where I can understand these concepts.
My Platform is Mac OSX 10.9.2 and my Google Chrome is Version 35.0.1916.153.
Im afraid this is a broad topic. For a head start, read about use after free , index out of read/write class of bugs. These are the most common in browsers.
By reproducing they mean you do the same step of things which made the browser crash and see if it is crashing again. Like lets say opening a malformed HTML/PDF/Font (or any browser input, there are many many more file types.) If you could reproduce the crash, you could attach Chrome to a debugger and check the registers at the time of crash.
To know if the crash is of any use, see this particular question on SE. For OSX, there is an amazing tool called Crashwrangler by Apple itself. If Crashwrangler reports the crash as exploitable, it is a definite security bug. Else you would need to do manual analysis to reach a conclusion. For this you need some knowledge about assembly language and software exploitation. OpenSecurityTraining has some amazing content on this. I highly recommend it. Start with x86 Assembly on the beginner section and finally MOV to reverse engineering. It is important to know how the stack is laid out in the memory and registers to understand a crash dump. I wish you all the best in the journey. Hope this helps.

Java SE binary crash

I have a Java swing application that subscribes to a lot of data and displays this data in various ways. Under heavy load I have come to encounter that the JRE simply stops working with message "Java(TM) Platform SE binary has stopped working". This obviously shuts down my application and I need to restart it. I have tried to google for ways to troubleshoot this issue as I do not get a stacktrace in my code or anything that I can work with but I have found very little useful information beyond upgrading/re-installing the JRE and running virus scans. I have done both of these measures and rebooted the server but the problem still persists. I have tried to monitor the process with Java VisualVM (see dump below) but I am no expert on this tool and may not know what to look for. The observation that I have made is that the 'crashes' appear to coincide with Garbage Collections.
The issue is quite easy to reproduce and occurs after about 10 minutes of running the application. I do not run the application with any specific jvm parameters. The Java version is 1.6.0_31 (was _25 before upgrade) and I run on Windows 7 64-bit.
In the pic below from VisualVM the Java binary has just stopped working which appears to coincide with the GC-run.
Any help or ideas so that I can troubleshoot or remedy the problem is greatly appreciated. Thanks.
Three things to check:
If you've implemented the finalize() method anywhere, make sure it doesn't directly or indirectly lock any objects; this can cause a catatrophic deadlock correlated with GC.
If you've got native code, any number of weird things can happen if the code is not using global references correctly, including deadlocks and weird memory corruption, which would again correlate with GC activity.
Finally, GC might just be "stirring the pot" and exposing vanilla deadlocks which exist otherwise in the application; check your synchronization protocols.
Garbage collection pauses the VM's application threads while it happens, which might be exposing a race condition somewhere.

What's PPC and how can I use it to make an xbox rebooter?

So I've always been interested in a type of modified xbox 360 called a jtag. Apparently do to some system checks implemented by microsoft they can no longer connect to xbox live and I want to give building a new rebooter a try.
First off, if anyone has any ideas on how to go about doing this or getting started, that would be awesome.
Secondly (this is my main question), what's PPC and how do I learn to "reverse engineer" it?
I'm following this tutorial: http://www.thetechgame.com/Forums/viewtopic/t=1086504.html and I want to know how to go about doing it. I'm assuming I've done everything right so far, I've opened up the right files in IDA and I want to start in on it, but I don't really know how.
PPC (PowerPC) is a CPU architecture and instruction set, the reference to which you can find online. You mentioned JTAG, JTAG isn't a Xbox-specific technology, it's a common hardware debugging standard.
You sound like you've never done low-level development or reverse engineering, so I'm warning you that you may be way over your head. However, having said that, the following few points should get you started:
Xbox runs a CPU that's in PowerPC family of processors. They work by reading code from memory, and executing that code. PowerPC just refers to the format that code takes, what instructions are supported and describes its general behavior.
Since you're talking about JTAG, you might need to physically open your Xbox, find some JTAG tools and solder leads to it. You will probably break your Xbox.
Googling for "software reverse engineering" should get you started, but don't expect to learn this overnight as it's a very deep and technical topic.

VS2008 partially freezing when switching to HTML design view

This is an odd freeze. When I switch from source view to design view for an HTML or ASPX file, the client area freezes, but I can still click on other tabs and menus.
What am I missing here? Really don't feel like reinstalling VS2008.
I had the same problem, and found one resolution.
In VS 2008, In a page that was using a master page, the either frequency while working in source view or switching to design view, IDE would freeze for 10-20 seconds.
In my master template, I had references to the Google hosted JQuery, Jquery UI, and one or two more scripts off site. These were placed directly in my master page's head section.
I downloaded the js and then by deleting any offsite references, my IDE would be smooth again in both design and source mode.
I also discovered I could put the scripts inside my ToolkitScriptManager (I'm using AjaxControlToolkit) and added the Mode="Release", and could place the http://www.google.com references for the scripts. The IDE is still working fine for me.
This is often due to the Design mode downloading external resources that are timing out. As #JonK mentioned, for him it was jQuery references. I have seen this when the ConnectionString was set to production databases that could not be accessed on my development machine, even though I wasn't debugging (running) the site only editing code, it would still try to connect and because it couldn't it would stall waiting for the timeout.
VS2008 is mostly single-threaded for UI operations like this, so if it is downloading a slow or non-existent network path it hangs like this.
VS2008 can make all kinds of network requests, so these two examples may not solve it for you. The best way I have found to diagnose the problem is to use the Microsoft tool Process Monitor, filter by the Process webdev.exe, and watch for I/O requests that are long running and/or throwing errors. In my case, I could find the place that was having a problem because there would be a 20 second gap in between the hundreds of I/O entries in Process Monitor. Then, just back-tracked from when that gap began and I eventually found the request that was causing the problem.
This may not be possible for you, but if you can, an upgrade to VS2010 would help; it does a much better job of running process on multiple threads in more places so you don't have to worry about this as much.
Have you tried restarting your computer and then reopening your project?

How do I produce a screenshot of a flash swf on the server?

I'm writing a flash app using the open source tools. I would like to load a data file in to the app and capture a screenshot of the stage on the server. The only part that seems mysterious is running the app on the server. In fact, I don't even care if it's the same app running on the server and in the browser--if I can use the flash stage and drawing routines to produce an image server-side, I'm happy. If I have to delve in to flex, fine. Right now I'm having problems finding any starting point at all.
I gather Adobe has some commercial products that may fit the bill, but I'd like to stick with open source, apache, and linux. I know this is probably possible with haxe/neko, but I'd like to use more mainstream tools if possible. Am I asking too much?
EDIT/CLARIFICATION: Many thanks for the responses so far, but I think I've been a bit muddy in my description. I've already written the actual stage-grabbing stuff using the same PNGEncoder class as was suggested. The problem is in actually running the swf on the server side. I don't want to let the client take the screen shot itself, because this opens up the possibility of the client maliciously submitting a screenshot which does not correspond to what is on the stage, that is, I don't want users uploading porn. If I could run the the actionscript code on the server, then I could generate the screenshot from my data files and be sure that the screenshot matches the data, but I have no idea how to run the actionscript or swf on the server.
Swfs run on a client computer, not on the server. The only way it would run on the server would be if you set up a special environment on your server so that it ran a web browser, opened up the page and ran the swf. But even then it would have no correlation to what an external user was doing.
You'll need to run it client side. As far as your security concerns, the best way to get rid of those is to have the php writing the actual image only accept an encrypted form of the image file, which the flash can encrypt. That way they can't simply use the PHP file to upload whatever image they want unless they happened to encrypt it the exact same that your swf did. Next encrypt the swf itself (I recommend SWF Shield) so that a potential hacker cannot read the code to know how to encrypt the image.
We just completed a similar project where we rendered JPGs from SWFs that loaded dynamic data, we used IECapt
Did you try actionscript print commands?
Try and look at this:
http://www.phpclasses.org/browse/package/4312.html
I know this question is long dead, but I had a similar problem and ended up writing a script using applescript + ui scripting to grab the inside area of the preview window of the standalone flash player in OS X. You can grab it off github here.
How about swfdec-thumbnailer from the swfdec-gnome package? It's used to create thumbnails of SWF files but can accept arbitrarily large resolutions with the -s argument.
EDIT: swfdec-gnome has been deprecated in Ubuntu 10.10 in favour of Gnash. Here is a guide on taking screenshots with Gnash (note that certain features like gradients are not yet properly supported).