Function at 0x10004efa
Capabilities:
Query environment variable
Read .ini file

Disassembly:
push 0x2d4
mov eax, 0x1001f435
call fcn.1001d218
mov edi, ecx
cmp dword [edi + 0x2070], 0xffffffff
mov byte [edi + 0x2084], 0
jle 0x10005200
mov esi, 0x104
lea eax, [ebp - 0x2b8]
push esi
push eax
push str.CSW_CONFIG_FOLDER
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
jne 0x10004f4b
lea eax, [ebp - 0x2b8]
push esi
push eax
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll__wgetcwd]
pop ecx
pop ecx
lea ecx, [ebp - 0x2c0]
call dword [sym.imp.mfc140u.dll_Ordinal_296]
mov eax, dword [edi + 0x2070]
and dword [ebp - 4], 0
inc eax
push eax
lea eax, [ebp - 0x2c0]
push 0x10023e38
push eax
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__9]
add esp, 0xc
lea eax, [ebp - 0x2b8]
lea ecx, [ebp - 0x2c4]
push eax
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__13]
push str.CommDrv.ini
push eax
lea eax, [ebp - 0x2bc]
mov byte [ebp - 4], 1
push eax
call fcn.100016cd
add esp, 0xc
lea ecx, [ebp - 0x2c4]
mov byte [ebp - 4], 3
call dword [sym.imp.mfc140u.dll_Ordinal_1045]
lea ecx, [ebp - 0x2bc]
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
mov ebx, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
push eax
push 0x50
lea eax, [ebp - 0xb0]
push eax
push 0x10022a64
push str.logdirectory
push str.Common
call ebx
lea eax, [ebp - 0xb0]
push eax
lea ecx, [ebp - 0x2c8]
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__13]
lea ecx, [ebp - 0x2c8]
mov byte [ebp - 4], 4
call dword [sym.imp.mfc140u.dll_Ordinal_8182]
test al, al
jne 0x1000501b
lea eax, [ebp - 0x2c8]
push eax
lea ecx, [edi + 0x2088]
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__12]
lea ecx, [ebp - 0x2bc]
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
lea ecx, [ebp - 0x2c0]
mov esi, eax
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
push esi
push 0x50
lea ecx, [ebp - 0xb0]
push ecx
push 0x1002452c
push str.echo
push eax
call ebx
lea eax, [ebp - 0xb0]
push 0x50
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsupr_s]
lea eax, [ebp - 0xb0]
push 0x10024540
push eax
call sub.VCRUNTIME140.dll_wcsstr
add esp, 0x10
test eax, eax
setne cl
mov byte [edi + 0x2084], cl
test eax, eax
je 0x100051d8
lea ecx, [ebp - 0x2bc]
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
lea ecx, [ebp - 0x2c0]
mov esi, eax
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
push esi
push 0x50
lea ecx, [ebp - 0xb0]
mov esi, 0x10024540
push ecx
push esi
push str.textmode
push eax
call ebx
lea eax, [ebp - 0xb0]
push 0x50
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsupr_s]
lea eax, [ebp - 0xb0]
push esi
push eax
call sub.VCRUNTIME140.dll_wcsstr
add esp, 0x10
lea ecx, [ebp - 0x2bc]
test eax, eax
setne al
mov byte [edi + 0x2090], al
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
lea ecx, [ebp - 0x2c0]
mov esi, eax
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
push esi
push 0x50
lea ecx, [ebp - 0xb0]
push ecx
push 0x10022a64
push str.filename
push eax
call ebx
lea eax, [ebp - 0xb0]
mov ecx, edi
push eax
call fcn.100057ae
lea ecx, [ebp - 0x2bc]
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
lea ecx, [ebp - 0x2c0]
mov esi, eax
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
push esi
push 0x50
lea ecx, [ebp - 0xb0]
mov esi, 0x10024540
push ecx
push esi
push str.reset
push eax
call ebx
lea eax, [ebp - 0xb0]
push 0x50
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsupr_s]
lea eax, [ebp - 0xb0]
push esi
push eax
call sub.VCRUNTIME140.dll_wcsstr
add esp, 0x10
test eax, eax
je 0x100051d8
lea eax, [ebp - 0x2c4]
mov ecx, edi
push eax
call fcn.100048c5
lea ecx, [ebp - 0x2e0]
mov byte [ebp - 4], 5
call fcn.1001ce3a
push 0
push 0x5001
lea ecx, [ebp - 0x2c4]
mov byte [ebp - 4], 6
call dword [sym.imp.mfc140u.dll_Ordinal_1663]
push eax
lea ecx, [ebp - 0x2e0]
call sub.mfc140u.dll_CStdioFile::Open
test eax, eax
je 0x100051c1
lea ecx, [ebp - 0x2e0]
call sub.mfc140u.dll_CStdioFile::Close
lea ecx, [ebp - 0x2e0]
call sub.mfc140u.dll_CStdioFile::CStdioFile
lea ecx, [ebp - 0x2c4]
call dword [sym.imp.mfc140u.dll_Ordinal_1045]
lea ecx, [ebp - 0x2c8]
call dword [sym.imp.mfc140u.dll_Ordinal_1045]
lea ecx, [ebp - 0x2bc]
call dword [sym.imp.mfc140u.dll_Ordinal_1045]
lea ecx, [ebp - 0x2c0]
call dword [sym.imp.mfc140u.dll_Ordinal_1045]
mov al, 1
jmp 0x10005202
xor al, al
call fcn.1001d1c7
ret