Function at 0x401020
Capabilities:
Connect pipe
Extract resource via kernel32 functions
Get disk information
Read .ini file
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x87c
mov eax, dword [0x419340]
xor eax, esp
mov dword [esp + 0x878], eax
push ebx
mov eax, ecx
push ebp
mov ebp, dword [eax]
push esi
mov dword [esp + 0x64], eax
mov eax, dword [eax + 4]
xor ebx, ebx
cmp dword [0xb51d14], 0x7ab
push edi
mov esi, edx
mov dword [esp + 0x60], eax
mov dword [esp + 0x10], 0xc6ef3720
jne 0x401067
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
cmp dword [0xb51d14], 0xe5a
mov ecx, dword [esi]
mov dword [esp + 0x74], 0x9e3779b9
mov dword [esp + 0x6c], ecx
jne 0x401089
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetCommTimeouts]
cmp dword [0xb51d14], 0xfb2
mov edx, dword [esi + 4]
mov dword [esp + 0x70], edx
jne 0x4010af
push ebx
push ebx
lea eax, [esp + 0x90]
push eax
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov ecx, dword [esi + 8]
mov edx, dword [esi + 0xc]
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x78], edx
mov dword [esp + 0x64], 0x20
jmp 0x4010d2
xor ebx, ebx
cmp dword [0xb51d14], 0x55e
jne 0x4010e6
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
mov edi, ebp
shl edi, 4
cmp dword [0xb51d14], 0x7a2
mov dword [0xb4fd1c], 0xdf3a1ab4
jne 0x40112b
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push ebx
lea eax, [esp + 0x8c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetVolumeNameForVolumeMountPointA]
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x10]
mov esi, ebp
shr esi, 5
add esi, dword [esp + 0x78]
add edi, ecx
add edx, ebp
xor edi, edx
cmp dword [0xb51d14], 0x772
mov dword [0xb51cf0], ebx
mov dword [0xb51cf4], ebx
jne 0x401177
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [0xb51ce8], 0xdba0ee06
mov dword [0xb51cec], 0xffffffff
xor esi, edi
sub dword [esp + 0x60], esi
mov dword [esp + 0x14], ebx
xor ebx, 0x13ddeb07
sub dword [esp + 0x14], 0x626fef52
mov eax, 0x364e541
sub dword [esp + 0x14], 0x142a1968
add dword [esp + 0x14], 0x769a08be
mov ebx, dword [esp + 0x60]
mov ecx, dword [esp + 0x14]
mov edi, ebx
shl edi, cl
add edi, dword [esp + 0x6c]
cmp dword [0xb51d14], 0xc1a
jne 0x4011d0
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov eax, dword [esp + 0x10]
mov esi, ebx
shr esi, 5
add esi, dword [esp + 0x70]
add eax, ebx
xor edi, eax
cmp dword [0xb51d14], 0x11b4
jne 0x40120b
lea ecx, [esp + 0x80]
push ecx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetCurrentConsoleFont]
push 0
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
mov dword [esp + 0x24], 0x76d6fd20
mov dword [esp + 0x54], 0x54f179d1
mov dword [esp + 0x48], 0x69a2475d
mov dword [esp + 0x18], 0x3dcd6af5
mov dword [esp + 0x28], 0x1b19b957
mov dword [esp + 0x4c], 0x218bb6cb
mov dword [esp + 0x5c], 0x2c03c6b2
mov dword [esp + 0x50], 0x6b7fb8e7
mov dword [esp + 0x3c], 0x7c6a6dca
mov dword [esp + 0x30], 0x6c6f1b30
mov dword [esp + 0x34], 0x4e584eff
mov dword [esp + 0x38], 0x38c39750
mov dword [esp + 0x40], 0x403df789
mov dword [esp + 0x20], 0x42c2e874
mov dword [esp + 0x44], 0x4c23256a
mov dword [esp + 0x58], 0x390722f4
mov dword [esp + 0x2c], 0x7b21d6ed
mov dword [esp + 0x1c], 0x7593ad3c
add dword [esp + 0x24], 0x24e00739
sub dword [esp + 0x24], 0x979c846
add dword [esp + 0x24], 0x730dd00f
add dword [esp + 0x24], 0x5c238c12
add dword [esp + 0x24], 0x54d86807
sub dword [esp + 0x24], 0x7573c7e8
sub dword [esp + 0x24], 0x5e2c9f3a
sub dword [esp + 0x24], 0x537dde60
sub dword [esp + 0x24], 0x54e4f56b
add dword [esp + 0x54], 0x723efba2
sub dword [esp + 0x54], 0x4c009074
add dword [esp + 0x18], 0x71f56b5f
add dword [esp + 0x18], 0x4de9bbbb
add dword [esp + 0x4c], 0x50195e9f
sub dword [esp + 0x48], 0xffe06b1
add dword [esp + 0x5c], 0x264b7200
add dword [esp + 0x48], 0x3b8952a
add dword [esp + 0x18], 0xfad21ef
sub dword [esp + 0x5c], 0x14b42d56
add dword [esp + 0x24], 0x13d46dfc
add dword [esp + 0x48], 0xef4cf85
add dword [esp + 0x5c], 0x48674ea1
add dword [esp + 0x54], 0x1fd62516
add dword [esp + 0x5c], 0x5f37642a
sub dword [esp + 0x28], 0x47e00c41
add dword [esp + 0x54], 0x6b76b838
add dword [esp + 0x5c], 0x6e3d05e9
add dword [esp + 0x5c], 0x36620939
sub dword [esp + 0x48], 0x6cb87b5e
add dword [esp + 0x54], 0x509f1b3e
add dword [esp + 0x3c], 0x7f0d4dc
sub dword [esp + 0x5c], 0x2451277c
add dword [esp + 0x50], 0x7c3f2f0e
sub dword [esp + 0x4c], 0x3dfca1c
add dword [esp + 0x3c], 0x1254eca9
add dword [esp + 0x4c], 0x4e2b360f
add dword [esp + 0x30], 0x531d12dc
sub dword [esp + 0x18], 0xca026cf
sub dword [esp + 0x48], 0x4685a937
sub dword [esp + 0x50], 0x5d1d94dc
sub dword [esp + 0x48], 0x1548473a
sub dword [esp + 0x50], 0x2ef027fa
sub dword [esp + 0x40], 0x29f227df
add dword [esp + 0x28], 0x5c5f9dc3
sub dword [esp + 0x50], 0x10efe6fd
sub dword [esp + 0x34], 0x6c98f2bb
add dword [esp + 0x48], 0x667e382d
add dword [esp + 0x40], 0x7a258e1a
add dword [esp + 0x24], 0x34808322
add dword [esp + 0x48], 0x7096f616
add dword [esp + 0x54], 0x6afcf9f8
sub dword [esp + 0x5c], 0x18b65941
sub dword [esp + 0x48], 0xc693a67
add dword [esp + 0x48], 0x1e0e017e
add dword [esp + 0x50], 0x580f4e52
add dword [esp + 0x50], 0x22c96c
add dword [esp + 0x20], 0x3b73945f
add dword [esp + 0x24], 0x282c6f0c
sub dword [esp + 0x20], 0x44b05731
add dword [esp + 0x44], 0x19db16d2
add dword [esp + 0x30], 0x4c1317fd
add dword [esp + 0x44], 0x619ab275
sub dword [esp + 0x3c], 0x71b4b79c
add dword [esp + 0x30], 0x1e2cf0a7
sub dword [esp + 0x38], 0x2ee0d7d9
add dword [esp + 0x1c], 0x1f5e105c
sub dword [esp + 0x58], 0x2d5f1365
add dword [esp + 0x40], 0x6ffa8af2
sub dword [esp + 0x44], 0x32729df6
add dword [esp + 0x2c], 0x13ef88b4
sub dword [esp + 0x18], 0x1ce8f97d
sub dword [esp + 0x50], 0x37f18eab
add dword [esp + 0x5c], 0x255873fb
add dword [esp + 0x48], 0x2d2b3a3d
xor esi, edi
sub ebp, esi
mov eax, dword [esp + 0x74]
sub dword [esp + 0x10], eax
sub dword [esp + 0x64], 1
jne 0x4010d0
cmp dword [0xb51d14], 0x161
jne 0x401537
push 0
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
push 0
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CompareStringW]
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x60]
mov dword [eax + 4], edx
jmp 0x401542
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x60]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x888]
pop edi
pop esi
mov dword [eax], ebp
pop ebp
pop ebx
xor ecx, esp
call fcn.0040197f
add esp, 0x87c
ret