This is mostly useful for debugging version mismatches rather than code recovery. 2. Commercial Decompilers (The Most Effective Way)
Look for established community utilities such as the OpenEdge Decompiler or specific scripts available on Progress user networks (PEG) and GitHub. decompile progress .r file
| 目标类型 | 描述 | 难度 | |---------|------|------| | 纯R函数(未编译) | 直接提取源码 | 容易 | | 字节码编译的R函数 | 恢复函数体与参数 | 中等 | | 二进制包中的R代码 | 从包环境中提取函数 | 中等偏高 | | S4泛型函数和方法 | 恢复完整的泛型体系 | 困难 | | C/C++编译的本地代码 | 反编译为高级语言 | 极其困难(通常不可行) | This is mostly useful for debugging version mismatches
Contains the actual executable p-code statements. | 目标类型 | 描述 | 难度 | |---------|------|------|
然而,对于已被字节码编译的函数, body() 返回的仍然是原始的R代码——。这意味着在绝大多数情况下,从加载的包中提取函数源代码是可行的。
Decompile Progress .R File: The Complete Guide to Recovering Progress 4GL Code
You do not need to manually strip away the markdown text, headings, and explanations. The knitr package includes a tool called purl that extracts nothing but the executable R code chunks.