Function at 0x407c20
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34c
mov eax, dword [0x58a06c]
xor eax, esp
mov dword [esp + 0x348], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 0
mov dword [esp + 0x28], 0
push dword [esi + 0x28]
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
add dword [ebp - 0x197bf040], eax
add dword [eax], eax
invalid
mov edi, dword [0x53e354]
lea ebx, [esi + 0xc]
nop dword [eax]
push ebx
call edi
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x28]
push eax
push dword [esi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ClearCommError]
push ebx
call dword [0x53e360]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x407e49
cmp eax, 0xcccccccc
je 0x407e49
inc eax
push eax
call fcn.005008e0
mov ecx, dword [esp + 0x1c]
add esp, 4
mov dword [esp + 0x10], eax
push ebx
mov byte [eax + ecx], 0
call edi
lea edi, [esi + 0x40]
push edi
lea eax, [esp + 0x24]
push eax
push dword [esp + 0x20]
push dword [esp + 0x1c]
push dword [esi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
add dword [ebp + 0x14850fc0], eax
add dword [eax], eax
invalid
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x24], eax
cmp eax, 0x16
ja 0x407dc4
je 0x407d66
sub eax, 5
je 0x407d0e
sub eax, 1
jne 0x407dcb
mov dword [esi + 0x2c], 0xffffffff
jmp 0x407df3
push 0x190
lea eax, [esp + 0x34]
mov dword [esi + 0x2c], 0xffffffff
push 0
push eax
call fcn.00504db0
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [esi + 0x88]
lea eax, [esp + 0x38]
push str.COM_d_ERROR_ACCESS_DENIED
push 0xc8
push eax
call fcn.004084e0
add esp, 0x14
lea eax, [esp + 0x30]
push 0x10
push str.COM_ReadFile_Error
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
add ecx, ebp
lea eax, [eax]
add byte [eax], al
push 0x190
lea eax, [esp + 0x1c4]
mov dword [esi + 0x2c], 0xffffffff
push 0
push eax
call fcn.00504db0
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [esi + 0x88]
lea eax, [esp + 0x1c8]
push str.COM_d_ERROR_BAD_COMMAND
push 0xc8
push eax
call fcn.004084e0
add esp, 0x14
lea eax, [esp + 0x1c0]
push 0x10
push str.COM_ReadFile_Error
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x407df3
cmp eax, 0x3e5
je 0x407dd2
push str.ReadFile__
jmp 0x407dec
push 1
lea eax, [esp + 0x24]
push eax
push edi
push dword [esi + 0x2c]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x407df3
push str.GetOverlappedResults___in_ReadFile__
mov ecx, esi
call sym.XinZhiZao.exe_protected:_void___thiscall_itas109::CSerialPort::ProcessErrorMessage_wchar_t_const__
push ebx
call dword [0x53e360]
mov eax, dword [esi + 0x88]
mov edi, dword [esp + 0x10]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x28]
push eax
push edi
push 0x477
push dword [esi + 0x84]
call dword [0x53e4ec]
push edi
call fcn.005005bb
add esp, 4
push 0
push dword [esi + 0x28]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, dword [0x53e354]
test eax, eax
jne 0x407c70
mov ecx, dword [esp + 0x354]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.005000f2
mov esp, ebp
pop ebp
ret