How to convert wasm back to C++ if I also have the original code

66
October 15, 2021, at 3:20 PM

I'm not the best at explaining this stuff but here I go.

I have a program that uses "tesseract.js" to read an image every second or so.
10% of images have an "Empty page!!" error message, but I don't need or want this error message flooding my otherwise useful error log. I want to remove it from the source code, however, it isn't fired from the easily readable js code...

I assume it is fired from the wasmBinaryFile section, which (if I understand correctly) is a wasm binary compiled version of the original C++ (Tesseract 4.1.1)
In C++ Tesseract, the error message is fired from \src\textord\colfind.cpp line 366. If I knew where the equivalent section of the binary code was, I assume that I could remove it.

I know that decompiling wasm to C++ won't necessarily be understandable, but if I did it, would I be able to compare it to the source code for Tesseract and either find the section I need to remove or be able to recompile it for use again?

If so, would someone be able to point me towards a good software to do this?

Answer 1

You don't need to revers engineer that code, tesseract is open source, has a github page and you can look at the source code here : https://github.com/tesseract-ocr/tesseract/blob/main/src/textord/colfind.cpp. It also means you can use git to get a local copy, modify and compile it. Probably you can even find a way to change tprintf

READ ALSO
Module not found: Error: Can't resolve 'fsevents' in '/var/www/html/node_modules/chokidar/lib' [closed]

Module not found: Error: Can't resolve 'fsevents' in '/var/www/html/node_modules/chokidar/lib' [closed]

Want to improve this question? Add details and clarify the problem by editing this post

34
How to Inject JavaScript in Web Page to Automatically Hit Refresh Button

How to Inject JavaScript in Web Page to Automatically Hit Refresh Button

I want to update the given dataset every 1 minideally, so far I've understood the best scenario is either every 1h or every 15min from Power BI

38
How to handle duplicate dates in dates ranges in python

How to handle duplicate dates in dates ranges in python

Imagine an employee that has worked for different companies and you want to know how many months he worked for each companyThe problem is that he may have worked for two companies, overlapping some time (case of companies D and C)

53
Add foldable sections to HTML email?

Add foldable sections to HTML email?

When looking for how webpages can make foldable sections, usually they dive straight into JavaScript and customizing the design

45