Function at 0x401000
Capabilities:
Accept command line arguments
Create thread
Query or enumerate registry value
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5f0
mov eax, dword [0x41b004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
lea ecx, [ebp - 0x554]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push ecx
push eax
mov dword [ebp - 0x554], 0
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpW]
mov esi, eax
push dword [esi]
push str.launch
call edi
test eax, eax
jne 0x40142d
cmp dword [ebp - 0x554], 1
jle 0x401675
push dword [esi + 4]
push str.querySerialPortNumberList
call edi
test eax, eax
jne 0x40121e
lea eax, [ebp - 0x578]
push eax
push 1
push 0
push str.hardwaredeviceMap_serialComm
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40142d
push 0x3e7
xor esi, esi
mov byte [ebp - 0x52c], al
lea eax, [ebp - 0x52b]
mov dword [ebp - 0x534], 0x64
push esi
push eax
mov dword [ebp - 0x530], 0x14
call fcn.00408120
add esp, 0xc
lea eax, [ebp - 0x530]
mov bl, 1
push eax
lea eax, [ebp - 0x18]
push eax
push esi
push esi
lea eax, [ebp - 0x534]
push eax
lea eax, [ebp - 0xe0]
push eax
push esi
push dword [ebp - 0x578]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp eax, 0x103
je 0x4011c3
nop dword [eax + eax]
lea eax, [ebp - 0xe0]
push str.DeviceProlificSerial
push eax
call fcn.0040738c
add esp, 8
test eax, eax
jne 0x401148
lea eax, [ebp - 0xe0]
push str.DeviceSilabser
push eax
call fcn.0040738c
add esp, 8
test eax, eax
jne 0x401148
lea eax, [ebp - 0xe0]
push str.DeviceSerial
push eax
call fcn.0040738c
add esp, 8
test eax, eax
je 0x401179
lea eax, [ebp - 0x12]
test bl, bl
push eax
mov ecx, 0x419154
mov eax, str.__ls
cmovne eax, ecx
push eax
lea eax, [ebp - 0x52c]
push eax
call edi
lea ecx, [ebp - 0x52c]
add eax, ecx
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
xor bl, bl
lea eax, [ebp - 0x530]
mov dword [ebp - 0x534], 0x64
push eax
lea eax, [ebp - 0x18]
mov dword [ebp - 0x530], 0x14
push eax
push 0
push 0
lea eax, [ebp - 0x534]
inc esi
push eax
lea eax, [ebp - 0xe0]
push eax
push esi
push dword [ebp - 0x578]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
cmp eax, 0x103
jne 0x401100
push dword [ebp - 0x578]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp byte [ebp - 0x52c], 0
je 0x40142d
lea eax, [ebp - 0x5ec]
mov dword [ebp - 0x5ec], 0x44
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
push 0
lea eax, [ebp - 0x558]
push eax
lea eax, [ebp - 0x52c]
push eax
call edi
push eax
lea eax, [ebp - 0x52c]
push eax
push dword [ebp - 0x5b0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40142d
push dword [esi + 4]
push str.serialPortSend
call edi
test eax, eax
jne 0x401460
lea eax, [ebp - 0x5ec]
mov dword [ebp - 0x5ec], 0x44
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
push dword [esi + 8]
lea eax, [ebp - 0x20c]
push str.._ls
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0
push 0
push 3
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x534], ebx
cmp ebx, 0xffffffff
je 0x401442
lea eax, [ebp - 0x550]
mov dword [ebp - 0x538], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0x550], xmm0
or dword [ebp - 0x548], 1
push eax
movq qword [ebp - 0x540], xmm0
push ebx
mov dword [ebp - 0x550], 0x1c
mov word [ebp - 0x53e], 8
mov dword [ebp - 0x54c], 0x960
mov byte [ebp - 0x53c], 0
call dword [sym.imp.KERNEL32.dll_SetCommState]
lea eax, [ebp - 0x18]
mov dword [ebp - 8], 0x1388
xorps xmm0, xmm0
push eax
push ebx
movlpd qword [ebp - 0x18], xmm0
movlpd qword [ebp - 0x10], xmm0
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
push 0x400
push 0x400
push ebx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 4
push ebx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov eax, dword [0x419190]
mov dword [ebp - 0x7c], eax
mov ax, word [0x419194]
push 0x5e
mov word [ebp - 0x78], ax
lea eax, [ebp - 0x76]
push 0
push eax
call fcn.00408120
add esp, 0xc
xor ebx, ebx
xor al, al
add al, byte [ebp + ebx - 0x7c]
inc ebx
cmp ebx, 5
jl 0x401340
push dword [esi + 0xc]
mov byte [ebp - 0x5ed], al
inc ebx
xor edi, edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jle 0x4013c2
mov dword [ebp - 0x578], edi
mov ecx, 0x2c
nop dword [eax + eax]
mov eax, dword [esi + 0xc]
cmp cx, word [eax + edi*2]
je 0x401385
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
dec eax
cmp edi, eax
jne 0x4013af
mov eax, dword [esi + 0xc]
add eax, dword [ebp - 0x578]
push eax
call fcn.0040a476
add byte [ebp - 0x5ed], al
add esp, 4
mov byte [ebp + ebx - 0x7c], al
lea eax, [edi*2 + 2]
inc ebx
mov dword [ebp - 0x578], eax
push dword [esi + 0xc]
inc edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, 0x2c
cmp edi, eax
jl 0x401370
mov edi, dword [ebp - 0x534]
lea eax, [ebp - 0x530]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
sub bl, 6
push 0
push eax
push 0xf
lea eax, [ebp - 0x7c]
mov byte [ebp - 0x77], bl
add bl, byte [ebp - 0x5ed]
push eax
push edi
mov byte [ebp - 0x6e], bl
call esi
test eax, eax
je 0x40140e
cmp dword [ebp - 0x530], 0xf
jne 0x40140e
push 0
lea eax, [ebp - 0x530]
push eax
push 1
push 0x419198
jmp 0x40141e
push 0
lea eax, [ebp - 0x530]
push eax
push 1
push 0x4190dc
push dword [ebp - 0x5b0]
call esi
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004065c3
mov esp, ebp
pop ebp
ret 0x10
push 0
lea eax, [ebp - 0x530]
push eax
push 1
push 0x4190dc
push dword [ebp - 0x5b0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40142d
push dword [esi + 4]
push str.serialPortReceive
call edi
test eax, eax
jne 0x40142d
lea eax, [ebp - 0x5ec]
mov dword [ebp - 0x5ec], 0x44
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
push dword [esi + 8]
lea eax, [ebp - 0x20c]
push str.._ls
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0
push 0
push 3
push 0
push 0
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x578], ebx
cmp ebx, 0xffffffff
je 0x401442
lea eax, [ebp - 0x550]
mov dword [ebp - 0x538], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0x550], xmm0
or dword [ebp - 0x548], 1
push eax
movq qword [ebp - 0x540], xmm0
push ebx
mov dword [ebp - 0x550], 0x1c
mov word [ebp - 0x53e], 8
mov dword [ebp - 0x54c], 0x960
mov byte [ebp - 0x53c], 0
call dword [sym.imp.KERNEL32.dll_SetCommState]
lea eax, [ebp - 0x18]
mov dword [ebp - 0x10], 0x1388
xorps xmm0, xmm0
push eax
push ebx
movlpd qword [ebp - 0x18], xmm0
movlpd qword [ebp - 0xc], xmm0
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
push 0x400
push 0x400
push ebx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0
lea eax, [ebp - 0x530]
push eax
push 0xf
lea eax, [ebp - 0x144]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4015ce
cmp dword [ebp - 0x530], 0xf
jne 0x4015ce
lea ecx, [ebp - 0x144]
mov eax, 0x2001768
cmp eax, dword [ecx]
jne 0x4015ce
mov eax, 9
cmp al, byte [ecx + 4]
jne 0x4015ce
mov bh, byte [ebp - 0x13f]
test bh, bh
je 0x4015ce
xor bl, bl
xor eax, eax
xor dl, dl
xor cl, cl
add dl, byte [ebp + eax - 0x144]
add cl, byte [ebp + eax - 0x143]
add eax, 2
cmp eax, 0xd
jl 0x4015a0
cmp eax, 0xe
jge 0x4015c2
mov bl, byte [ebp + eax - 0x144]
add cl, dl
add bl, cl
cmp bl, byte [ebp - 0x136]
je 0x4015ef
push 0
lea eax, [ebp - 0x530]
push eax
push 1
push 0x419198
push dword [ebp - 0x5b0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40142d
push 0x63
lea eax, [ebp - 0x7b]
mov byte [ebp - 0x7c], 0
push 0
push eax
call fcn.00408120
add esp, 0xc
xor edi, edi
test bh, bh
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
je 0x40164a
nop
movzx esi, byte [ebp + edi - 0x13e]
lea eax, [ebp - 0x7c]
push eax
call ebx
lea ecx, [ebp - 0x7c]
mov edx, 0x4191c8
add ecx, eax
mov eax, str.__hu
test edi, edi
push esi
cmove eax, edx
push eax
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
movzx eax, byte [ebp - 0x13f]
inc edi
add esp, 0xc
cmp edi, eax
jl 0x401610
push 0
lea eax, [ebp - 0x530]
push eax
lea eax, [ebp - 0x7c]
push eax
call ebx
push eax
lea eax, [ebp - 0x7c]
push eax
push dword [ebp - 0x5b0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x578]
jmp 0x401427
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov esi, dword [sym.imp.USER32.dll_LoadIconW]
push 0x7f00
push 0
mov dword [ebp - 0x5a8], 0x30
mov dword [ebp - 0x5a4], 0xb
mov dword [ebp - 0x5a0], 0x401a50
mov dword [ebp - 0x59c], 0
mov dword [ebp - 0x598], 0
mov dword [ebp - 0x594], ebx
call esi
push 0x7f00
push 0
mov dword [ebp - 0x590], eax
call esi
push 0x7f00
push 0
mov dword [ebp - 0x57c], eax
call dword [sym.imp.USER32.dll_LoadCursorW]
push 0
mov dword [ebp - 0x58c], eax
call dword [sym.imp.GDI32.dll_GetStockObject]
mov dword [ebp - 0x588], eax
lea eax, [ebp - 0x5a8]
push eax
mov dword [ebp - 0x584], 0
mov dword [ebp - 0x580], 0x4191cc
call dword [sym.imp.USER32.dll_RegisterClassExW]
movzx eax, ax
push 0
test ax, ax
jne 0x40173d
push 0x10
push 0x4191d8
push 0x4191e0
push 0
call dword [sym.imp.USER32.dll_MessageBoxExW]
jmp 0x40142d
push 0
push 0
push 0
push 0
push 0x80000000
push 0
push 0x80000000
push 0x2cf0000
push 0
push eax
push 0
call dword [sym.imp.USER32.dll_CreateWindowExW]
push 0
push 0
push eax
push 0x401a40
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.USER32.dll_GetMessageW]
lea eax, [ebp - 0x574]
push 0
push 0
push 0
push eax
call esi
test eax, eax
je 0x4017c6
mov edi, dword [sym.imp.USER32.dll_TranslateMessage]
mov ebx, dword [sym.imp.USER32.dll_DispatchMessageW]
lea eax, [ebp - 0x574]
push eax
call edi
lea eax, [ebp - 0x574]
push eax
call ebx
push 0
push 0
push 0
lea eax, [ebp - 0x574]
push eax
call esi
test eax, eax
jne 0x4017a1
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x56c]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004065c3
mov esp, ebp
pop ebp
ret 0x10