-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunc.asm
46 lines (35 loc) · 893 Bytes
/
func.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
;--------------------------------------------------
; void func(char* word){
; while(*(word+i) != '\0'){
; *(word+i) |= 0x20;
; *(word+i+2) |= 0x20;
; *(word+i+3) &= 0xDF;
; i++;
; }
; }
;--------------------------------------------------
section .text
global func
func:
push ebp ;push "calling procedure" frame pointer
mov ebp, esp ;set new frame pointer
mov edi, [ebp+8]
mov dl, [edi] ;load byte
cmp dl, 0 ;cmp will set ZERO flag if dl is zero
jz end ;jump if ZERO
loop:
mov dl, [edi]
cmp dl, 0
jz end
and BYTE [edi], 0DFh
inc edi
inc edi
and BYTE [edi], 0DFh
inc edi
or BYTE [edi], 020h
inc edi
jmp loop
end:
mov esp, ebp
pop ebp
ret