Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- prompt_msg db "Enter command: ", 0
- ld_bash db "/ld bash", 0
- ld_zsh db "/ld zsh", 0
- ld_crosh db "/ld crosh", 0
- ld_py db "/ld ", 0
- bash_shell db "/bin/bash", 0
- zsh_shell db "/bin/zsh", 0
- crosh_shell db "/path/to/crosh", 0
- python_cmd db "/usr/bin/python3", 0
- section .bss
- command resb 256
- filename resb 256
- section .text
- global _start
- _start:
- ; Display prompt
- mov eax, 4
- mov ebx, 1
- mov ecx, prompt_msg
- mov edx, 13
- int 0x80
- ; Read user input
- mov eax, 3
- mov ebx, 0
- mov ecx, command
- mov edx, 256
- int 0x80
- ; Check if command is /ld bash
- mov esi, command
- mov edi, ld_bash
- call check_command
- jz load_bash
- ; Check if command is /ld zsh
- mov esi, command
- mov edi, ld_zsh
- call check_command
- jz load_zsh
- ; Check if command is /ld crosh
- mov esi, command
- mov edi, ld_crosh
- call check_command
- jz load_crosh
- ; Check if command starts with /ld filename.py
- mov esi, command
- mov edi, ld_py
- call check_command
- jz decompile_python
- ; Exit program if no matching command
- mov eax, 1
- xor ebx, ebx
- int 0x80
- load_bash:
- ; Execute bash shell
- mov eax, 11
- mov ebx, bash_shell
- xor ecx, ecx
- xor edx, edx
- int 0x80
- load_zsh:
- ; Execute zsh shell
- mov eax, 11
- mov ebx, zsh_shell
- xor ecx, ecx
- xor edx, edx
- int 0x80
- load_crosh:
- ; Execute crosh shell
- mov eax, 11
- mov ebx, crosh_shell
- xor ecx, ecx
- xor edx, edx
- int 0x80
- decompile_python:
- ; Parse filename from command
- mov esi, command
- add esi, 4
- mov edi, filename
- call copy_filename
- ; Decompile Python file (simulated)
- ; Use python command to decompile or run
- ; Command: python3 -m py_compile filename.py
- mov eax, 11
- mov ebx, python_cmd
- mov ecx, filename
- xor edx, edx
- int 0x80
- check_command:
- ; Compare esi (input) with edi (expected)
- mov ecx, 256 ; max length to compare
- repe cmpsb
- sete al
- ret
- copy_filename:
- ; Copy filename from input to filename buffer
- mov ecx, 256
- .copy_loop:
- lodsb
- stosb
- loop .copy_loop
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement