Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop initial PoC driver #1

Open
zgypa opened this issue Nov 19, 2024 · 3 comments
Open

Develop initial PoC driver #1

zgypa opened this issue Nov 19, 2024 · 3 comments
Assignees

Comments

@zgypa
Copy link
Member

zgypa commented Nov 19, 2024

Develop a Python software program that is able to show that it is possible to achieve basic functionality to control the VIDAR scanner via USB. The proof of concept should be able to:

  • ability to ping/test if online, get scanner info
  • initiate a scan
  • save the scanned image in a readable format
  • list available/supported instructions and scanning options.
@zgypa
Copy link
Member Author

zgypa commented Jan 15, 2025

The reverse engineering of the SCSI protocol is more complex than expected: there were hundreds of packets in the exchange (about 900 for the startup sequence). However @BaileyDalton007 was able to find the DLLs which were in C++ and obfuscated. However, the headers are not obfuscated, which would allow him to write C# code and use them directly.

Once the code is written in C#, we can either run this application on a miniPC (like a Zotac) with Windows with support for x86 32bit apps connected to the scanners.

He decompiled the Vidar Scanner Pro dot net software with ILSpy, which is not obfuscated. He is reverse engineering that, by calling the Vscsi32.dll the same way it does, by using C#, since the definitions in the DLL are obfuscated. However decompilation is not perfect, and can therefore not just copy and paste into his own project. Even the types that are the original symbol, the actual structure is not preserved (only the size in the block of memory is). So he has to figure out the structure based on its usage.

The new thing is that he is able to perform the startup sequence finds out the type of scanner.

First function he tried to replicate, was the calibrate, because it doesn't require any parameters, however it was throwing errors. So he figured he should start

Next steps would to continue writing functions for the startup sequence, (he is probably at 10% of the startup sequence?). He has already found the decompiled code that takes care of the scanning.

So far he has logged 30h.

@BaileyDalton007
Copy link
Contributor

BaileyDalton007 commented Jan 18, 2025

Finished the process of parsing values for the startup sequence (pictured below) by reverse engineering the structure of the response sent by Vscsi32.getDigInfo().

The rest of the startup sequence looks to be saving specific config things to the windows registry, which I do not think would be worth reverse engineering in this case. If I come across another place in the code where it is used then I may revisit it.

Image

@BaileyDalton007
Copy link
Contributor

Finished capabilities for scanner calibration and film ejection.
Next up is the scanning procedure, which will be considerably more complex, so I will wait for another day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants