EEVblog Electronics Community Forum

Products => Computers => Programming => Topic started by: hennep on August 31, 2021, 12:54:37 pm

Title: Reverse engineering tool as requested by Dave Jones
Post by: hennep on August 31, 2021, 12:54:37 pm
I have created a tool to load 2 separate images and show these with transparency.
See Dave's video: https://youtu.be/GOk1BYKSsOI

(https://hennep.home.xs4all.nl/revenge.png)

The tool is developed with Code::Blocks and wxWidgets in Linux.
I don't have a working Code::Blocks installation on Windows.
If somebody can offer some help to compile this on Windows, it will be appreciated.

The project:
https://github.com/HenniePeters/RevEngE

cheers,
Hennie
Title: Re: Reverse engineering tool as requested by Dave Jones
Post by: Nominal Animal on September 01, 2021, 08:34:38 am
You know, you could do the same directly in the browser, with a bit of HTML5 and JavaScript.

Such pages do not require a network connection.  For example, my FIR filter example (https://www.nominal-animal.net/answers/fir-analysis.html) –– just type some coefficients, say 1 0 1 in the top text box, and press Enter, and it'll show the FIR filter frequency response for that filter –– you can save as a HTML page on your own computer, and it'll work exactly like it would when loaded from a server.  (That example is in Public Domain, so if you wanted to play with how to do such pages using HTML, JavaScript, and the Canvas element as defined in HTML5, feel free!)

The reason I personally like such "tool pages" is that they work on basically all devices as-is, including tablets, which are useful for browsing datasheets and such while using other tools to do some work.  If I recall correctly, you may need a network connection and a helpful server to implement drag-and-drop of images.  I'd use text boxes with direct URLs to the images, using file:// urls for files on the local machine, since that should always work.  The only real difficulty is making them responsive: because JavaScript isn't that fast, you may need to use timers and callbacks to do display updates, instead of directly in the event handlers.  If you use the event handlers directly, on slower machines (like tablets!) the UI may be jerky, unresponsive while "computing" the next state.  So, there is some art in this too, even though it is just HTML + CSS + JavaScript.
Title: Re: Reverse engineering tool as requested by Dave Jones
Post by: mrflibble on September 01, 2021, 10:51:29 am
The tool is developed with Code::Blocks and wxWidgets in Linux.
I don't have a working Code::Blocks installation on Windows.
If somebody can offer some help to compile this on Windows, it will be appreciated.

If you do have a working development environment on linux, you could do a cross-compile for windows. Code::Blocks is a cross-platform IDE after all, it even says so on the wiki. And since the codeblocks.org webserver keeps crapping out with a 502, here's a wayback snapshot of the cross-compile instructions:

https://web.archive.org/web/20200429154954/https://wiki.codeblocks.org/index.php/Cross_Compiling_wxWidgets_Applications_on_Linux
Title: Re: Reverse engineering tool as requested by Dave Jones
Post by: mrflibble on September 01, 2021, 11:08:49 am
You know, you could do the same directly in the browser, with a bit of HTML5 and JavaScript.
That sounds suspiciously much like ... work.  :o

Better living through laziness and ImageMagick:

apt-get install imagemagick && man imagemagick composite

Quote
Such pages do not require a network connection.  For example, my FIR filter example (https://www.nominal-animal.net/answers/fir-analysis.html) –– just type some coefficients, say 1 0 1 in the top text box, and press Enter, and it'll show the FIR filter frequency response for that filter –– you can save as a HTML page on your own computer, and it'll work exactly like it would when loaded from a server.  (That example is in Public Domain, so if you wanted to play with how to do such pages using HTML, JavaScript, and the Canvas element as defined in HTML5, feel free!)
Hey, neat!  :-+ Just had a bit fun plugging in some sequences. Response seems pretty snappy.

Quote
The reason I personally like such "tool pages" is that they work on basically all devices as-is, including tablets, which are useful for browsing datasheets and such while using other tools to do some work.  If I recall correctly, you may need a network connection and a helpful server to implement drag-and-drop of images.  I'd use text boxes with direct URLs to the images, using file:// urls for files on the local machine, since that should always work.  The only real difficulty is making them responsive: because JavaScript isn't that fast, you may need to use timers and callbacks to do display updates, instead of directly in the event handlers.  If you use the event handlers directly, on slower machines (like tablets!) the UI may be jerky, unresponsive while "computing" the next state.  So, there is some art in this too, even though it is just HTML + CSS + JavaScript.
In principle I 100% agree with you here. Unfortunately whenever I try this myself, I always break out in a horrible rash. JavaScript allergy.  :'(
Title: Re: Reverse engineering tool as requested by Dave Jones
Post by: hennep on September 01, 2021, 09:58:04 pm
Thanks for pointing to the cross compiling option in code:blocks. I missed that completely.

I made a demonstration video (http://youtu.be/EJqDZQXWfjQ) for the tool.
Title: Re: Reverse engineering tool as requested by Dave Jones
Post by: hennep on December 24, 2021, 12:58:02 pm
I've created a windows version for the tool with Borland C++Builder.
A windows binary is available on github including source files.
https://github.com/HenniePeters/RevEngE
Title: Re: Reverse engineering tool as requested by Dave Jones
Post by: DrG on December 24, 2021, 05:44:08 pm
I looked at the vid - nice!

So, I for the few times that I have wanted to, I do it manually using PS (and an old version that you could buy, not rent). Not going to harangue you about...make it do this...and make it do that, but I did this one today and I noticed (again) that PS offers all sorts of options that can come in handy (i.e., you might want to consider adding - or not). For example, to emphasize the traces on the reverse I changed color on them and the effect is noticeable.

(https://www.eevblog.com/forum/programming/reverse-engineering-tool-as-requested-by-dave-jones/?action=dlattach;attach=1358558;image)

(https://www.eevblog.com/forum/programming/reverse-engineering-tool-as-requested-by-dave-jones/?action=dlattach;attach=1358564;image)

(https://www.eevblog.com/forum/programming/reverse-engineering-tool-as-requested-by-dave-jones/?action=dlattach;attach=1358570;image)

Again, nice job on what you have done and shared!

Title: Re: Reverse engineering tool as requested by Dave Jones
Post by: hennep on December 27, 2021, 11:16:23 am
emphasize the traces on the reverse I changed color on them and the effect is noticeable.
How did you emphasize the traces?  By changing contrast?
If that is a simple algoritm I could try to add it to the program. I don't know how yet, but...
Title: Re: Reverse engineering tool as requested by Dave Jones
Post by: DrG on December 27, 2021, 04:04:24 pm
emphasize the traces on the reverse I changed color on them and the effect is noticeable.
How did you emphasize the traces?  By changing contrast?
If that is a simple algoritm I could try to add it to the program. I don't know how yet, but...

No, by substitution of a picked color. This may not be so easy to do programmatically, especially with me explaining, although if you have experience with PS, you can figure out how to do it. Also, it is not the trace but rather the outline of the trace.

Operating on the reverse layer, in this case, I use the eye dropper to pick a color and then replace that color, with red in the example below (I used black in my original post). You can select only an area of the layer and also futz with the fuzzy slider to avoid unwanted common colors.

(https://www.eevblog.com/forum/programming/reverse-engineering-tool-as-requested-by-dave-jones/?action=dlattach;attach=1361459;image)

Then, when you decrease opacity on the layer, the color is emphasized across the flip and blend.

(https://www.eevblog.com/forum/programming/reverse-engineering-tool-as-requested-by-dave-jones/?action=dlattach;attach=1361465;image)

As I said, this may not be too easy to do programmatically and with me explaining :)