2013-11-12 02:49:12 +04:00
|
|
|
|
; by ManHunter / PCL
|
|
|
|
|
; http://www.manhunter.ru
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> (Fast)
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; lpStr - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> ASCIIZ
|
|
|
|
|
; <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD>: EAX - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饣<EFBFBD>
|
|
|
|
|
; <EFBFBD>㫥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
;proc _lstrlen lpStr:DWORD
|
|
|
|
|
; mov eax, [lpStr]
|
|
|
|
|
; sub eax, 4
|
|
|
|
|
;@@:
|
|
|
|
|
; add eax, 4
|
|
|
|
|
; cmp byte [eax], 0
|
|
|
|
|
; je .szlen_lb1
|
|
|
|
|
; cmp byte [eax+1], 0
|
|
|
|
|
; je .szlen_lb2
|
|
|
|
|
; cmp byte [eax+2], 0
|
|
|
|
|
; je .szlen_lb3
|
|
|
|
|
; cmp byte [eax+3], 0
|
|
|
|
|
; jne @b
|
|
|
|
|
; sub eax, [lpStr]
|
|
|
|
|
; add eax, 3
|
|
|
|
|
; ret
|
|
|
|
|
;.szlen_lb3:
|
|
|
|
|
; sub eax, [lpStr]
|
|
|
|
|
; add eax, 2
|
|
|
|
|
; ret
|
|
|
|
|
;.szlen_lb2:
|
|
|
|
|
; sub eax, [lpStr]
|
|
|
|
|
; add eax, 1
|
|
|
|
|
; ret
|
|
|
|
|
;.szlen_lb1:
|
|
|
|
|
; sub eax, [lpStr]
|
|
|
|
|
; ret
|
|
|
|
|
;endp
|
|
|
|
|
|
2013-11-25 10:35:17 +04:00
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; lpStr - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> ASCIIZ
|
|
|
|
|
; <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD>: EAX - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饣<EFBFBD>
|
|
|
|
|
; <EFBFBD>㫥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
proc _lstrlen lpStr:DWORD
|
2013-12-03 02:59:48 +04:00
|
|
|
|
mov eax, [lpStr]
|
|
|
|
|
@@: inc eax
|
|
|
|
|
cmp byte [eax], 0
|
|
|
|
|
jne @b
|
|
|
|
|
sub eax, [lpStr]
|
|
|
|
|
ret
|
2013-11-12 02:49:12 +04:00
|
|
|
|
endp
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ண<EFBFBD> ﭨ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப
|
|
|
|
|
; <EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㭪樨 _lstrlen, _lstrcpy
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; lpDst - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> ASCIIZ
|
|
|
|
|
; lpSrc - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> ASCIIZ
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
proc _lstrcat lpDst:DWORD, lpSrc:DWORD
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
stdcall _lstrlen,[lpDst]
|
|
|
|
|
add eax,[lpDst]
|
|
|
|
|
|
|
|
|
|
stdcall _lstrcpy,eax,[lpSrc]
|
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ண<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>
|
|
|
|
|
; <EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㭪樨 _lstrlen, _memcopy
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; lpDst - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>ਥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; lpSrc - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> ASCIIZ
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
proc _lstrcpy lpDst:DWORD, lpSrc:DWORD
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
stdcall _lstrlen,[lpSrc]
|
|
|
|
|
inc eax
|
|
|
|
|
stdcall _memcopy,[lpDst],[lpSrc],eax
|
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ண<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⪠ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
; lpDst - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>ਥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; lpSrc - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>筨<EFBFBD>
|
|
|
|
|
; dSize - ࠧ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㥬<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;-----------------------------------------------------
|
|
|
|
|
proc _memcopy lpDst:DWORD, lpSrc:DWORD, dSize:DWORD
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>筨<EFBFBD> <EFBFBD> <EFBFBD>ਥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cld
|
|
|
|
|
mov edi,[lpDst]
|
|
|
|
|
mov esi,[lpSrc]
|
|
|
|
|
|
|
|
|
|
mov ecx,[dSize]
|
|
|
|
|
push ecx
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 4 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> DWORD
|
|
|
|
|
shr ecx,2
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>᭮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> DWORD'<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
rep movsd
|
|
|
|
|
pop ecx
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮪ <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 4
|
|
|
|
|
and ecx,3
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮪ <EFBFBD><EFBFBD>ப<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⠬<EFBFBD>
|
|
|
|
|
rep movsb
|
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
endp
|