Function at 0x402170
Capabilities:
Extract resource via kernel32 functions
Query or enumerate registry value
Read file on windows
Set registry value

Disassembly:
mov eax, 0x7d16c
call fcn.00403160
mov al, byte [0x405838]
push ebx
push esi
push edi
mov byte [esp + 0x178], al
mov ecx, 0x1f3ff
xor eax, eax
lea edi, [esp + 0x179]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [0x40501c]
test eax, eax
je 0x40229b
lea ecx, [esp + 0x74]
push 0x104
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x74]
push 0x5c
push edx
call sub.MSVCRT.dll__mbsrchr
mov byte [eax], 0
mov edi, str.EncryptKey.txt
or ecx, 0xffffffff
xor eax, eax
add esp, 8
lea edx, [esp + 0x74]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
push 0x80
and ecx, 3
push 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x40
mov edi, 0x4830bc
rep stosd dword es:[edi], eax
push eax
push 1
lea eax, [esp + 0x88]
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edx, eax
cmp edx, 0xffffffff
jne 0x402245
push str.Can_t_find_EncryptKey.txt_
call fcn.00401000
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 0x7d16c
ret
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x74]
push eax
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x10]
lea eax, [esp + 0x78]
push ecx
push 0x104
push eax
push edx
mov dword [esp + 0x20], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x74]
push ecx
push str.Software_s
push 0x48333c
call sub.MSVCRT.dll_sprintf
mov ecx, 0x40
lea esi, [esp + 0x80]
mov edi, 0x4830bc
add esp, 0xc
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x74]
push 0x4052c0
push 0x67
push eax
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
push edi
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
push edi
push 0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ecx, 0x1f400
lea edi, [esp + 0x178]
rep movsd dword es:[edi], dword [esi]
xor eax, eax
mov dl, byte [eax + 0x4830c1]
mov cl, byte [eax + 0x4830bc]
add dl, cl
mov byte [eax + 0x4830d0], dl
mov cl, byte [eax + 0x4830cb]
add cl, byte [eax + 0x4830c6]
mov byte [eax + 0x4830d4], cl
inc eax
cmp eax, 4
jl 0x4022dc
xor eax, eax
mov edx, eax
and edx, 0x80000007
jns 0x402319
dec edx
or edx, 0xfffffff8
inc edx
mov cl, byte [edx + 0x4830d0]
mov bl, byte [esp + eax + 0x178]
xor bl, cl
mov byte [esp + eax + 0x178], bl
inc eax
cmp eax, 0x7d000
jb 0x40230a
xor eax, eax
mov bl, byte [esp + eax + 0x178]
or dl, 0xff
sub dl, bl
mov byte [esp + eax + 0x178], dl
inc eax
cmp eax, 0x7d000
jb 0x402339
xor eax, eax
mov cl, byte [eax + 0x4830cb]
mov dl, byte [eax + 0x4830bc]
add cl, dl
mov byte [eax + 0x4830da], cl
mov dl, byte [eax + 0x4830c6]
add dl, byte [eax + 0x4830c1]
mov byte [eax + 0x4830de], dl
inc eax
cmp eax, 4
jl 0x402356
xor eax, eax
mov ecx, eax
and ecx, 0x80000007
jns 0x402393
dec ecx
or ecx, 0xfffffff8
inc ecx
mov dl, byte [ecx + 0x4830da]
mov bl, byte [esp + eax + 0x178]
xor bl, dl
mov byte [esp + eax + 0x178], bl
inc eax
cmp eax, 0x7d000
jb 0x402384
mov ecx, 0x1f401
lea esi, [esp + 0x178]
mov edi, 0x405848
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
cmp byte [0x40584e], 0xab
jne 0x402788
cmp byte [0x40584f], 0x56
jne 0x402788
cmp byte [0x405850], 0xce
jne 0x402788
cmp byte [0x405851], 0x58
jne 0x402788
cmp word [0x405881], 0
je 0x402452
xor eax, eax
xor edx, edx
mov al, byte [0x40587f]
mov dl, byte [0x40587d]
xor ecx, ecx
push eax
mov cl, byte [0x40587e]
add edx, 0x7d0
push ecx
push edx
call fcn.00401f50
xor ecx, ecx
add esp, 0xc
mov cx, word [0x405881]
cmp eax, ecx
jb 0x402452
push str.SoftError_0x82__
call fcn.00401000
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 0x7d16c
ret
mov al, byte [0x405883]
test al, al
je 0x402496
push 0
push 0
call fcn.00402070
add esp, 8
mov ecx, 3
mov edi, 0x405884
mov esi, 0x4833a4
xor edx, edx
repe cmpsw word [esi], word es:[edi]
je 0x402496
push str.SoftError_0x83__
call fcn.00401000
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 0x7d16c
ret
cmp word [0x405879], 0
je 0x402590
mov ecx, 0x3f
xor eax, eax
mov edi, 0x4831bc
push 0x482868
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x48333c
push 0x80000002
stosb byte es:[edi], al
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x402534
push 0x482870
push 0x4831bc
push 0x482854
push eax
mov eax, dword [0x482868]
push 0x40511c
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov ecx, dword [0x482868]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x4831bc
call sub.MSVCRT.dll_atoi
xor edx, edx
add esp, 4
mov dx, word [0x405879]
mov dword [0x48286c], eax
cmp eax, edx
jb 0x402590
push str.SoftError_0x81__
call fcn.00401000
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 0x7d16c
ret
mov ecx, 0x3f
xor eax, eax
mov edi, 0x4831bc
push 0x482868
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x48333c
push 0x80000002
stosb byte es:[edi], al
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
mov edi, 0x4831bc
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x4831bc
push 1
push eax
mov eax, dword [0x482868]
push 0x40511c
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov ecx, dword [0x482868]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [0x405878]
and eax, 0xff
sub eax, 0
je 0x4025b2
dec eax
jne 0x4025cc
mov edx, dword [0x482864]
push 1
push 0x285e
push edx
jmp 0x4025bf
mov eax, dword [0x482864]
push 0
push 0x285e
push eax
call dword [sym.imp.USER32.dll_GetDlgItem]
push eax
call dword [sym.imp.USER32.dll_ShowWindow]
mov al, byte [0x405878]
test al, al
mov eax, str.SerialPort
jne 0x4025df
mov eax, 0x405288
push eax
lea ecx, [esp + 0x14]
push str.___Interface:__s
push ecx
call sub.MSVCRT.dll_sprintf
mov edx, dword [0x482864]
mov ebx, dword [sym.imp.USER32.dll_SendDlgItemMessageA]
add esp, 0xc
push 0xfffffffffffffffe
push 0xfffffffffffffffe
push 0xb1
push 0x2860
push edx
call ebx
mov ecx, dword [0x482864]
lea eax, [esp + 0x10]
push eax
push 0
push 0xc2
push 0x2860
push ecx
call ebx
mov edx, dword [0x482864]
push 0xfffffffffffffffe
push 0xfffffffffffffffe
push 0xb1
push 0x2860
push edx
call ebx
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x10]
push 0x40585f
rep stosd dword es:[edi], eax
lea eax, [esp + 0x14]
push str.____Version:__s
push eax
call sub.MSVCRT.dll_sprintf
mov ecx, dword [0x482864]
add esp, 0xc
push 0xfffffffffffffffe
push 0xfffffffffffffffe
push 0xb1
push 0x2860
push ecx
call ebx
mov eax, dword [0x482864]
lea edx, [esp + 0x10]
push edx
push 0
push 0xc2
push 0x2860
push eax
call ebx
mov ecx, dword [0x482864]
push 0xfffffffffffffffe
push 0xfffffffffffffffe
push 0xb1
push 0x2860
push ecx
call ebx
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x10]
push str.___Version_Info:
lea edx, [esp + 0x14]
push 0x40503c
rep stosd dword es:[edi], eax
push edx
call sub.MSVCRT.dll_sprintf
mov eax, dword [0x482864]
add esp, 0xc
mov ecx, 5
mov esi, 0x405864
push 0xffffffffffffffff
push 0xffffffffffffffff
lea edi, [esp + 0x28]
push 0xb1
push 0x2860
push eax
rep movsd dword es:[edi], dword [esi]
call ebx
mov edx, dword [0x482864]
lea ecx, [esp + 0x10]
push ecx
push 0
push 0xc2
push 0x2860
push edx
call ebx
mov eax, dword [0x482864]
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xb1
push 0x2860
push eax
call ebx
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x10]
lea edx, [esp + 0x10]
rep stosd dword es:[edi], eax
mov ecx, dword [0x40588a]
push ecx
push 0x40524c
push edx
call sub.MSVCRT.dll_sprintf
lea eax, [esp + 0x1c]
push eax
push str.DataLen_:_s
call fcn.00401000
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x24]
add esp, 0x14
rep stosd dword es:[edi], eax
mov ecx, dword [0x482864]
push 0x405852
push ecx
call dword [sym.imp.USER32.dll_SetWindowTextA]
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0x7d16c
ret
push str.Fail_to_Unencrypt_
call fcn.00401000
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 0x7d16c
ret