Function at 0x406180
Capabilities:
Create thread
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x864
mov eax, dword [0x45c050]
xor eax, ebp
mov dword [ebp - 4], eax
xorps xmm0, xmm0
mov dword [0x45efa0], 5
movups xmmword [ebp - 0x840], xmm0
mov eax, dword [ebp - 0x838]
push ebx
push esi
and eax, 0xffffffdf
movq qword [ebp - 0x830], xmm0
push edi
or eax, 0x11
mov dword [0x45efac], 0xc8
xor edi, edi
mov dword [0x45efa4], 0x64
mov dword [0x45efa8], 1
mov dword [ebp - 0x828], edi
mov dword [ebp - 0x840], 0x1c
mov dword [ebp - 0x83c], 0x1c200
mov word [ebp - 0x82e], 8
mov byte [ebp - 0x82c], 2
mov dword [ebp - 0x838], eax
call dword [sym.imp.WINMM.dll_timeGetTime]
sub esp, 0x18
mov ecx, esp
push 0x16
push 0x456010
mov dword [ecx], edi
mov dword [ecx + 0x10], edi
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
mov ebx, dword [0x45ed54]
xor esi, esi
push 0x400
call fcn.00428987
add esp, 0x1c
mov dword [0x45efd8], eax
test eax, eax
jne 0x40625e
mov esi, 0x2000
jmp 0x406334
push ebx
lea eax, [ebp - 0x20c]
push str..COM_d
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0
push 0x40000000
push 3
push 0
push 0
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [0x45efc4], eax
cmp eax, 0xffffffff
jne 0x4062b4
mov eax, dword [0x45efd8]
xor ecx, ecx
mov esi, 0x1002
mov dword [0x45efc4], ecx
jmp 0x40633f
lea ecx, [ebp - 0x840]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetCommState]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4062d4
call ebx
mov esi, eax
test esi, esi
jne 0x40632f
push 0
push 0
push 1
xorps xmm0, xmm0
mov dword [0x45eff0], edi
push 0
movups xmmword [0x45efe0], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [0x45eff0], eax
test eax, eax
jne 0x406303
call ebx
mov esi, eax
test esi, esi
jne 0x40632f
push 0x45efcc
push 4
push 0x45efc0
push 0x408490
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x45efc8], eax
test eax, eax
jne 0x406367
call ebx
mov esi, eax
test esi, esi
je 0x406372
mov eax, dword [0x45efd8]
mov ecx, dword [0x45efc4]
cmp ecx, 0xffffffff
je 0x40636e
test eax, eax
je 0x406358
push eax
call fcn.0042896c
mov ecx, dword [0x45efc4]
add esp, 4
mov dword [0x45efd8], edi
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x45efc4], edi
jmp 0x40636e
push eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
test esi, esi
jne 0x4063b1
mov ebx, dword [0x45efd4]
test ebx, ebx
je 0x40639f
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [0x45efc0]
push ebx
mov dword [ebp - 0x858], eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp - 0x858]
jmp 0x4063a4
mov eax, dword [0x45efc0]
test eax, eax
jne 0x4063b1
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x406372
sub esp, 0x18
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c09
sub esp, 0x18
mov ecx, esp
push 0x13
push str._Programming_Mode
mov dword [ecx], edi
mov dword [ecx + 0x10], edi
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
movzx eax, byte [0x45ed50]
add esp, 0x10
push eax
call fcn.00407ed0
mov esi, eax
cmp esi, 0x2009
jne 0x40641b
movzx eax, byte [0x45ed50]
sub esp, 8
push eax
call fcn.00407ed0
mov esi, eax
sub esp, 0x18
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c09
push 0x104
lea eax, [ebp - 0x20c]
push eax
push 0x104
lea eax, [ebp - 0x414]
push eax
push 0x104
lea eax, [ebp - 0x61c]
push eax
push 0x104
lea eax, [ebp - 0x824]
push eax
push 0x45ed58
call fcn.004297e3
lea eax, [ebp - 0x20c]
push eax
push str..mot
call fcn.004294b8
add esp, 0x2c
test eax, eax
jne 0x4064b2
push 0x18
call fcn.004245ed
mov edi, eax
xorps xmm0, xmm0
mov dword [ebp - 0x85c], edi
movups xmmword [edi], xmm0
movq qword [edi + 0x10], xmm0
mov dword [edi], vtable.CTargetFileForMot.0
mov dword [edi + 0x14], 3
jmp 0x406518
lea eax, [ebp - 0x20c]
push eax
push str..hex
call fcn.004294b8
add esp, 8
push 0x18
test eax, eax
jne 0x4064f3
call fcn.004245ed
mov edi, eax
xorps xmm0, xmm0
mov dword [ebp - 0x85c], edi
movups xmmword [edi], xmm0
movq qword [edi + 0x10], xmm0
mov dword [edi], vtable.CTargetFileForHex.0
mov dword [edi + 0x14], 2
jmp 0x406518
call fcn.004245ed
mov edi, eax
mov dword [ebp - 0x85c], eax
xorps xmm0, xmm0
movups xmmword [edi], xmm0
movq qword [edi + 0x10], xmm0
mov dword [edi + 0x14], 0
mov dword [edi], vtable.CTargetFileForBin.0
mov dword [edi + 0x10], 0
add esp, 4
mov dword [edi + 0xc], 0
mov dword [edi + 8], 0
mov dword [ebp - 0x844], edi
mov dword [edi + 4], 0
test edi, edi
jne 0x40654b
mov esi, 0x3003
jmp 0x406c09
sub esp, 0x18
mov ecx, esp
push 0x12
push str._File_reading...
mov dword [ecx], 0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
mov eax, dword [edi]
add esp, 0x18
mov ecx, edi
push 0x45ed58
call dword [eax]
sub esp, 0x18
mov esi, eax
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c09
sub esp, 0x18
mov ecx, esp
push 0x1f
push str._Address_and_size_checking...
mov dword [ecx], esi
mov dword [ecx + 0x10], esi
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
mov edx, dword [edi + 8]
add esp, 0x18
mov eax, edx
mov dword [ebp - 0x860], edx
shr eax, 0xb
test edx, 0x7ff
lea ecx, [eax + 1]
cmovbe ecx, eax
mov eax, ecx
mov dword [ebp - 0x84c], ecx
shl eax, 0xb
dec eax
mov dword [ebp - 0x858], eax
mov eax, dword [edi + 0x10]
test eax, eax
je 0x406637
lea ebx, [eax - 0xf1000]
mov ecx, ebx
mov dword [ebp - 0x854], ebx
shr ecx, 8
mov dword [ebp - 0x850], ecx
test bl, bl
je 0x406621
inc ecx
mov dword [ebp - 0x854], ebx
mov dword [ebp - 0x850], ecx
test ecx, ecx
je 0x40664b
mov eax, ecx
shl eax, 8
add eax, 0xf0fff
mov dword [ebp - 0x864], eax
jmp 0x406655
mov dword [ebp - 0x854], 0
mov dword [ebp - 0x850], 0
mov dword [ebp - 0x864], 0xf1000
movzx ecx, byte [0x45ef82]
xor esi, esi
movzx eax, byte [0x45ef81]
movzx ebx, byte [0x45ef85]
shl ecx, 8
or ecx, eax
shl ebx, 8
movzx eax, byte [0x45ef80]
shl ecx, 8
or ecx, eax
movzx eax, byte [0x45ef84]
or ebx, eax
inc ecx
movzx eax, byte [0x45ef83]
shl ebx, 8
or ebx, eax
lea eax, [ebx - 0xf0fff]
neg ebx
sbb ebx, ebx
and ebx, eax
cmp ecx, edx
jae 0x4066ad
mov esi, 0x3004
jmp 0x4066bb
cmp ebx, dword [ebp - 0x854]
mov eax, 0x3005
cmovb esi, eax
sub esp, 0x18
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c09
sub esp, 0x18
mov ecx, esp
push 0x2a
push str._Code_Flash_Block_Blank_Check__Erase...
mov dword [ecx], esi
mov dword [ecx + 0x10], esi
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
add esp, 0x18
cmp dword [ebp - 0x84c], esi
jbe 0x406754
mov eax, dword [ebp - 0x850]
xor ebx, ebx
mov dword [ebp - 0x850], eax
xor edi, edi
mov eax, dword [ebp - 0x854]
mov dword [ebp - 0x854], eax
push 1
push ebx
call fcn.00407340
mov esi, eax
cmp esi, 0x200a
jne 0x40673b
push ecx
push ebx
call fcn.00407170
mov esi, eax
test esi, esi
jne 0x40674e
inc edi
add ebx, 0x800
cmp edi, dword [ebp - 0x84c]
jb 0x406720
mov edi, dword [ebp - 0x85c]
sub esp, 0x18
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c09
mov ebx, dword [ebp - 0x850]
test ebx, ebx
je 0x406806
sub esp, 0x18
mov ecx, esp
push 0x2a
push str._Data_Flash_Block_Blank_Check__Erase...
mov dword [ecx], esi
mov dword [ecx + 0x10], esi
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
add esp, 0x18
mov ebx, 0xf1000
xor edi, edi
nop word [eax + eax]
push 0
push ebx
call fcn.00407340
mov esi, eax
cmp esi, 0x200a
jne 0x4067cb
push ecx
push ebx
call fcn.00407170
mov esi, eax
test esi, esi
jne 0x4067de
inc edi
add ebx, 0x100
cmp edi, dword [ebp - 0x850]
jb 0x4067b0
sub esp, 0x18
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
mov edi, dword [ebp - 0x85c]
add esp, 0x18
test esi, esi
jne 0x406c09
mov ebx, dword [ebp - 0x850]
sub esp, 0x18
mov ecx, esp
push 0x1c
push str._Code_Flash_Programming...
mov dword [ecx], 0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
add esp, 0x18
push 1
push dword [ebp - 0x860]
push dword [edi + 4]
push dword [ebp - 0x858]
push 0
call fcn.00407560
sub esp, 0x18
mov esi, eax
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c09
test ebx, ebx
je 0x4068ca
sub esp, 0x18
mov ecx, esp
push 0x1c
push str._Data_Flash_Programming...
mov dword [ecx], esi
mov dword [ecx + 0x10], esi
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
add esp, 0x18
push esi
push dword [ebp - 0x854]
push dword [edi + 0xc]
push dword [ebp - 0x864]
push 0xf1000
call fcn.00407560
sub esp, 0x18
mov esi, eax
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c09
sub esp, 0x18
mov byte [ebp - 0x845], 0
mov ecx, esp
mov byte [ebp - 0x846], 0
push 0x21
push str._Code_Flash_Checksum_Confirm...
mov dword [ecx], 0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
mov eax, dword [ebp - 0x860]
xor ebx, ebx
mov esi, dword [edi + 4]
mov ecx, eax
shr ecx, 0xb
and eax, 0x7ff
add esp, 0x18
mov dword [ebp - 0x844], esi
mov dword [ebp - 0x84c], ebx
mov dword [ebp - 0x860], eax
test ecx, ecx
je 0x4069c2
xorps xmm2, xmm2
xorps xmm3, xmm3
xor edi, edi
nop dword [eax]
mov edx, edi
mov eax, esi
shl edx, 0xb
mov esi, 0x80
nop dword [eax]
movq xmm1, qword [edx + eax]
xorps xmm0, xmm0
punpcklbw xmm1, xmm0
lea eax, [eax + 0x10]
psubw xmm2, xmm1
movq xmm1, qword [edx + eax - 8]
punpcklbw xmm1, xmm0
psubw xmm3, xmm1
sub esi, 1
jne 0x406950
mov esi, dword [ebp - 0x844]
inc edi
cmp edi, ecx
jb 0x406940
mov edi, dword [ebp - 0x85c]
paddw xmm2, xmm3
movaps xmm0, xmm2
psrldq xmm0, 8
paddw xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 4
paddw xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 2
paddw xmm2, xmm0
movd eax, xmm2
movzx ebx, ax
mov eax, dword [ebp - 0x860]
mov dword [ebp - 0x84c], ebx
test eax, eax
je 0x406a11
mov ebx, dword [ebp - 0x860]
mov esi, 0x800
mov dx, word [ebp - 0x84c]
sub esi, ebx
shl ecx, 0xb
add ecx, dword [edi + 4]
movzx eax, byte [ecx]
lea ecx, [ecx + 1]
sub dx, ax
sub ebx, 1
jne 0x4069e0
mov word [ebp - 0x84c], dx
mov ebx, dword [ebp - 0x84c]
test esi, esi
je 0x406a11
nop
add ebx, 0xff01
sub esi, 1
jne 0x406a00
mov dword [ebp - 0x84c], ebx
push 1
lea eax, [ebp - 0x846]
push eax
lea eax, [ebp - 0x845]
push eax
push dword [ebp - 0x858]
push 0
call fcn.00407b70
mov esi, eax
test esi, esi
jne 0x406a52
mov al, byte [ebp - 0x845]
cmp al, byte [ebp - 0x84c]
jne 0x406a4d
shr ebx, 8
cmp byte [ebp - 0x846], bl
je 0x406a52
mov esi, 0x200d
sub esp, 0x18
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c09
cmp dword [ebp - 0x850], esi
jbe 0x406c09
sub esp, 0x18
mov byte [ebp - 0x846], 0
mov ecx, esp
mov byte [ebp - 0x845], 0
push 0x21
push str._Data_Flash_Checksum_Confirm...
mov dword [ecx], esi
mov dword [ecx + 0x10], esi
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
mov eax, dword [ebp - 0x854]
xor ebx, ebx
mov esi, dword [edi + 0xc]
mov ecx, eax
shr ecx, 8
add esp, 0x18
movzx eax, al
mov dword [ebp - 0x844], esi
mov dword [ebp - 0x84c], ebx
mov dword [ebp - 0x858], eax
test ecx, ecx
je 0x406b62
xorps xmm2, xmm2
xorps xmm3, xmm3
xor edi, edi
mov edx, edi
mov eax, esi
shl edx, 8
mov esi, 0x10
nop
movq xmm1, qword [edx + eax]
xorps xmm0, xmm0
punpcklbw xmm1, xmm0
lea eax, [eax + 0x10]
psubw xmm2, xmm1
movq xmm1, qword [edx + eax - 8]
punpcklbw xmm1, xmm0
psubw xmm3, xmm1
sub esi, 1
jne 0x406af0
mov esi, dword [ebp - 0x844]
inc edi
cmp edi, ecx
jb 0x406ae2
mov edi, dword [ebp - 0x85c]
paddw xmm2, xmm3
movaps xmm0, xmm2
psrldq xmm0, 8
paddw xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 4
paddw xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 2
paddw xmm2, xmm0
movd eax, xmm2
movzx ebx, ax
mov eax, dword [ebp - 0x858]
mov dword [ebp - 0x84c], ebx
test eax, eax
je 0x406bb1
mov ebx, dword [ebp - 0x858]
mov esi, 0x100
mov dx, word [ebp - 0x84c]
sub esi, ebx
shl ecx, 8
add ecx, dword [edi + 0xc]
movzx eax, byte [ecx]
lea ecx, [ecx + 1]
sub dx, ax
sub ebx, 1
jne 0x406b80
mov word [ebp - 0x84c], dx
mov ebx, dword [ebp - 0x84c]
test esi, esi
je 0x406bb1
nop
add ebx, 0xff01
sub esi, 1
jne 0x406ba0
mov dword [ebp - 0x84c], ebx
push 0
lea eax, [ebp - 0x845]
push eax
lea eax, [ebp - 0x846]
push eax
push dword [ebp - 0x864]
push 0xf1000
call fcn.00407b70
mov esi, eax
test esi, esi
jne 0x406bf5
mov al, byte [ebp - 0x846]
cmp al, byte [ebp - 0x84c]
jne 0x406bf0
shr ebx, 8
cmp byte [ebp - 0x845], bl
je 0x406bf5
mov esi, 0x200d
sub esp, 0x18
mov edx, esi
mov ecx, esp
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
push 5
push dword [0x45efc4]
call dword [sym.imp.KERNEL32.dll_EscapeCommFunction]
test eax, eax
jne 0x406c21
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, 0x45efc0
call fcn.004083d0
test esi, esi
jne 0x406c89
cmp dword [0x45ed48], esi
je 0x406c7b
sub esp, 0x18
mov ecx, esp
push 0x12
push str._EEPROM_Write...
mov dword [ecx], esi
mov dword [ecx + 0x10], esi
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
mov ecx, dword [0x45ed4c]
call fcn.00408a70
xor edx, edx
mov ecx, esp
mov esi, eax
call fcn.004025a0
call fcn.004024e0
add esp, 0x18
test esi, esi
jne 0x406c89
sub esp, 0x18
mov ecx, esp
push 0x13
push str._Write_Complete_r_n
jmp 0x406c95
sub esp, 0x18
mov ecx, esp
push 0x11
push str._Write_Failed_r_n
mov dword [ecx], 0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
call fcn.00402a40
call fcn.004024e0
add esp, 0x18
call dword [sym.imp.WINMM.dll_timeGetTime]
test edi, edi
je 0x406d0d
mov eax, dword [edi + 4]
mov dword [edi], vtable.CTargetFile.0
test eax, eax
je 0x406cdd
push eax
call fcn.0042896c
add esp, 4
mov dword [edi + 4], 0
mov eax, dword [edi + 0xc]
mov dword [edi + 8], 0
test eax, eax
je 0x406cfb
push eax
call fcn.0042896c
add esp, 4
mov dword [edi + 0xc], 0
push 0x18
push edi
mov dword [edi + 0x10], 0
call fcn.0042461d
add esp, 8
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004245df
mov esp, ebp
pop ebp
ret