How does MATLAB app designer call external. m functions after packaging into exe?

9 ビュー (過去 30 日間)
shen hedong
shen hedong 2024 年 12 月 30 日
コメント済み: shen hedong 2024 年 12 月 31 日
How does MATLAB app designer call external. m functions after packaging into exe? Please note that this external function is not packaged into EXE. Who can help me! I have tried commands such as' addpath ',' filread ',' eval ', but after testing, none of them worked.
  3 件のコメント
Steven Lord
Steven Lord 2024 年 12 月 30 日
The matlab.lang.obfuscateNames function introduced in release R2024b may be of interest.
shen hedong
shen hedong 2024 年 12 月 31 日
Thank you very much, your minify function is really amazing! Thank you for your contribution!

サインインしてコメントする。

回答 (2 件)

Manikanta Aditya
Manikanta Aditya 2024 年 12 月 30 日
編集済み: Manikanta Aditya 2024 年 12 月 30 日
When you package a MATLAB App Designer app into an executable (EXE), calling external .m functions that are not included in the EXE can be tricky.
Here are some steps and considerations to help you achieve this:
  1. Include External Functions in the Package: Ideally, you should include all necessary .m files in the packaging process. This ensures that all dependencies are available when the EXE runs.
Refer to the following MATLAB Answers posts to know more about the query:
I hope this helps you.
  3 件のコメント
Manikanta Aditya
Manikanta Aditya 2024 年 12 月 30 日
To strongly encrypt your .m files and protect your MATLAB code from being cracked, while you mentioned that pcode can be cracked, it is still a useful first step. pcode obfuscates your code, making it harder to read and modify.
  • Use the MATLAB Compiler to compile your .m files into standalone executables or shared libraries. This approach converts your MATLAB code into a binary format, which is much harder to reverse-engineer compared to pcode.
  • In addition to pcode, you can manually obfuscate your code by renaming variables and functions to non-descriptive names, removing comments, and using complex logic structures. This makes it more difficult for someone to understand and reverse-engineer your code.
shen hedong
shen hedong 2024 年 12 月 30 日
thank you very much!

サインインしてコメントする。


Walter Roberson
Walter Roberson 2024 年 12 月 30 日
編集済み: Walter Roberson 2024 年 12 月 30 日

When you package into exe then external .m that are not packaged as part of the exe, cause an error when they are called.

Only .m and .mlx and .p and .mdl and .slx (and possibly a few others) that are packaged with the exe can be called. It is impossible for external .m not bundled with the exe to be called. All .m must have been pre-parsed and encoded into ctf format to be callable.

The purpose of compiling into exe is to create a limited-functionality executable. If it were possible to run external .m that were not compiled into the bundle then unlimited functionality could be built. Imagine an executable that simply called an external .m and returned, then the user could supply arbitrary code in the .m and thus evade the need for a matlab license to execute arbitrary code. Therefore it will never be possible to execute external .m that are not bundled into the exe

  1 件のコメント
shen hedong
shen hedong 2024 年 12 月 30 日
Thank you very much for your answer. Actually, I can currently solve this problem by packaging it in app format instead of exe format. In order to protect my code, I encrypted the app format code using the pcode command. However, there are many ways to crack p files on the internet now, so do you have a way to strongly encrypt. m files? I don't want my code to be cracked by others.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by