Function at 0x40ca20
Capabilities:
Contain obfuscated stackstrings
Query environment variable

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x9fc
lea ebx, [esp + 0xf0]
mov dword [esp + 0x63], 0x494d554c
mov dword [esp + 0x67], 0x504f4f4c
mov dword [esp + 0x6b], 0x696e692e
mov byte [esp + 0x6f], 0
mov dword [esp + 8], 0x200
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
sub esp, 0xc
mov eax, dword [esp + 0xa10]
test byte [eax + 0x1a], 8
jne 0x40d1c8
mov dword [esp], ebx
call sym._strlen
sub eax, 1
jne 0x40ca94
jmp 0x40cac1
test eax, eax
je 0x40cac1
movzx edx, byte [ebx + eax]
mov ecx, eax
sub eax, 1
cmp dl, 0x5c
jne 0x40ca90
cmp byte [esp + eax + 0xf0], 0x3a
lea edi, [esp + 0x9f0]
sete al
add ecx, edi
movzx eax, al
mov byte [eax + ecx - 0x900], 0
mov dword [esp], str.LOCALAPPDATA
call sym._getenv
test eax, eax
je 0x40d208
mov dword [esp + 4], eax
lea eax, [esp + 0x70]
mov dword [esp], eax
mov dword [esp + 0x3c], eax
call sym._strcpy
mov eax, dword [esp + 0xa10]
test byte [eax + 0x1a], 8
jne 0x40d1f0
mov eax, dword [esp + 0xa10]
mov dword [esp + 4], str.10001
add eax, 0xe5
mov dword [esp], eax
mov dword [esp + 0x30], eax
call sym.sprintf_char__char_const__..._
mov eax, dword [esp + 0xa10]
mov dword [esp + 4], 0x498301
add eax, 0xed
mov dword [esp], eax
mov dword [esp + 0x40], eax
call sym.sprintf_char__char_const__..._
mov eax, dword [esp + 0xa10]
mov dword [esp + 4], 0x498301
add eax, 0xf5
mov dword [esp], eax
mov dword [esp + 0x34], eax
call sym.sprintf_char__char_const__..._
mov eax, dword [esp + 0xa10]
mov dword [esp + 4], ebx
add eax, 0x2fd
mov dword [esp], eax
mov dword [esp + 0x2c], eax
call sym.sprintf_char__char_const__..._
mov eax, dword [esp + 0xa10]
mov edx, dword [esp + 0xa18]
add eax, 0xfd
mov dword [esp + 0x28], eax
test edx, edx
je 0x40d228
mov eax, dword [esp + 0xa18]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sym.sprintf_char__char_const__..._
lea eax, [esp + 0x63]
mov dword [esp + 0xc], 0x5c
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], 0x498299
mov dword [esp + 8], eax
lea eax, [esp + 0x1f0]
mov dword [esp], eax
call sym.sprintf_char__char_const__..._
lea eax, [esp + 0x63]
mov dword [esp + 0xc], 0x5c
mov dword [esp + 0x10], eax
lea eax, [esp + 0x3f0]
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x498299
mov dword [esp], eax
call sym.sprintf_char__char_const__..._
lea eax, [esp + 0x1f0]
mov dword [esp + 4], 0x498303
mov dword [esp], eax
call sym._fopen
mov ebp, dword [dbg.__acrt_iob_func]
mov edi, eax
test eax, eax
je 0x40d448
lea esi, [esp + 0x1f0]
mov dword [esp], 2
call ebp
mov dword [esp + 8], esi
lea esi, [esp + 0x5f0]
mov dword [esp + 4], str.Configuration_file:__s
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov eax, dword [sym.imp.msvcrt.dll__strnicmp]
mov byte [esp + 0x4b], 0
mov byte [esp + 0x4a], 0
mov byte [esp + 0x38], 0
mov dword [esp + 0x44], eax
mov dword [esp + 8], edi
mov dword [esp + 4], 0x1000
mov dword [esp], esi
call sym._fgets
test eax, eax
je 0x40cda0
movzx eax, byte [esp + 0x5f0]
cmp al, 0x5b
je 0x40cd50
cmp al, 0x3b
setne cl
test al, al
setne dl
test cl, dl
je 0x40cc70
cmp al, 0x23
je 0x40cc70
mov dword [esp + 4], 0x3d
mov dword [esp], esi
call sym._strchr
test eax, eax
je 0x40cc70
mov dword [esp], esi
call sym._strlen
cmp byte [esp + 0x38], 1
mov byte [esp + eax + 0x5f0], 0
je 0x40d0e8
mov dword [esp + 8], 0xc
mov eax, dword [esp + 0x44]
mov dword [esp + 4], esi
mov dword [esp], str.update_check
call eax
test eax, eax
jne 0x40d240
mov dword [esp + 4], 0x3d
mov dword [esp], esi
call sym._strchr
lea edx, [esp + 0x7f0]
mov dword [esp + 8], 8
mov dword [esp + 4], edx
mov dword [esp], eax
call sym.extract_var_string_char__char__int_
lea edx, [esp + 0x7f0]
test eax, eax
je 0x40cc70
mov eax, dword [esp + 0x40]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym.sprintf_char__char_const__..._
jmp 0x40cc70
mov dword [esp + 8], 0xf
mov dword [esp + 4], esi
mov dword [esp], str._lspm_tcp_server_
call dword [sym.imp.msvcrt.dll__strnicmp]
mov dword [esp + 8], 6
test eax, eax
mov dword [esp + 4], esi
sete byte [esp + 0x38]
mov dword [esp], str._main_
call dword [sym.imp.msvcrt.dll__strnicmp]
test eax, eax
movzx eax, byte [esp + 0x5f0]
sete byte [esp + 0x4a]
jmp 0x40cc9c
mov dword [esp], edi
call sym._fclose
mov dword [esp], 2
call ebp
mov dword [esp + 4], str._n____________________________Configuration_Summary_____________________________n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov dword [esp], 2
call ebp
mov dword [esp + 0xc], str.Value
mov dword [esp + 8], str.Name
mov dword [esp + 4], str.__22s__54s_n_____________________________________________________________________________n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov dword [esp], 2
call ebp
mov esi, dword [esp + 0x30]
mov dword [esp + 8], str.PORT
mov dword [esp + 4], str.__22s__54s_n
mov dword [esp + 0xc], esi
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov edi, dword [esp + 0x28]
mov dword [esp], edi
call sym._strlen
cmp eax, 0x36
jbe 0x40d0a0
lea ebx, [edi + eax - 0x18]
mov dword [esp], 2
call ebp
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], edi
mov dword [esp + 8], str.CAL_PATH
mov dword [esp + 4], str.__22s__.25s_...__24s_n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov esi, dword [esp + 0x2c]
mov dword [esp], esi
call sym._strlen
cmp eax, 0x36
jbe 0x40d068
lea ebx, [esi + eax - 0x18]
mov dword [esp], 2
call ebp
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], esi
mov dword [esp + 8], str.SAVE_PATH
mov dword [esp + 4], str.__22s__.25s_...__24s_n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov dword [esp], 2
call ebp
mov edi, dword [esp + 0x40]
mov dword [esp + 8], str.UPDATE_CHECK
mov dword [esp + 4], str.__22s__54s_n
mov dword [esp + 0xc], edi
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov dword [esp], 2
call ebp
mov ebx, dword [esp + 0x34]
mov dword [esp + 8], str.LEGACY_IDN
mov dword [esp + 4], str.__22s__54s_n
mov dword [esp + 0xc], ebx
lea ebx, [esp + 0x5c]
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov dword [esp], 2
call ebp
mov dword [esp + 4], str.______________________________________________________________________________n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x496160
mov dword [esp], edi
mov dword [esp + 0x5c], 0xffffffff
call sym.sscanf_char_const__char_const__..._
test eax, eax
je 0x40cf2d
cmp dword [esp + 0x5c], 1
jbe 0x40cf53
mov dword [esp], 2
lea edi, [esp + 0x63]
call ebp
mov dword [esp + 8], edi
mov dword [esp + 4], str._nERROR_while_parsing_configuration_file__s:_invalid_UPDATE_CHECK_value__0_or_1_allowed_._n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
call sym._exit_programm
mov eax, dword [esp + 0x34]
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x496160
mov dword [esp], eax
mov dword [esp + 0x5c], 0xffffffff
call sym.sscanf_char_const__char_const__..._
test eax, eax
je 0x40cf84
mov eax, dword [esp + 0x5c]
cmp eax, 1
jbe 0x40d0d0
mov dword [esp], 2
lea esi, [esp + 0x63]
call ebp
mov dword [esp + 8], esi
mov dword [esp + 4], str._nERROR_while_parsing_configuration_file__s:_invalid_LEGACY_IDN_value__0_or_1_allowed_._n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
call sym._exit_programm
mov eax, dword [esp + 0x30]
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x496160
mov dword [esp], eax
mov dword [esp + 0x5c], 0xffffffff
call sym.sscanf_char_const__char_const__..._
test eax, eax
je 0x40d038
mov eax, dword [esp + 0x5c]
sub eax, 1
cmp eax, 0xa00ad
ja 0x40d038
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call dbg.opendir
mov ebx, eax
test eax, eax
je 0x40d410
mov dword [esp], ebx
call dbg.closedir
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call dbg.opendir
mov ebx, eax
test eax, eax
je 0x40d570
mov dword [esp], ebx
call dbg.closedir
cmp dword [esp + 0xa1c], 1
je 0x40d280
add esp, 0x9fc
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 2
lea ebx, [esp + 0x63]
call ebp
mov dword [esp + 8], ebx
mov dword [esp + 4], str._nERROR_while_parsing_configuration_file__s:_invalid_PORT_value__1_655535_allowed_._n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
call sym._exit_programm
jmp 0x40cfdc
mov dword [esp], 2
call ebp
mov edi, dword [esp + 0x2c]
mov dword [esp + 8], str.SAVE_PATH
mov dword [esp + 4], str.__22s__54s_n
mov dword [esp + 0xc], edi
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
jmp 0x40ce97
mov dword [esp], 2
call ebp
mov edi, dword [esp + 0x28]
mov dword [esp + 8], str.CAL_PATH
mov dword [esp + 4], str.__22s__54s_n
mov dword [esp + 0xc], edi
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
jmp 0x40ce55
mov ecx, dword [esp + 0xa10]
mov byte [ecx + 0xe4], al
jmp 0x40cfaa
mov eax, dword [sym.imp.msvcrt.dll__strnicmp]
mov dword [esp + 8], 4
mov dword [esp + 4], esi
mov dword [esp], str.port
mov dword [esp + 0x4c], eax
call eax
test eax, eax
je 0x40d398
mov dword [esp + 8], 8
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], esi
mov dword [esp], str.cal_path
call eax
or eax, dword [esp + 0xa18]
je 0x40d6a5
mov dword [esp + 8], 9
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], esi
mov dword [esp], str.save_path
call eax
test eax, eax
je 0x40d5a3
mov dword [esp + 8], 0xa
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], esi
mov dword [esp], str.legacy_idn
call eax
test eax, eax
jne 0x40cc70
mov dword [esp + 4], 0x3d
mov dword [esp], esi
call sym._strchr
lea edx, [esp + 0x7f0]
mov dword [esp + 8], 8
mov dword [esp + 4], edx
mov dword [esp], eax
call sym.extract_var_string_char__char__int_
lea edx, [esp + 0x7f0]
test eax, eax
je 0x40cc70
mov eax, dword [esp + 0x34]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym.sprintf_char__char_const__..._
jmp 0x40cc70
mov eax, dword [esp + 0xa14]
mov dword [esp + 4], ebx
mov dword [esp], str.DEBUG:_work_directory:__s_nDEBUG:_argv_0_:__s_n
mov dword [esp + 8], eax
call sym.printf_char_const__..._
jmp 0x40ca7b
mov dword [esp + 4], ebx
mov dword [esp], str.DEBUG:_ini_file_path:__s_n
call sym.printf_char_const__..._
jmp 0x40cafa
lea eax, [esp + 0x70]
mov dword [esp + 4], ebx
mov dword [esp], eax
mov dword [esp + 0x3c], eax
call sym._strcpy
jmp 0x40cae9
mov dword [esp + 4], ebx
mov dword [esp], eax
call sym.sprintf_char__char_const__..._
jmp 0x40cbac
mov dword [esp + 8], 9
mov eax, dword [esp + 0x44]
mov dword [esp + 4], esi
mov dword [esp], str.save_path
call eax
test eax, eax
jne 0x40cc70
movzx edx, byte [esp + 0x4b]
xor edx, 1
and dl, byte [esp + 0x4a]
jne 0x40d5fb
mov byte [esp + 0x38], 0
jmp 0x40cc70
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x10], str.lspm_tcp_server_scpi.log
mov dword [esp + 0xc], 0x5c
mov dword [esp + 8], eax
lea eax, [esp + 0x1f0]
mov dword [esp + 4], 0x498299
mov dword [esp], eax
call sym.sprintf_char__char_const__..._
mov dword [esp], 0x190
call sym._malloc
mov edi, eax
test eax, eax
je 0x40d6f8
lea eax, [esp + 0x1f0]
mov dword [esp + 4], 0x498303
mov dword [esp], eax
call sym._fopen
xor edx, edx
mov ebx, eax
mov dword [esp + 0x28], eax
xor eax, eax
test ebx, ebx
je 0x40d36f
xor ebx, ebx
lea esi, [esp + 0x5f0]
lea esi, [esi]
nop
mov eax, dword [esp + 0x28]
mov dword [esp + 4], 0x1000
mov dword [esp], esi
mov dword [esp + 8], eax
call sym._fgets
test eax, eax
je 0x40d360
mov dword [esp], esi
call sym._strlen
mov ecx, eax
mov eax, esi
add ecx, esi
jmp 0x40d34a
movzx edx, byte [eax]
mov ebp, eax
add eax, 1
cmp dl, 0xd
je 0x40d3f0
cmp dl, 0xa
je 0x40d3f0
cmp eax, ecx
jne 0x40d330
mov dword [esp], esi
add ebx, 1
call sym._strdup
mov dword [edi + ebx*4 - 4], eax
jmp 0x40d300
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sym._fclose
mov eax, ebx
cdq
mov dword [esp + 8], eax
lea eax, [esp + 0x1f0]
mov dword [esp + 4], edi
mov dword [esp + 0xc], edx
mov dword [esp], eax
call sym._init_scpi_log
add esp, 0x9fc
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], 0x3d
mov dword [esp], esi
call sym._strchr
lea edx, [esp + 0x7f0]
mov dword [esp + 8], 8
mov dword [esp + 4], edx
mov dword [esp], eax
call sym.extract_var_string_char__char__int_
lea edx, [esp + 0x7f0]
test eax, eax
je 0x40cc70
mov eax, dword [esp + 0x30]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym.sprintf_char__char_const__..._
jmp 0x40cc70
mov byte [ebp], 0
add ebx, 1
mov dword [esp], esi
call sym._strdup
mov dword [edi + ebx*4 - 4], eax
jmp 0x40d300
mov dword [esp], 2
lea edi, [esp + 0x63]
call ebp
mov esi, dword [esp + 0x28]
mov dword [esp + 8], edi
mov dword [esp + 4], str._nERROR_while_parsing_configuration_file__s:_Cannot_open_CAL_PATH_directory__s_n
mov dword [esp + 0xc], esi
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
call sym._exit_programm
jmp 0x40cff2
mov dword [esp], 2
lea esi, [esp + 0x1f0]
call ebp
mov dword [esp + 8], esi
mov dword [esp + 4], str.Missing_user_configuration_file__s.
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
lea eax, [esp + 0x3f0]
mov dword [esp + 4], 0x498303
mov dword [esp], eax
call sym._fopen
mov edi, eax
test eax, eax
je 0x40d549
lea esi, [esp + 0x3f0]
mov dword [esp], 2
call ebp
lea ecx, [esp + 0x1f0]
mov dword [esp + 8], esi
lea esi, [esp + 0x5f0]
mov dword [esp + 0xc], ecx
mov dword [esp + 4], str.Copying_configuration_file_from_install_path__s_to__s._n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
lea eax, [esp + 0x1f0]
mov dword [esp + 4], 0x4983a0
mov dword [esp], eax
call sym._fopen
mov dword [esp + 0x38], eax
test eax, eax
jne 0x40d4fc
jmp 0x40d65b
mov dword [esp + 4], eax
mov dword [esp], esi
call sym._fputs
mov dword [esp + 8], edi
mov dword [esp + 4], 0x1000
mov dword [esp], esi
call sym._fgets
test eax, eax
mov eax, dword [esp + 0x38]
jne 0x40d4f0
mov dword [esp], eax
call sym._fclose
mov dword [esp], edi
call sym._fclose
lea eax, [esp + 0x1f0]
mov dword [esp + 4], 0x498303
mov dword [esp], eax
call sym._fopen
mov edi, eax
test edi, edi
jne 0x40cc2d
mov dword [esp], 2
lea ebx, [esp + 0x63]
call ebp
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Configuration_file:__s_not_found__using_defaults.
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
jmp 0x40cda8
mov dword [esp], 2
lea esi, [esp + 0x63]
call ebp
mov ecx, dword [esp + 0x2c]
mov dword [esp + 8], esi
mov dword [esp + 4], str._nERROR_while_parsing_configuration_file__s:_Cannot_open_SAVE_PATH_directory__s_n
mov dword [esp + 0xc], ecx
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
call sym._exit_programm
jmp 0x40d010
mov dword [esp + 4], 0x3d
mov dword [esp], esi
call sym._strchr
lea edx, [esp + 0x7f0]
mov dword [esp + 8], 0x200
mov dword [esp + 4], edx
mov dword [esp], eax
call sym.extract_var_string_char__char__int_
lea edx, [esp + 0x7f0]
test eax, eax
je 0x40cc70
mov eax, dword [esp + 0x2c]
mov dword [esp + 8], ebx
mov dword [esp], edx
mov dword [esp + 4], eax
call sym.parse_path_string_char__char__char_
mov byte [esp + 0x4b], 1
jmp 0x40cc70
mov dword [esp + 4], 0x3d
mov dword [esp], esi
mov byte [esp + 0x4a], dl
call sym._strchr
lea ecx, [esp + 0x7f0]
mov dword [esp + 8], 0x200
mov dword [esp + 4], ecx
mov dword [esp], eax
call sym.extract_var_string_char__char__int_
movzx ecx, byte [esp + 0x38]
test eax, eax
mov byte [esp + 0x4b], cl
lea ecx, [esp + 0x7f0]
je 0x40cc70
mov eax, dword [esp + 0x2c]
mov dword [esp + 8], ebx
mov dword [esp], ecx
mov dword [esp + 4], eax
call sym.parse_path_string_char__char__char_
jmp 0x40cc70
mov dword [esp], 2
call ebp
lea ecx, [esp + 0x1f0]
mov dword [esp + 4], str.Failed_to_create_file__s._n
mov dword [esp + 8], ecx
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
mov dword [esp], edi
call sym._fclose
lea eax, [esp + 0x3f0]
mov dword [esp + 4], 0x498303
mov dword [esp], eax
call sym._fopen
mov edi, eax
jmp 0x40d541
mov dword [esp + 4], 0x3d
mov dword [esp], esi
call sym._strchr
lea edx, [esp + 0x7f0]
mov dword [esp + 8], 0x200
mov dword [esp + 4], edx
mov dword [esp], eax
call sym.extract_var_string_char__char__int_
lea edx, [esp + 0x7f0]
test eax, eax
je 0x40cc70
mov eax, dword [esp + 0x28]
mov dword [esp + 8], ebx
mov dword [esp], edx
mov dword [esp + 4], eax
call sym.parse_path_string_char__char__char_
jmp 0x40cc70
mov dword [esp], 2
call ebp
mov dword [esp + 8], 0x64
mov dword [esp + 4], str.get_and_print_config_data__:_failed_to_realloc_past_scpi_cmds_to_size__d._n
mov dword [esp], eax
call sym.fprintf__iobuf__char_const__..._
jmp 0x40d026