Skip to content

Commit

Permalink
- rsi/rdi register preservation
Browse files Browse the repository at this point in the history
  • Loading branch information
BeRo1985 committed Dec 21, 2018
1 parent 7af75c6 commit 72e1f31
Showing 1 changed file with 85 additions and 1 deletion.
86 changes: 85 additions & 1 deletion src/FLRE.pas
Expand Up @@ -312,7 +312,7 @@ interface

const FLREVersion=$00000004;

FLREVersionString='1.00.2018.12.02.15.37.0000';
FLREVersionString='1.00.2018.12.21.17.05.0000';

FLREMaxPrefixCharClasses=32;

Expand Down Expand Up @@ -3612,6 +3612,8 @@ function PtrPosCharSearch(const p:pointer;const v:TFLREQWord;const pEnd:pointer)
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -3671,6 +3673,10 @@ function PtrPosCharSearch(const p:pointer;const v:TFLREQWord;const pEnd:pointer)
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosChar(const SearchChar:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -3699,6 +3705,8 @@ function PtrPosCharSetOf2Search(const p:pointer;const v:TFLREQWord;const pEnd:po
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -3778,6 +3786,10 @@ function PtrPosCharSetOf2Search(const p:pointer;const v:TFLREQWord;const pEnd:po
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf2(const SearchChar0,SearchChar1:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand All @@ -3802,6 +3814,8 @@ function PtrPosCharSetOf3Search(const p:pointer;const v:TFLREQWord;const pEnd:po
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -3903,6 +3917,10 @@ function PtrPosCharSetOf3Search(const p:pointer;const v:TFLREQWord;const pEnd:po
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf3(const SearchChar0,SearchChar1,SearchChar2:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -3932,6 +3950,8 @@ function PtrPosCharSetOf4Search(const p:pointer;const v:TFLREQWord;const pEnd:po
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -4049,6 +4069,10 @@ function PtrPosCharSetOf4Search(const p:pointer;const v:TFLREQWord;const pEnd:po
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf4(const SearchChar0,SearchChar1,SearchChar2,SearchChar3:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -4080,6 +4104,8 @@ function PtrPosCharSetOf5Search(const p:pointer;const v:TFLREQWord;const pEnd:po
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -4183,6 +4209,10 @@ function PtrPosCharSetOf5Search(const p:pointer;const v:TFLREQWord;const pEnd:po
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf5(const SearchChar0,SearchChar1,SearchChar2,SearchChar3,SearchChar4:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -4216,6 +4246,8 @@ function PtrPosCharSetOf6Search(const p:pointer;const v:TFLREQWord;const pEnd:po
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -4329,6 +4361,10 @@ function PtrPosCharSetOf6Search(const p:pointer;const v:TFLREQWord;const pEnd:po
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf6(const SearchChar0,SearchChar1,SearchChar2,SearchChar3,SearchChar4,SearchChar5:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -4364,6 +4400,8 @@ function PtrPosCharSetOf7Search(const p:pointer;const v:TFLREQWord;const pEnd:po
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -4487,6 +4525,10 @@ function PtrPosCharSetOf7Search(const p:pointer;const v:TFLREQWord;const pEnd:po
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf7(const SearchChar0,SearchChar1,SearchChar2,SearchChar3,SearchChar4,SearchChar5,SearchChar6:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -4524,6 +4566,8 @@ function PtrPosCharSetOf8Search(const p:pointer;const v:TFLREQWord;const pEnd:po
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -4657,6 +4701,10 @@ function PtrPosCharSetOf8Search(const p:pointer;const v:TFLREQWord;const pEnd:po
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf8(const SearchChar0,SearchChar1,SearchChar2,SearchChar3,SearchChar4,SearchChar5,SearchChar6,SearchChar7:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -4689,6 +4737,8 @@ function PtrPosCharPairSearch(const p:pointer;const v:TFLREQWord;const pEnd:poin
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -4785,6 +4835,10 @@ function PtrPosCharPairSearch(const p:pointer;const v:TFLREQWord;const pEnd:poin
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharPair(const SearchChar0,SearchChar1:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -4812,6 +4866,8 @@ function PtrPosCharSetOf2Of2Search(const p:pointer;const v:TFLREQWord;const pEnd
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -4947,6 +5003,10 @@ function PtrPosCharSetOf2Of2Search(const p:pointer;const v:TFLREQWord;const pEnd
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf2Of2(const SearchChar0,SearchChar1:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -4979,6 +5039,8 @@ function PtrPosCharSetOf2Of3Search(const p:pointer;const v:TFLREQWord;const pEnd
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -5102,6 +5164,10 @@ function PtrPosCharSetOf2Of3Search(const p:pointer;const v:TFLREQWord;const pEnd
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf2Of3(const SearchChar0,SearchChar1:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -5136,6 +5202,8 @@ function PtrPosCharSetOf2Of4Search(const p:pointer;const v:TFLREQWord;const pEnd
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -5279,6 +5347,10 @@ function PtrPosCharSetOf2Of4Search(const p:pointer;const v:TFLREQWord;const pEnd
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharSetOf2Of4(const SearchChar0,SearchChar1:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -5309,6 +5381,8 @@ function PtrPosCharRangeSearch(const p:pointer;const v:TFLREQWord;const pEnd:poi
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -5390,6 +5464,10 @@ function PtrPosCharRangeSearch(const p:pointer;const v:TFLREQWord;const pEnd:poi
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharRange(const SearchFromChar,SearchToChar:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down Expand Up @@ -5422,6 +5500,8 @@ function PtrPosCharRangeOf2Search(const p:pointer;const v:TFLREQWord;const pEnd:
asm
{$ifdef Windows}
// Win64 ABI to System-V ABI wrapper
push rsi
push rdi
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
Expand Down Expand Up @@ -5552,6 +5632,10 @@ function PtrPosCharRangeOf2Search(const p:pointer;const v:TFLREQWord;const pEnd:
jc @Fail
add rax,rdx
@Done:
{$ifdef Windows}
pop rdi
pop rsi
{$endif}
end;

function PtrPosCharRangeOf2(const SearchFromChar0,SearchToChar0,SearchFromChar1,SearchToChar1:TFLRERawByteChar;const Text:PFLRERawByteChar;TextLength:TFLREInt32;Offset:TFLREInt32=0):TFLREPtrInt;
Expand Down

0 comments on commit 72e1f31

Please sign in to comment.