forked from TimelifeCzy/Shell_Protect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathx64.asm
77 lines (76 loc) · 1.59 KB
/
x64.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.code
start:
;----------------------------------------------------------------------------
; AsmCountTemp at _Start
;----------------------------------------------------------------------------
; rcx = *temp
;----------------------------------------------------------------------------
AsmCountTemp PROC
PUSH rax
PUSH rbx
PUSH rcx
PUSH rdx
PUSH rsi
PUSH rdi
XOR rdi, rdi
MOV rdi, rcx
MOV esi, dword ptr [rcx]
MOV eax, dword ptr [rcx]
MOV edx, 1h
MOV cx, 1000h
div cx
test dx, dx
jz MemSucess
shr dx, 12
inc dx
shl dx, 12;
add esi, edx;
shr esi, 12;
shl esi, 12;
mov dword ptr [rdi], esi;
MemSucess:
POP rdi
POP rsi
POP rdx
POP rcx
POP rbx
POP rax
ret
AsmCountTemp ENDP
;----------------------------------------------------------------------------
; AsmCountTemp1 at _Start
;----------------------------------------------------------------------------
; rcx = tempvalues
;----------------------------------------------------------------------------
AsmCountTemp1 PROC
push rax
push rbx
push rcx
push rdx
push rsi
PUSH rdi
sub rdi, rdi
mov rdi, rcx
mov esi, dword ptr [rcx];
mov edx, 1h;
mov eax, esi;
mov ecx, 200h;
div cx;
test dx, dx;
jz FileSucess
xor eax, eax
mov ax, 200h;
sub ax, dx;
add esi, eax;
mov dword ptr [rdi], esi;
FileSucess:
POP rdi
pop rsi
pop rdx
pop rcx
pop rbx
pop rax
ret
AsmCountTemp1 ENDP
;----------------------------------------------------------
end