This repository has been archived on 2025-01-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2022-11-06 13:51:51 +03:00
|
|
|
format ELF
|
|
|
|
|
public filename as 'path.filename'
|
|
|
|
|
|
|
|
|
|
include '../include/_macros.inc'
|
|
|
|
|
extrn string.len
|
|
|
|
|
|
|
|
|
|
section '.text' executable
|
|
|
|
|
filename:
|
2022-11-06 18:21:21 +03:00
|
|
|
prelude
|
2022-11-06 13:51:51 +03:00
|
|
|
|
2022-11-06 18:21:21 +03:00
|
|
|
mov eax, [ebp+2*4]
|
|
|
|
|
push eax
|
|
|
|
|
call string.len
|
|
|
|
|
pop ebx
|
2022-11-06 13:51:51 +03:00
|
|
|
|
2022-11-06 18:21:21 +03:00
|
|
|
.loop:
|
|
|
|
|
cmp [ebx+eax], byte '/'
|
|
|
|
|
je .break
|
|
|
|
|
cmp ebx, 0
|
|
|
|
|
je .break
|
2022-11-06 13:51:51 +03:00
|
|
|
|
2022-11-06 18:21:21 +03:00
|
|
|
dec ebx
|
|
|
|
|
jmp .loop
|
|
|
|
|
.break:
|
|
|
|
|
add eax, ebx
|
|
|
|
|
inc eax
|
|
|
|
|
mov [ebp+2*4], eax
|
|
|
|
|
postlude
|
|
|
|
|
ret
|