Forum

Please or Register to create posts and topics.

Server mode - automatic code calculation and dump processing via Pipes

Page 1 of 2Next

How many of you will be interested in the special “server” mode of the CWP-2 application? As I have more and more clients using the Code Wizard Pro 2 app who provide codes to their users through mobile apps, automated bots and instant messengers, I'm thinking about adding this functionality.

Let me explain what I mean:

  • In the “server” mode, all data will be processed automatically - without any user confirmation of the cost of calculation in tokens, the use of third-party services for unavailable codes in offline mode, etc.
  • All communication will be carried out through the Pipes functionality - you send a request via Pipes like “Nissan:Alg4:VIN” and receive an instant response with the calculated code the same way, via Pipes. Additionally, all processing work will be shown in the application as if you were entering all the data manually.
  • Also you can enter required data manually and get calculated code as always in the app and via Pipes at the same time. Just kidding, it’s faster through Pipes - no unnecessary delays or pauses.
  • Moreover, you can calculate codes by dump in the "server" mode to. Just provide the path to the file, for example "KIA:Alg2:Path to file".

If you don't know what Pipes are and how to use them - https://learn.microsoft.com/en-us/windows/win32/ipc/pipes

I look forward to your opinions and anything else that I can include in the “server” mode to make your work easier and automate the processing of client requests.

Here you can find various examples of implementing Pipes:

https://bloomfield.online/posts/introduction-to-win32-named-pipes-cpp/

https://stackoverflow.com/questions/1849918/pipe-communication-c/

https://www.codeproject.com/Articles/20494/Simple-Managed-Wrapper-for-Windows-Pipes

https://www.codeproject.com/Articles/7176/Inter-Process-Communication-in-NET-Using-Named-Pip

Code Wizard Pro Team

Certain calculations present two price options. For instance:

Hyundai KEY code by VIN (1986-17) 7/10*

it would be nice if provide a predefined list of VINs with specific characters that allows us to determine whether the price is 7 or 10.

I suggest implementing a feature that allows the program to start with a specified dongle by serial, for example if someone have two dongles connected he can send the startup command with the specified dongle serial

Not only would this feature improve efficiency, but it would also enhance the scalability of the software.

This is a response to one of the email to better explain how it works for those who are far from programming:

It is like a peer-to-peer communication between two or more applications on a local computer or on a network. Imagine working through a terminal and sending a commands to perform certain actions and instantly receiving a response. Or you don't send the commands, but work through the GUI, but the responses are displayed in the terminal.

I've already started working on this. For now, a command line parameter has been added when starting the application, which disables all questions and confirmations in the program, and the delay when calculating the code.

Code Wizard Pro Team

By the way, what about the delay before showing the calculated code? If I leave it as is, will it be okay for you or is it better to remove the delay? This turns out to be a double-edged sword. If I remove the delay, it will be possible to restore some algorithms by simply sending requests to the entire range of codes. I'm talking about free calculations that do not require tokens. Yes, even in automatic mode, it will take from a few minutes to several days or weeks or months, depending on the algorithm. And to be honest, I don’t want this to happen at all. On the other hand, if I remove the delay, you receive the calculated codes instantly, within 1 second, maximum within 3 seconds.

I need your opinion, are you okay with an additional delay of 5 seconds, or do you want to receive the calculated code in 1-3 seconds?

Code Wizard Pro Team

It seems that at the moment I am more interested in this than you =) Okay, I still keep asking questions. Will this message structure suit everyone or should I add something else?

PipeMessage struct
   Calculator       ; CODE / EEPROM
   Brand            ; Manufacturer
   Algorithm        ; Calculation Type
   Data1            ; Input data 1 / dump info
   Data2            ; Input data 2 / path to dump file
   Data3            ; Input data 3 / reserved for future 
   Data4            ; Input data 4 / offline or online mode flag
   Password         ; Calculated code
   Tokens           ; Tokens left
PipeMessage ends

This structure format will be used when sending a message to the application and when receiving a response from it.

Code Wizard Pro Team
Quote from autoscan41 on 2024-03-21, 22:12

Certain calculations present two price options. For instance:

Hyundai KEY code by VIN (1986-17) 7/10*

it would be nice if provide a predefined list of VINs with specific characters that allows us to determine whether the price is 7 or 10.

I suggest implementing a feature that allows the program to start with a specified dongle by serial, for example if someone have two dongles connected he can send the startup command with the specified dongle serial

Not only would this feature improve efficiency, but it would also enhance the scalability of the software.

We have Input data 1/2/3/4. In the first - VIN, in the last - 0 for offline mode only or 1 as confirmation of using the online mode and requesting a code from a third-party source. What do you think?

The second copy of the program cannot be launched, therefore there is no need to connect more than one key. And, you can always use CWP-2 security key over a network - USB over IP. For cases when the dongle is connected to one computer and the program is running on another.

Code Wizard Pro Team

Two small but useful functions will also be added, both for me and for you: logging of all operations in server mode and an additional application showing requests and responses in real time, and of course earlier ones.

Code Wizard Pro Team
Quote from Code Wizard on 2024-03-24, 21:44

By the way, what about the delay before showing the calculated code? If I leave it as is, will it be okay for you or is it better to remove the delay? This turns out to be a double-edged sword. If I remove the delay, it will be possible to restore some algorithms by simply sending requests to the entire range of codes. I'm talking about free calculations that do not require tokens. Yes, even in automatic mode, it will take from a few minutes to several days or weeks or months, depending on the algorithm. And to be honest, I don’t want this to happen at all. On the other hand, if I remove the delay, you receive the calculated codes instantly, within 1 second, maximum within 3 seconds.

I need your opinion, are you okay with an additional delay of 5 seconds, or do you want to receive the calculated code in 1-3 seconds?

Since the difference between 5 seconds and 1-3 seconds is minimal, it's okay with the additional delay of the 5 seconds.

- 0 for offline mode only or 1 as confirmation of using the online mode and requesting a code from a third-party source, it's good

- logging of all operations in server mode and an additional application showing requests and responses in real time, sounds good also

And no doubt, you will all want to have a sample application for sending requests and receiving responses. I will write a test program in assembler and WinAPI. Even if you don't know ASM, WinAPI should be understandable to all of you.

Code Wizard Pro Team

Half of the server part is ready - our server successfully responds via Pipes and writes logs. Take a look at the log format, is it ok for you?

DATE;TIME;SERVER|CLIENT;CODE|EEPROM;BRAND;ALGORITHM;DATA1|DUMP_INFO;DATA2|FILE_NAME;DATA3|RESERVED;DATA4|FLAG_ONLINE;CALCULATED_CODE;TOKENS_LEFT

2024-03-31;14:45:16;SERVER;CODE;PEUGEOT;1;0123-4567-89AB-CDEF;;;;KJYI-JHDR-LEEU-E15L;124115
2024-03-31;16:45:04;SERVER;EEPROM;KIA;1;95480C5100;MC9S12XET512-EEE.bin;;;875031;124115

All I have to do is write a server part that accepts requests via Pipe. And two applications - one for monitoring requests and responses, the second as an example of working with the server.

Code Wizard Pro Team
Page 1 of 2Next