GetFileExtension finds the address of a file name. It returns the address of the string if there is no file extension.
EndOfStr, a modified version of the StrLen function determines the end of a NULL terminated string.
.386
.model flat,stdcall
option casemap:none
EndOfStr PROTO :DWORD
.code
GetFileExtension PROC USES esi edi pFileName:DWORD
mov esi,pFileName
mov edi,1
invoke EndOfStr,esi
movzx ecx,BYTE PTR [esi]
mov BYTE PTR [esi],'.'
@@:
sub eax,edi
cmp BYTE PTR [eax],'.'
jne @b
mov BYTE PTR [esi],cl
ret
GetFileExtension ENDP
END