Skip to content

Commit

Permalink
Expand functions in safe mode
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhch committed Jun 12, 2024
1 parent ee92e34 commit 33c7c23
Show file tree
Hide file tree
Showing 24 changed files with 442 additions and 254 deletions.
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,39 @@ At present, the program has practical applications in ```AIX```, ```UNIX```, ```
### User manual
- Generate C code command

``` shellc command inputfile [-t] [-s] [-f fix-argv0] ```
```shellc command inputfile [-t] [-s] [-f fix-format] [-e fix-file]```

command: Execute script commands, such ```sh```,```perl```,```python```,```node```,```ruby```,```Rscript```,```php```, etc.
command: Execute script commands, such ```sh```,```perl```,```python```,```node```,```ruby```,```Rscript```,```php```, etc.

inputfile: Script file name

-t option: For systems that do not support anti debugging functionality, this option is required for generated code.
-t option: For systems that do not support anti debugging functionality, this option is required for generated code.

-s option: Generate C code mode, the - s option uses safe mode, and defaults to normal mode.
-s option: Generate C code mode, the -s option uses safe mode, and defaults to normal mode.

-f option: Fix parameter 0 value.
-f option: Fix parameter 0 value or safe mode external parameter.

-e option: Fix parameter 0 value by custom external file.

- Code pattern differences

The normal mode shell script has some code visibility issues in most Linux operating systems, and the code after the ```read``` command can be obtained through ```/proc/[pid]/fd/[pipe]```. The safe mode does not have this issue.

The normal mode supports semaphore processing in scripts, while the safe mode does not support it.

The normal mode supports external parameter calls and human-machine interaction for all scripting languages, while the safe mode only supports shells that can define function syntax.
The normal mode supports human-machine interaction in all scripting languages, while some languages in safe mode do not support it, such as ```csh```,```tcsh```.

The safe mode human-machine interaction ```read input``` needs to be changed to ```read input</dev/tty```, and the general mode does not require code modification.
The safe mode human-machine interaction needs to be modified to read from the device ```/dev/tty```. such as shell script ```read input``` needs to be changed to ```read input</dev/tty```, For other languages, refer to the ```test/test_input.*```. The normal mode does not require code modification.

The safe mode and normal mode support different script language types, which can be checked by running ```test/run.sh```.

- Fix arguments 0
- Fix arguments

Fix arguments 0 supports ```BASH```, ```FISH```, ```ZSH```, ```PERL```, ```PYTHON```, ```JAVASCRIPT```, ```LUA```, ```RUBY```.
Fix arguments 0 supports ```BASH```, ```FISH```, ```ZSH```, ```PERL```, ```PYTHON```, ```JAVASCRIPT```, ```LUA```, ```RUBY```.

In addition to built-in fix format, external file can also be used to fix arguments 0. File format:```?```Indicates parameter 0 value, line breaks must be explicitly used```\n```, Double quotes require an escape character ```\```.Reference ```test/fix.txt```.

In addition to built-in fix types, custom file fix can also be used. Custom file format:``````Indicates parameter 0 value, line breaks must be explicitly used```\n```, Double quotes require an escape character ```\```.Reference ```test/fix.txt```.
Safe mode non definable function shell language external parameter call, requires specifying fix format, such as ```FISH```, ```PERL```,```PYTHON```, ```JAVASCRIPT```,```LUA```, ```RUBY```, ```CSH```, ```TCLSH```, ```PHP```,```RC```.

### Untraceable
Version 0.3 or above has added untraceable and tested the following tools for untraceable
Expand All @@ -76,6 +80,10 @@ macOS 13|lldb|NO

### History

- v1.1 2024-06-12

Expand functions in safe mode

- v1.02 2024-06-06

Removing macro definitions from generated code makes it easier for professional tools to generate more complex and confusing code
Expand Down
Loading

0 comments on commit 33c7c23

Please sign in to comment.