Server mode - automatic code calculation and dump processing via Pipes
Quote from Code Wizard on 2024-03-20, 16:19How 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
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
Quote from autoscan41 on 2024-03-21, 22:12Certain 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.
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.
Quote from Code Wizard on 2024-03-24, 08:03This 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.
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.
Quote from Code Wizard on 2024-03-24, 21:44By 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?
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?
Quote from Code Wizard on 2024-03-26, 00:29It 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 / save processed dump flag Data4 ; Input data 4 / offline or online mode flag Password ; Calculated code Tokens ; Tokens left PipeMessage endsThis structure format will be used when sending a message to the application and when receiving a response from it.
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 / save processed dump flag 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.
Quote from Code Wizard on 2024-03-26, 00:52Quote from autoscan41 on 2024-03-21, 22:12Certain 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.
Quote from autoscan41 on 2024-03-21, 22:12Certain 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.
Quote from Code Wizard on 2024-03-26, 13:28Two 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.
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.
Quote from autoscan41 on 2024-03-27, 11:04Quote from Code Wizard on 2024-03-24, 21:44By 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
Quote from Code Wizard on 2024-03-24, 21:44By 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
Quote from Code Wizard on 2024-03-27, 20:51And 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.
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.
Quote from Code Wizard on 2024-03-31, 17:31Half 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;124115All 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.
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.