123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- .code
- inffas8664fnc PROC
- mov [rsp-8],rsi
- mov [rsp-16],rdi
- mov [rsp-24],r12
- mov [rsp-32],r13
- mov [rsp-40],r14
- mov [rsp-48],r15
- mov [rsp-56],rbx
- mov rax,rcx
- mov [rax+8], rbp
- mov [rax], rsp
- mov rsp, rax
- mov rsi, [rsp+16]
- mov rdi, [rsp+32]
- mov r9, [rsp+24]
- mov r10, [rsp+48]
- mov rbp, [rsp+64]
- mov r11, [rsp+72]
- mov rdx, [rsp+80]
- mov ebx, [rsp+88]
- mov r12d, [rsp+100]
- mov r13d, [rsp+104]
-
-
- cld
- cmp r10, rdi
- je L_one_time
- cmp r9, rsi
- jne L_do_loop
- L_one_time:
- mov r8, r12
- cmp bl, 32
- ja L_get_length_code_one_time
- lodsd
- mov cl, bl
- add bl, 32
- shl rax, cl
- or rdx, rax
- jmp L_get_length_code_one_time
- ALIGN 4
- L_while_test:
- cmp r10, rdi
- jbe L_break_loop
- cmp r9, rsi
- jbe L_break_loop
- L_do_loop:
- mov r8, r12
- cmp bl, 32
- ja L_get_length_code
- lodsd
- mov cl, bl
- add bl, 32
- shl rax, cl
- or rdx, rax
- L_get_length_code:
- and r8, rdx
- mov eax, [rbp+r8*4]
- mov cl, ah
- sub bl, ah
- shr rdx, cl
- test al, al
- jnz L_test_for_length_base
- mov r8, r12
- shr eax, 16
- stosb
- L_get_length_code_one_time:
- and r8, rdx
- mov eax, [rbp+r8*4]
- L_dolen:
- mov cl, ah
- sub bl, ah
- shr rdx, cl
- test al, al
- jnz L_test_for_length_base
- shr eax, 16
- stosb
- jmp L_while_test
- ALIGN 4
- L_test_for_length_base:
- mov r14d, eax
- shr r14d, 16
- mov cl, al
- test al, 16
- jz L_test_for_second_level_length
- and cl, 15
- jz L_decode_distance
- L_add_bits_to_len:
- sub bl, cl
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx
- shr rdx, cl
- add r14d, eax
- L_decode_distance:
- mov r8, r13
- cmp bl, 32
- ja L_get_distance_code
- lodsd
- mov cl, bl
- add bl, 32
- shl rax, cl
- or rdx, rax
- L_get_distance_code:
- and r8, rdx
- mov eax, [r11+r8*4]
- L_dodist:
- mov r15d, eax
- shr r15d, 16
- mov cl, ah
- sub bl, ah
- shr rdx, cl
- mov cl, al
- test al, 16
- jz L_test_for_second_level_dist
- and cl, 15
- jz L_check_dist_one
- L_add_bits_to_dist:
- sub bl, cl
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx
- shr rdx, cl
- add r15d, eax
- L_check_window:
- mov r8, rsi
- mov rax, rdi
- sub rax, [rsp+40]
- cmp eax, r15d
- jb L_clip_window
- mov ecx, r14d
- mov rsi, rdi
- sub rsi, r15
- sar ecx, 1
- jnc L_copy_two
- rep movsw
- mov al, [rsi]
- mov [rdi], al
- inc rdi
- mov rsi, r8
- jmp L_while_test
- L_copy_two:
- rep movsw
- mov rsi, r8
- jmp L_while_test
- ALIGN 4
- L_check_dist_one:
- cmp r15d, 1
- jne L_check_window
- cmp [rsp+40], rdi
- je L_check_window
- mov ecx, r14d
- mov al, [rdi-1]
- mov ah, al
- sar ecx, 1
- jnc L_set_two
- mov [rdi], al
- inc rdi
- L_set_two:
- rep stosw
- jmp L_while_test
- ALIGN 4
- L_test_for_second_level_length:
- test al, 64
- jnz L_test_for_end_of_block
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx
- add eax, r14d
- mov eax, [rbp+rax*4]
- jmp L_dolen
- ALIGN 4
- L_test_for_second_level_dist:
- test al, 64
- jnz L_invalid_distance_code
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx
- add eax, r15d
- mov eax, [r11+rax*4]
- jmp L_dodist
- ALIGN 4
- L_clip_window:
- mov ecx, eax
- mov eax, [rsp+92]
- neg ecx
- cmp eax, r15d
- jb L_invalid_distance_too_far
- add ecx, r15d
- cmp dword ptr [rsp+96], 0
- jne L_wrap_around_window
- mov rsi, [rsp+56]
- sub eax, ecx
- add rsi, rax
- mov eax, r14d
- cmp r14d, ecx
- jbe L_do_copy
- sub eax, ecx
- rep movsb
- mov rsi, rdi
- sub rsi, r15
- jmp L_do_copy
- ALIGN 4
- L_wrap_around_window:
- mov eax, [rsp+96]
- cmp ecx, eax
- jbe L_contiguous_in_window
- mov esi, [rsp+92]
- add rsi, [rsp+56]
- add rsi, rax
- sub rsi, rcx
- sub ecx, eax
- mov eax, r14d
- cmp eax, ecx
- jbe L_do_copy
- sub eax, ecx
- rep movsb
- mov rsi, [rsp+56]
- mov ecx, [rsp+96]
- cmp eax, ecx
- jbe L_do_copy
- sub eax, ecx
- rep movsb
- mov rsi, rdi
- sub rsi, r15
- jmp L_do_copy
- ALIGN 4
- L_contiguous_in_window:
- mov rsi, [rsp+56]
- add rsi, rax
- sub rsi, rcx
- mov eax, r14d
- cmp eax, ecx
- jbe L_do_copy
- sub eax, ecx
- rep movsb
- mov rsi, rdi
- sub rsi, r15
- jmp L_do_copy
- ALIGN 4
- L_do_copy:
- mov ecx, eax
- rep movsb
- mov rsi, r8
- jmp L_while_test
- L_test_for_end_of_block:
- test al, 32
- jz L_invalid_literal_length_code
- mov dword ptr [rsp+116], 1
- jmp L_break_loop_with_status
- L_invalid_literal_length_code:
- mov dword ptr [rsp+116], 2
- jmp L_break_loop_with_status
- L_invalid_distance_code:
- mov dword ptr [rsp+116], 3
- jmp L_break_loop_with_status
- L_invalid_distance_too_far:
- mov dword ptr [rsp+116], 4
- jmp L_break_loop_with_status
- L_break_loop:
- mov dword ptr [rsp+116], 0
- L_break_loop_with_status:
- mov [rsp+16], rsi
- mov [rsp+32], rdi
- mov [rsp+88], ebx
- mov [rsp+80], rdx
- mov rax, [rsp]
- mov rbp, [rsp+8]
- mov rsp, rax
- mov rsi,[rsp-8]
- mov rdi,[rsp-16]
- mov r12,[rsp-24]
- mov r13,[rsp-32]
- mov r14,[rsp-40]
- mov r15,[rsp-48]
- mov rbx,[rsp-56]
- ret 0
- inffas8664fnc ENDP
- END
|