Function at 0x40298b
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4057f9
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xf4c
push esi
push edi
mov dword [ebp - 0xf54], ecx
mov dword [ebp - 0x38], 0
lea ecx, [ebp - 0x644]
call fcn.00404fa0
mov edi, dword [ebp - 0xf54]
add edi, 0x68
mov ecx, 9
lea esi, [ebp - 0x644]
rep movsd dword es:[edi], dword [esi]
mov dword [ebp - 0x4c], 0
push 0x400
push 0
lea eax, [ebp - 0xe48]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov dword [ebp - 0x620], 0
jmp 0x402a11
mov ecx, dword [ebp - 0x620]
add ecx, 1
mov dword [ebp - 0x620], ecx
cmp dword [ebp - 0x620], 0x100
jge 0x402bc6
mov edx, dword [ebp - 0x620]
add edx, 1
push edx
push 0x407390
lea eax, [ebp - 0x34]
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
push 0
push 4
push 3
push 0
push 0
push 0xc0000000
lea ecx, [ebp - 0x34]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edx, dword [ebp - 0x620]
mov dword [ebp + edx*4 - 0xa48], eax
mov eax, dword [ebp - 0x620]
cmp dword [ebp + eax*4 - 0xa48], 0xffffffff
je 0x402bc1
push 0x8c
push 0x12c
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
lea eax, [ebp - 0xe68]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_GetCommState]
mov dword [ebp - 0xe64], 0x9600
mov byte [ebp - 0xe56], 8
mov byte [ebp - 0xe55], 0
mov byte [ebp - 0xe54], 0
mov eax, dword [ebp - 0xe60]
or al, 1
mov dword [ebp - 0xe60], eax
mov ecx, dword [ebp - 0xe60]
and ecx, 0xfffffffd
mov dword [ebp - 0xe60], ecx
mov edx, dword [ebp - 0xe60]
and edx, 0xfffffffb
mov dword [ebp - 0xe60], edx
mov eax, dword [ebp - 0xe60]
and al, 0xf7
mov dword [ebp - 0xe60], eax
mov ecx, dword [ebp - 0xe60]
and ch, 0xfe
mov dword [ebp - 0xe60], ecx
mov edx, dword [ebp - 0xe60]
and dh, 0xfd
mov dword [ebp - 0xe60], edx
mov eax, dword [ebp - 0xe60]
and ah, 0xf7
mov dword [ebp - 0xe60], eax
mov ecx, dword [ebp - 0xe60]
and ch, 0xcf
mov dword [ebp - 0xe60], ecx
mov edx, dword [ebp - 0xe60]
and edx, 0xffffffcf
or edx, 0x10
mov dword [ebp - 0xe60], edx
lea eax, [ebp - 0xe68]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
je 0x402b9c
push 0
lea eax, [ebp - 0xe4c]
push eax
push 0xc
push 0x4070bc
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x402bc1
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x620]
mov dword [ebp + edx*4 - 0xa48], 0xffffffff
jmp 0x402a02
call dword [sym.imp.MSVCRT.dll_clock]
add eax, 0x3e8
mov dword [ebp - 0x61c], eax
mov eax, dword [ebp - 0xf54]
cmp dword [eax + 0x64], 0
je 0x402ff5
mov ecx, dword [ebp - 0xf54]
call fcn.0040445f
call dword [sym.imp.MSVCRT.dll_clock]
cmp dword [ebp - 0x61c], eax
jle 0x402ff3
lea ecx, [ebp - 0xe6c]
call fcn.004052a6
mov dword [ebp - 4], 0
push 2
lea ecx, [ebp - 0xe70]
push ecx
lea edx, [ebp - 0xe6c]
push edx
push 0x5c4
lea eax, [ebp - 0x614]
push eax
mov ecx, dword [ebp - 0xf54]
mov ecx, dword [ecx + 0x64]
call sub.MFC42.DLL_CAsyncSocket::ReceiveFrom
mov dword [ebp - 0xe74], eax
cmp dword [ebp - 0xe74], 0xffffffff
jne 0x402c5f
call dword [sym.imp.MSVCRT.dll_clock]
cmp dword [ebp - 0x61c], eax
jle 0x402c5f
jmp 0x402c16
cmp dword [ebp - 0xe74], 0x8a
jne 0x402f82
cmp dword [ebp - 0xe70], 0xc350
jne 0x402f82
push 0
lea edx, [ebp - 0xe70]
push edx
lea eax, [ebp - 0xe6c]
push eax
push 0x5c4
lea ecx, [ebp - 0x614]
push ecx
mov edx, dword [ebp - 0xf54]
mov ecx, dword [edx + 0x64]
call sub.MFC42.DLL_CAsyncSocket::ReceiveFrom
mov eax, dword [ebp - 0x614]
and eax, 0xffff
cmp eax, 0x5aa5
jne 0x402e20
mov ecx, dword [ebp - 0x612]
and ecx, 0xffff
cmp ecx, 0x5aa5
jne 0x402e20
mov edx, dword [ebp - 0x58c]
and edx, 0xffff
cmp edx, 0x9bb9
jne 0x402e20
push 8
push 0x4070be
lea eax, [ebp - 0x5a6]
push eax
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x402e20
mov cx, word [ebp - 0x592]
mov word [ebp - 0xe78], cx
mov dword [ebp - 0x648], 1
jmp 0x402d36
mov edx, dword [ebp - 0x648]
add edx, 1
mov dword [ebp - 0x648], edx
cmp dword [ebp - 0x648], 0x41
jge 0x402d5d
mov eax, dword [ebp - 0x648]
mov cx, word [ebp - 0xe78]
sub cx, word [ebp + eax*2 - 0x614]
mov word [ebp - 0xe78], cx
jmp 0x402d27
mov dword [ebp - 0x648], 0x42
jmp 0x402d78
mov edx, dword [ebp - 0x648]
add edx, 1
mov dword [ebp - 0x648], edx
cmp dword [ebp - 0x648], 0x45
jge 0x402d9f
mov eax, dword [ebp - 0x648]
mov cx, word [ebp - 0xe78]
sub cx, word [ebp + eax*2 - 0x614]
mov word [ebp - 0xe78], cx
jmp 0x402d69
mov edx, dword [ebp - 0xe78]
and edx, 0xffff
test edx, edx
jne 0x402e1b
mov eax, dword [ebp - 0x5e4]
and eax, 0xffff
mov ecx, dword [ebp + 8]
and ecx, 0xffff
cmp eax, ecx
jne 0x402e1b
mov dword [ebp - 0x38], 1
movsx edx, word [ebp - 0x5da]
test edx, edx
jle 0x402df4
mov eax, dword [ebp - 0x5e2]
and eax, 0xffff
test eax, eax
jne 0x402df4
mov dword [ebp - 0x62c], 2
jmp 0x402e1b
mov dword [ebp - 0x62c], 0
push 0x14
lea ecx, [ebp - 0xe6c]
call sub.MFC42.DLL_CString::GetBuffer
push eax
lea ecx, [ebp - 0x644]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x402f59
mov edx, dword [ebp - 0x614]
and edx, 0xffff
cmp edx, 0x5aa5
jne 0x402f59
mov eax, dword [ebp - 0x611]
and eax, 0xff
test eax, eax
jne 0x402f59
mov ecx, dword [ebp - 0x610]
and ecx, 0xffff
cmp ecx, 2
jl 0x402f59
mov edx, dword [ebp - 0x5f2]
and edx, 0xffff
test edx, edx
jne 0x402f59
mov al, byte [ebp - 0x612]
sub al, 0x2a
mov byte [ebp - 0x612], al
mov dword [ebp - 0x648], 3
jmp 0x402e9d
mov ecx, dword [ebp - 0x648]
add ecx, 1
mov dword [ebp - 0x648], ecx
cmp dword [ebp - 0x648], 0x8a
jge 0x402ec4
mov edx, dword [ebp - 0x648]
mov al, byte [ebp - 0x612]
sub al, byte [ebp + edx - 0x614]
mov byte [ebp - 0x612], al
jmp 0x402e8e
mov ecx, dword [ebp - 0x612]
and ecx, 0xff
test ecx, ecx
jne 0x402f59
mov edx, dword [ebp - 0x5e6]
and edx, 0xffff
mov eax, dword [ebp + 8]
and eax, 0xffff
cmp edx, eax
jne 0x402f59
mov dword [ebp - 0x38], 1
movsx ecx, word [ebp - 0x60e]
cmp ecx, 0xffffffff
jne 0x402f0f
mov dword [ebp - 0x62c], 2
jmp 0x402f59
movsx edx, word [ebp - 0x610]
cmp edx, 8
jl 0x402f26
movsx eax, word [ebp - 0x5f4]
test eax, eax
jne 0x402f32
mov dword [ebp - 0x62c], 3
jmp 0x402f59
mov dword [ebp - 0x62c], 1
push 0x14
lea ecx, [ebp - 0xe6c]
call sub.MFC42.DLL_CString::GetBuffer
push eax
lea ecx, [ebp - 0x644]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
call dword [sym.imp.MSVCRT.dll_clock]
mov edx, dword [ebp - 0x61c]
sub edx, eax
cmp edx, 0x1f4
jge 0x402f80
call dword [sym.imp.MSVCRT.dll_clock]
add eax, 0x1f4
mov dword [ebp - 0x61c], eax
jmp 0x402fdc
cmp dword [ebp - 0xe74], 0xffffffff
je 0x402fdc
push 0
lea eax, [ebp - 0xe70]
push eax
lea ecx, [ebp - 0xe6c]
push ecx
push 0x5c4
lea edx, [ebp - 0x614]
push edx
mov eax, dword [ebp - 0xf54]
mov ecx, dword [eax + 0x64]
call sub.MFC42.DLL_CAsyncSocket::ReceiveFrom
call dword [sym.imp.MSVCRT.dll_clock]
mov ecx, dword [ebp - 0x61c]
sub ecx, eax
cmp ecx, 0x1f4
jge 0x402fdc
call dword [sym.imp.MSVCRT.dll_clock]
add eax, 0x1f4
mov dword [ebp - 0x61c], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xe6c]
call sub.MFC42.DLL_CString::CString
jmp 0x402bf2
jmp 0x403005
call dword [sym.imp.MSVCRT.dll_clock]
cmp dword [ebp - 0x61c], eax
jle 0x403005
jmp 0x402ff5
cmp dword [ebp - 0x38], 0
je 0x4030f2
mov dword [ebp - 0x620], 0
jmp 0x40302a
mov edx, dword [ebp - 0x620]
add edx, 1
mov dword [ebp - 0x620], edx
cmp dword [ebp - 0x620], 0x100
jge 0x4030ed
mov eax, dword [ebp - 0x620]
cmp dword [ebp + eax*4 - 0xa48], 0xffffffff
je 0x4030e8
lea ecx, [ebp - 0x44]
push ecx
lea edx, [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0
je 0x4030c3
cmp dword [ebp - 0x40], 0x5c4
jbe 0x403080
mov dword [ebp - 0x40], 0x5c4
push 0
lea edx, [ebp - 0x50]
push edx
mov eax, dword [ebp - 0x40]
push eax
lea ecx, [ebp - 0x614]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 0x44]
push ecx
lea edx, [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
jmp 0x40306a
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x620]
mov dword [ebp + ecx*4 - 0xa48], 0xffffffff
jmp 0x40301b
jmp 0x403949
mov dword [ebp - 0x620], 0
jmp 0x40310d
mov edx, dword [ebp - 0x620]
add edx, 1
mov dword [ebp - 0x620], edx
cmp dword [ebp - 0x620], 0x100
jge 0x403949
mov eax, dword [ebp - 0x620]
cmp dword [ebp + eax*4 - 0xa48], 0xffffffff
je 0x403944
lea ecx, [ebp - 0x44]
push ecx
lea edx, [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0
jne 0x40317a
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x620]
mov dword [ebp + ecx*4 - 0xa48], 0xffffffff
jmp 0x4030fe
cmp dword [ebp - 0x38], 0
je 0x403223
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x48]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0
je 0x4031f9
cmp dword [ebp - 0x40], 0x5c4
jbe 0x4031b6
mov dword [ebp - 0x40], 0x5c4
push 0
lea eax, [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
lea edx, [ebp - 0x614]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x48]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
jmp 0x4031a0
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x620]
mov dword [ebp + edx*4 - 0xa48], 0xffffffff
jmp 0x4030fe
cmp dword [ebp - 0x40], 0x88
jne 0x403632
push 0
lea eax, [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
lea edx, [ebp - 0x614]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea edx, [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov edx, dword [ebp - 0x614]
and edx, 0xffff
cmp edx, 0x5aa5
jne 0x4033cf
mov eax, dword [ebp - 0x58e]
and eax, 0xffff
cmp eax, 0x9bb9
jne 0x4033cf
push 8
push 0x4070be
lea ecx, [ebp - 0x5a8]
push ecx
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x4033cf
mov dx, word [ebp - 0x594]
mov word [ebp - 0xe80], dx
mov dword [ebp - 0x648], 0
jmp 0x4032e4
mov eax, dword [ebp - 0x648]
add eax, 1
mov dword [ebp - 0x648], eax
cmp dword [ebp - 0x648], 0x40
jge 0x40330b
mov ecx, dword [ebp - 0x648]
mov dx, word [ebp - 0xe80]
sub dx, word [ebp + ecx*2 - 0x614]
mov word [ebp - 0xe80], dx
jmp 0x4032d5
mov dword [ebp - 0x648], 0x41
jmp 0x403326
mov eax, dword [ebp - 0x648]
add eax, 1
mov dword [ebp - 0x648], eax
cmp dword [ebp - 0x648], 0x44
jge 0x40334d
mov ecx, dword [ebp - 0x648]
mov dx, word [ebp - 0xe80]
sub dx, word [ebp + ecx*2 - 0x614]
mov word [ebp - 0xe80], dx
jmp 0x403317
mov eax, dword [ebp - 0xe80]
and eax, 0xffff
test eax, eax
jne 0x4033cf
mov ecx, dword [ebp - 0x612]
and ecx, 0xffff
test ecx, ecx
je 0x4033cf
mov edx, dword [ebp - 0x5e6]
and edx, 0xffff
mov eax, dword [ebp + 8]
and eax, 0xffff
cmp edx, eax
jne 0x4033cf
mov dword [ebp - 0x38], 1
movsx ecx, word [ebp - 0x5dc]
test ecx, ecx
jle 0x4033ad
movsx edx, word [ebp - 0x5e4]
test edx, edx
jne 0x4033ad
mov dword [ebp - 0x62c], 2
jmp 0x4033ca
mov dword [ebp - 0x62c], 0
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
mov dword [ebp - 0x630], ecx
jmp 0x4030fe
mov edx, dword [ebp - 0x613]
and edx, 0xff
cmp edx, 0xff
jne 0x403632
mov al, byte [ebp - 0x614]
sub al, 0x2a
mov byte [ebp - 0x614], al
mov dword [ebp - 0x648], 1
jmp 0x403410
mov ecx, dword [ebp - 0x648]
add ecx, 1
mov dword [ebp - 0x648], ecx
cmp dword [ebp - 0x648], 0x88
jge 0x403437
mov edx, dword [ebp - 0x648]
mov al, byte [ebp - 0x614]
sub al, byte [ebp + edx - 0x614]
mov byte [ebp - 0x614], al
jmp 0x403401
mov ecx, dword [ebp - 0x614]
and ecx, 0xff
test ecx, ecx
jne 0x403632
push 0
lea edx, [ebp - 0xe4c]
push edx
push 0x88
push 0x407034
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
call dword [sym.imp.MSVCRT.dll_clock]
add eax, 0x3e8
mov dword [ebp - 0x61c], eax
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x48]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0x88
je 0x4034b6
call dword [sym.imp.MSVCRT.dll_clock]
cmp dword [ebp - 0x61c], eax
jg 0x403483
cmp dword [ebp - 0x40], 0x88
jne 0x403632
push 0
lea eax, [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
lea edx, [ebp - 0x614]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea edx, [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov edx, dword [ebp - 0x613]
and edx, 0xff
test edx, edx
jne 0x403632
mov eax, dword [ebp - 0x612]
and eax, 0xffff
cmp eax, 2
jl 0x403632
mov ecx, dword [ebp - 0x5f4]
and ecx, 0xffff
test ecx, ecx
jne 0x403632
mov dl, byte [ebp - 0x614]
sub dl, 0x2a
mov byte [ebp - 0x614], dl
mov dword [ebp - 0x648], 1
jmp 0x403568
mov eax, dword [ebp - 0x648]
add eax, 1
mov dword [ebp - 0x648], eax
cmp dword [ebp - 0x648], 0x88
jge 0x40358f
mov ecx, dword [ebp - 0x648]
mov dl, byte [ebp - 0x614]
sub dl, byte [ebp + ecx - 0x614]
mov byte [ebp - 0x614], dl
jmp 0x403559
mov eax, dword [ebp - 0x614]
and eax, 0xff
test eax, eax
jne 0x403632
mov ecx, dword [ebp - 0x5e8]
and ecx, 0xffff
mov edx, dword [ebp + 8]
and edx, 0xffff
cmp ecx, edx
jne 0x40361c
mov dword [ebp - 0x38], 1
movsx eax, word [ebp - 0x610]
cmp eax, 0xffffffff
jne 0x4035da
mov dword [ebp - 0x62c], 2
jmp 0x40361a
movsx ecx, word [ebp - 0x612]
cmp ecx, 8
jl 0x4035f1
movsx edx, word [ebp - 0x5f6]
test edx, edx
jne 0x4035fd
mov dword [ebp - 0x62c], 3
jmp 0x40361a
mov dword [ebp - 0x62c], 1
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
mov dword [ebp - 0x630], ecx
jmp 0x40362d
mov edx, dword [ebp - 0x620]
mov dword [ebp + edx*4 - 0xe48], 1
jmp 0x4030fe
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0
je 0x4036a7
cmp dword [ebp - 0x40], 0x5c4
jbe 0x403664
mov dword [ebp - 0x40], 0x5c4
push 0
lea ecx, [ebp - 0x50]
push ecx
mov edx, dword [ebp - 0x40]
push edx
lea eax, [ebp - 0x614]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
jmp 0x40364e
mov dword [ebp - 0xe7c], 3
mov ecx, dword [ebp - 0xe7c]
mov edx, dword [ebp - 0xe7c]
sub edx, 1
mov dword [ebp - 0xe7c], edx
test ecx, ecx
je 0x403944
push 0
lea eax, [ebp - 0xe4c]
push eax
push 0xc
push 0x4070bc
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
call dword [sym.imp.MSVCRT.dll_clock]
add eax, 0x3e8
mov dword [ebp - 0x61c], eax
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0x88
je 0x403736
call dword [sym.imp.MSVCRT.dll_clock]
cmp dword [ebp - 0x61c], eax
jg 0x403703
cmp dword [ebp - 0x40], 0x88
jne 0x4038e6
push 0
lea ecx, [ebp - 0x50]
push ecx
mov edx, dword [ebp - 0x40]
push edx
lea eax, [ebp - 0x614]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x48]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov eax, dword [ebp - 0x614]
and eax, 0xffff
cmp eax, 0x5aa5
jne 0x4038e4
mov ecx, dword [ebp - 0x58e]
and ecx, 0xffff
cmp ecx, 0x9bb9
jne 0x4038e4
push 8
push 0x4070be
lea edx, [ebp - 0x5a8]
push edx
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x4038e4
mov ax, word [ebp - 0x594]
mov word [ebp - 0xe84], ax
mov dword [ebp - 0x648], 0
jmp 0x4037f7
mov ecx, dword [ebp - 0x648]
add ecx, 1
mov dword [ebp - 0x648], ecx
cmp dword [ebp - 0x648], 0x40
jge 0x40381e
mov edx, dword [ebp - 0x648]
mov ax, word [ebp - 0xe84]
sub ax, word [ebp + edx*2 - 0x614]
mov word [ebp - 0xe84], ax
jmp 0x4037e8
mov dword [ebp - 0x648], 0x41
jmp 0x403839
mov ecx, dword [ebp - 0x648]
add ecx, 1
mov dword [ebp - 0x648], ecx
cmp dword [ebp - 0x648], 0x44
jge 0x403860
mov edx, dword [ebp - 0x648]
mov ax, word [ebp - 0xe84]
sub ax, word [ebp + edx*2 - 0x614]
mov word [ebp - 0xe84], ax
jmp 0x40382a
mov ecx, dword [ebp - 0xe84]
and ecx, 0xffff
test ecx, ecx
jne 0x4038e4
mov edx, dword [ebp - 0x612]
and edx, 0xffff
test edx, edx
je 0x4038e4
mov eax, dword [ebp - 0x5e6]
and eax, 0xffff
mov ecx, dword [ebp + 8]
and ecx, 0xffff
cmp eax, ecx
jne 0x4038e4
mov dword [ebp - 0x38], 1
movsx edx, word [ebp - 0x5dc]
test edx, edx
jle 0x4038c5
mov eax, dword [ebp - 0x5e4]
and eax, 0xffff
test eax, eax
jne 0x4038c5
mov dword [ebp - 0x62c], 2
jmp 0x4038e2
mov dword [ebp - 0x62c], 0
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
mov dword [ebp - 0x630], edx
jmp 0x403944
jmp 0x40393f
cmp dword [ebp - 0x40], 0
je 0x40393f
cmp dword [ebp - 0x40], 0x5c4
jbe 0x4038fc
mov dword [ebp - 0x40], 0x5c4
push 0
lea eax, [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
lea edx, [ebp - 0x614]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x48]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
jmp 0x4038e6
jmp 0x4036b1
jmp 0x4030fe
cmp dword [ebp - 0x38], 0
jne 0x403f3d
mov ax, word [ebp + 8]
mov word [0x4070bc], ax
mov cx, word [0x4070bc]
mov word [ebp - 0x622], cx
mov dword [ebp - 0xe94], 0x9600
mov dword [ebp - 0xe90], 0x1c200
mov dword [ebp - 0xe8c], 0x4b000
mov dword [ebp - 0xe88], 0x2dc6c0
mov dword [ebp - 0x618], 0
jmp 0x4039ae
mov edx, dword [ebp - 0x618]
add edx, 1
mov dword [ebp - 0x618], edx
cmp dword [ebp - 0x618], 4
jge 0x403f3d
mov dword [ebp - 0x620], 0
jmp 0x4039d6
mov eax, dword [ebp - 0x620]
add eax, 1
mov dword [ebp - 0x620], eax
cmp dword [ebp - 0x620], 0x100
jge 0x403b93
mov ecx, dword [ebp - 0x620]
add ecx, 1
push ecx
push str..COM_d
lea edx, [ebp - 0x34]
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
push 0
push 4
push 3
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebp - 0x620]
mov dword [ebp + ecx*4 - 0xa48], eax
mov edx, dword [ebp - 0x620]
cmp dword [ebp + edx*4 - 0xa48], 0xffffffff
je 0x403b8e
push 0x8c
push 0x12c
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_SetupComm]
lea edx, [ebp - 0xeb0]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCommState]
mov edx, dword [ebp - 0x618]
mov eax, dword [ebp + edx*4 - 0xe94]
mov dword [ebp - 0xeac], eax
mov byte [ebp - 0xe9e], 8
mov byte [ebp - 0xe9d], 0
mov byte [ebp - 0xe9c], 0
mov ecx, dword [ebp - 0xea8]
or ecx, 1
mov dword [ebp - 0xea8], ecx
mov edx, dword [ebp - 0xea8]
and edx, 0xfffffffd
mov dword [ebp - 0xea8], edx
mov eax, dword [ebp - 0xea8]
and al, 0xfb
mov dword [ebp - 0xea8], eax
mov ecx, dword [ebp - 0xea8]
and ecx, 0xfffffff7
mov dword [ebp - 0xea8], ecx
mov edx, dword [ebp - 0xea8]
and dh, 0xfe
mov dword [ebp - 0xea8], edx
mov eax, dword [ebp - 0xea8]
and ah, 0xfd
mov dword [ebp - 0xea8], eax
mov ecx, dword [ebp - 0xea8]
and ch, 0xf7
mov dword [ebp - 0xea8], ecx
mov edx, dword [ebp - 0xea8]
and dh, 0xcf
mov dword [ebp - 0xea8], edx
mov eax, dword [ebp - 0xea8]
and al, 0xcf
or al, 0x10
mov dword [ebp - 0xea8], eax
lea ecx, [ebp - 0xeb0]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
je 0x403b69
push 0
lea ecx, [ebp - 0xe4c]
push ecx
push 0xc
push 0x4070bc
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x403b8e
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x620]
mov dword [ebp + eax*4 - 0xa48], 0xffffffff
jmp 0x4039c7
call dword [sym.imp.MSVCRT.dll_clock]
add eax, 0x3e8
mov dword [ebp - 0x61c], eax
call dword [sym.imp.MSVCRT.dll_clock]
cmp dword [ebp - 0x61c], eax
jle 0x403bb4
jmp 0x403ba4
mov dword [ebp - 0x620], 0
jmp 0x403bcf
mov ecx, dword [ebp - 0x620]
add ecx, 1
mov dword [ebp - 0x620], ecx
cmp dword [ebp - 0x620], 0x100
jge 0x403f2d
mov edx, dword [ebp - 0x620]
cmp dword [ebp + edx*4 - 0xa48], 0xffffffff
je 0x403f28
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0
jne 0x403c3c
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x620]
mov dword [ebp + eax*4 - 0xa48], 0xffffffff
jmp 0x403bc0
cmp dword [ebp - 0x38], 0
je 0x403ce5
lea ecx, [ebp - 0x44]
push ecx
lea edx, [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0
je 0x403cbb
cmp dword [ebp - 0x40], 0x5c4
jbe 0x403c78
mov dword [ebp - 0x40], 0x5c4
push 0
lea edx, [ebp - 0x50]
push edx
mov eax, dword [ebp - 0x40]
push eax
lea ecx, [ebp - 0x614]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 0x44]
push ecx
lea edx, [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
jmp 0x403c62
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x620]
mov dword [ebp + ecx*4 - 0xa48], 0xffffffff
jmp 0x403bc0
cmp dword [ebp - 0x40], 0x88
jne 0x403eb3
push 0
lea edx, [ebp - 0x50]
push edx
mov eax, dword [ebp - 0x40]
push eax
lea ecx, [ebp - 0x614]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov ecx, dword [ebp - 0x614]
and ecx, 0xffff
mov edx, dword [ebp + 8]
and edx, 0xffff
cmp ecx, edx
jne 0x403eb3
mov eax, dword [ebp - 0x58e]
and eax, 0xffff
cmp eax, 0x9bb9
jne 0x403eb3
push 8
push 0x4070be
lea ecx, [ebp - 0x5a8]
push ecx
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x403eb3
mov dx, word [ebp - 0x594]
mov word [ebp - 0xeb4], dx
mov dword [ebp - 0x648], 0
jmp 0x403dab
mov eax, dword [ebp - 0x648]
add eax, 1
mov dword [ebp - 0x648], eax
cmp dword [ebp - 0x648], 0x40
jge 0x403dd2
mov ecx, dword [ebp - 0x648]
mov dx, word [ebp - 0xeb4]
sub dx, word [ebp + ecx*2 - 0x614]
mov word [ebp - 0xeb4], dx
jmp 0x403d9c
mov dword [ebp - 0x648], 0x41
jmp 0x403ded
mov eax, dword [ebp - 0x648]
add eax, 1
mov dword [ebp - 0x648], eax
cmp dword [ebp - 0x648], 0x44
jge 0x403e14
mov ecx, dword [ebp - 0x648]
mov dx, word [ebp - 0xeb4]
sub dx, word [ebp + ecx*2 - 0x614]
mov word [ebp - 0xeb4], dx
jmp 0x403dde
mov eax, dword [ebp - 0xeb4]
and eax, 0xffff
test eax, eax
jne 0x403eb3
mov ecx, dword [ebp - 0x612]
and ecx, 0xffff
test ecx, ecx
je 0x403eb3
mov edx, dword [ebp - 0x5e6]
and edx, 0xffff
mov eax, dword [ebp + 8]
and eax, 0xffff
cmp edx, eax
jne 0x403eb3
mov dword [ebp - 0x38], 1
mov ecx, dword [ebp - 0x620]
cmp dword [ebp + ecx*4 - 0xe48], 0
je 0x403e6f
mov dword [ebp - 0x4c], 1
jmp 0x403eae
movsx edx, word [ebp - 0x5dc]
test edx, edx
jle 0x403e91
movsx eax, word [ebp - 0x5e4]
test eax, eax
jne 0x403e91
mov dword [ebp - 0x62c], 2
jmp 0x403eae
mov dword [ebp - 0x62c], 0
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
mov dword [ebp - 0x630], edx
jmp 0x403bc0
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x40], 0
je 0x403f28
cmp dword [ebp - 0x40], 0x5c4
jbe 0x403ee5
mov dword [ebp - 0x40], 0x5c4
push 0
lea ecx, [ebp - 0x50]
push ecx
mov edx, dword [ebp - 0x40]
push edx
lea eax, [ebp - 0x614]
push eax
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp + ecx*4 - 0xa48]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
jmp 0x403ecf
jmp 0x403bc0
cmp dword [ebp - 0x38], 0
je 0x403f38
jmp 0x40399f
jmp 0x40399f
cmp dword [ebp - 0x38], 0
je 0x4040c2
cmp dword [ebp - 0x4c], 0
je 0x403f69
push 0x30
push 0x4073a8
push str.Error__n_nRS485_conflict.
mov ecx, dword [ebp - 0xf54]
call sub.MFC42.DLL_CWnd::MessageBoxA
jmp 0x4040c0
cmp dword [ebp - 0x62c], 3
jne 0x403f8e
push 0x30
push 0x4073e0
push 0x407400
mov ecx, dword [ebp - 0xf54]
call sub.MFC42.DLL_CWnd::MessageBoxA
jmp 0x4040c0
cmp dword [ebp - 0x62c], 2
jne 0x403fb3
push 0x30
push 0x407450
push str.Error__n_nThe_specified_MCA_527_is_already_in_use_by_another_program.
mov ecx, dword [ebp - 0xf54]
call sub.MFC42.DLL_CWnd::MessageBoxA
jmp 0x4040c0
cmp dword [ebp - 0x62c], 0
jne 0x4040aa
sub esp, 0x24
mov ecx, 9
lea esi, [ebp - 0x644]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0xf54]
mov edx, dword [ecx + 0x64]
push edx
call fcn.00401ad0
add esp, 0x28
movsx eax, ax
test eax, eax
jne 0x404091
lea ecx, [ebp - 0xf3c]
push ecx
sub esp, 0x24
mov ecx, 9
lea esi, [ebp - 0x644]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
mov edx, dword [ebp - 0xf54]
mov eax, dword [edx + 0x64]
push eax
call fcn.00401628
add esp, 0x2c
movsx ecx, ax
test ecx, ecx
jne 0x404054
mov edx, dword [ebp - 0xf3c]
and edx, 0xffff
cmp edx, 8
jl 0x404054
mov dword [ebp - 0x628], 1
mov edi, dword [ebp - 0xf54]
add edi, 0x68
mov ecx, 9
lea esi, [ebp - 0x644]
rep movsd dword es:[edi], dword [esi]
jmp 0x40408f
sub esp, 0x24
mov ecx, 9
lea esi, [ebp - 0x644]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0xf54]
mov ecx, dword [eax + 0x64]
push ecx
call fcn.00401a48
add esp, 0x28
push 0x30
push 0x4074b4
push str.Error__n_nThe_specified_MCA_527_is_not_applicable_despite_contrary_assumption.
mov ecx, dword [ebp - 0xf54]
call sub.MFC42.DLL_CWnd::MessageBoxA
jmp 0x4040a8
push 0x30
push 0x407524
push str.Unknown_Error__001__
mov ecx, dword [ebp - 0xf54]
call sub.MFC42.DLL_CWnd::MessageBoxA
jmp 0x4040c0
mov edi, dword [ebp - 0xf54]
add edi, 0x68
mov ecx, 9
lea esi, [ebp - 0x644]
rep movsd dword es:[edi], dword [esi]
jmp 0x4040d9
push 0x40
push 0x40755c
push str.The_specified_MCA_527_has_been_not_detected.
mov ecx, dword [ebp - 0xf54]
call sub.MFC42.DLL_CWnd::MessageBoxA
mov dword [ebp - 0x620], 0
jmp 0x4040f4
mov edx, dword [ebp - 0x620]
add edx, 1
mov dword [ebp - 0x620], edx
cmp dword [ebp - 0x620], 0x100
jge 0x4041dd
mov eax, dword [ebp - 0x620]
cmp dword [ebp + eax*4 - 0xa48], 0xffffffff
je 0x4041d8
mov ecx, dword [ebp - 0x620]
mov edx, dword [ebp - 0xf54]
mov eax, dword [ebp + ecx*4 - 0xa48]
cmp eax, dword [edx + 0x7c]
je 0x4041d8
lea ecx, [ebp - 0xf48]
push ecx
lea edx, [ebp - 0xf4c]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0xf44], 0
je 0x4041c4
cmp dword [ebp - 0xf44], 0x5c4
jbe 0x404175
mov dword [ebp - 0xf44], 0x5c4
push 0
lea edx, [ebp - 0xf50]
push edx
mov eax, dword [ebp - 0xf44]
push eax
lea ecx, [ebp - 0x614]
push ecx
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 0xf48]
push ecx
lea edx, [ebp - 0xf4c]
push edx
mov eax, dword [ebp - 0x620]
mov ecx, dword [ebp + eax*4 - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
jmp 0x404156
mov edx, dword [ebp - 0x620]
mov eax, dword [ebp + edx*4 - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4040e5
mov ecx, dword [ebp - 0xf54]
cmp dword [ecx + 0x7c], 0xffffffff
jne 0x40420b
mov edx, dword [ebp - 0xf54]
add edx, 0x68
push edx
call sub.MSVCRT.dll_strlen
add esp, 4
test eax, eax
jne 0x40420b
mov dword [ebp - 0xf58], 0
jmp 0x404215
mov dword [ebp - 0xf58], 1
mov eax, dword [ebp - 0xf58]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4