windows pe 权威指南 16章 getValidHeadSize的问题

大家好,请教一个问题
;--------------------------------------
; 获取目标PE头的数据的有效长度
;--------------------------------------
getValidHeadSize proc _lpFileHead
local @dwReturn
local @dwTemp

pushad
mov esi,_lpFileHead
assume esi:ptr IMAGE_DOS_HEADER
add esi,[esi].e_lfanew
assume esi:ptr IMAGE_NT_HEADERS
mov edx,esi
add edx,sizeof IMAGE_NT_HEADERS
assume edx:ptr IMAGE_SECTION_HEADER
mov eax,[edx].PointerToRawData ;指向第一个节的起始
mov @dwTemp,eax

dec eax
mov esi,eax
add esi,_lpFileHead
mov @dwReturn,0
.repeat
mov bl,byte ptr [esi]
.if bl!=0
.break
.endif
dec esi
inc @dwReturn
.until FALSE
mov eax,@dwTemp
sub eax,@dwReturn
add eax,2 ;为有效数据留出两个0字符,假如最后的有效数据为字符串,必须以0结束
mov @dwReturn,eax

popad
mov eax,@dwReturn

ret
getValidHeadSize endp

这里面返回有效数据长度包括ntheader还是不包括呢?根据代码来看感觉是包括的,但是后面用到这个返回值的时候意思是不包括的,有没有人帮忙解释下,谢谢!

https://blog.csdn.net/qq_30159243/article/details/51994222