代码摘要如下:
_time proc near
TimeZoneInformation= _TIME_ZONE_INFORMATION ptr -0CCh
var_20 = dword ptr -20h
var_1A = word ptr -1Ah
var_18 = word ptr -18h
var_16 = word ptr -16h
SystemTime = _SYSTEMTIME ptr -10h
arg_0 = dword ptr 8
push ebp
mov ebp, esp
sub esp, 0CCh
lea eax, [ebp+SystemTime]
push eax ; lpSystemTime
call ds:GetLocalTime
lea eax, [ebp+var_20]
push eax ; lpSystemTime
call ds:GetSystemTime
mov ax, [ebp+var_16]
cmp ax, word_A1C0FA
jnz short loc_624444
mov ax, [ebp+var_18]
cmp ax, word_A1C0F8
jnz short loc_624444
mov ax, [ebp+var_1A]
cmp ax, word_A1C0F6
jnz short loc_624444
mov ax, word ptr [ebp+var_20+2]
cmp ax, word_A1C0F2
jnz short loc_624444
mov ax, word ptr [ebp+var_20]
cmp ax, word_A1C0F0
jnz short loc_624444
mov eax, dword_A1C0E8
jmp short loc_624489
; ---------------------------------------------------------------------------
loc_624444:
lea eax, [ebp+TimeZoneInformation]
push eax ; lpTimeZoneInformation
call ds:GetTimeZoneInformation
cmp eax, 0FFFFFFFFh
jz short loc_624471
cmp eax, 2
jnz short loc_62446D
cmp [ebp+TimeZoneInformation.DaylightDate.wMonth], 0
jz short loc_62446D
cmp [ebp+TimeZoneInformation.DaylightBias], 0
jz short loc_62446D
push 1
pop eax
jmp short loc_624474
; ---------------------------------------------------------------------------
loc_62446D:
xor eax, eax
jmp short loc_624474
; ---------------------------------------------------------------------------
loc_624471:
or eax, 0FFFFFFFFh
loc_624474:
push esi
push edi
lea esi, [ebp+var_20]
mov edi, offset word_A1C0F0
movsd
movsd
movsd
movsd
pop edi
mov dword_A1C0E8, eax
pop esi
loc_624489:
push eax
movzx eax, [ebp+SystemTime.wSecond]
push eax
movzx eax, [ebp+SystemTime.wMinute]
push eax
movzx eax, [ebp+SystemTime.wHour]
push eax
movzx eax, [ebp+SystemTime.wDay]
push eax
movzx eax, [ebp+SystemTime.wMonth]
push eax
movzx eax, [ebp+SystemTime.wYear]
push eax
call ___loctotime_t
mov ecx, [ebp+arg_0]
add esp, 1Ch
test ecx, ecx
jz short locret_6244B9
mov [ecx], eax
locret_6244B9:
leave
retn
_time endp
结构体定义如下:
SYSTEMTIME struc ; (sizeof=0x10, standard type)
wYear dw ?
wMonth dw ?
wDayOfWeek dw ?
wDay dw ?
wHour dw ?
wMinute dw ?
wSecond dw ?
wMilliseconds dw ?
SYSTEMTIME ends
_SYSTEMTIME struc ; (sizeof=0x10, standard type)
wYear dw ?
wMonth dw ?
wDayOfWeek dw ?
wDay dw ?
wHour dw ?
wMinute dw ?
wSecond dw ?
wMilliseconds dw ?
_SYSTEMTIME ends
_TIME_ZONE_INFORMATION struc ; (sizeof=0xAC, standard type)
Bias dd ?
StandardName dw 32 dup(?)
StandardDate SYSTEMTIME ?
StandardBias dd ?
DaylightName dw 32 dup(?)
DaylightDate SYSTEMTIME ?
DaylightBias dd ?
_TIME_ZONE_INFORMATION ends
把结构体不管是放在.data还是.code编译都出错
提示:structure improperly initialized和syntax error : in structure错误
初学汇编,该如何处理,请指点,在此先行谢过!
环境是MASMPlus
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课