Function at 0x401000
Capabilities:
Read .ini file

Disassembly:
mov eax, 0x404038
call sub.MSVCRT.dll__EH_prolog
sub esp, 0xa44
lea eax, [ebp - 0x12c]
push eax
push 0x4064f0
call fcn.00402118
pop ecx
test eax, eax
pop ecx
jne 0x40102f
push 1
pop eax
jmp 0x40143c
or dword [ebp - 0x10], 0xffffffff
push ebx
push esi
push edi
lea eax, [ebp - 0x848]
push 0x208
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x848]
push eax
lea eax, [ebp - 0x640]
push eax
call sub.MSVCRT.dll_strcpy
mov esi, dword [sym.imp.MSVCRT.dll__mbsrchr]
lea eax, [ebp - 0x640]
push 0x5c
push eax
call esi
add esp, 0x10
test eax, eax
je 0x401085
lea eax, [ebp - 0x640]
push 0x5c
push eax
call esi
and byte [eax], 0
pop ecx
pop ecx
mov esi, dword [sym.imp.MSVCRT.dll_fopen]
lea eax, [ebp - 0x848]
push 0x4064ec
push eax
call esi
mov ebx, eax
xor eax, eax
test ebx, ebx
setne al
pop ecx
test eax, eax
pop ecx
jne 0x4010cd
lea eax, [ebp - 0x848]
push eax
push str.Open___s__error
push str.Main
call fcn.00401935
add esp, 0xc
mov dword [ebp - 0x10], 0xfffff7fb
jmp 0x401427
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x12c]
push str.__temp.zip
push eax
lea eax, [ebp - 0xa50]
push 0x4064c0
push eax
call edi
lea eax, [ebp - 0xa50]
push 0x4064bc
push eax
call esi
mov esi, eax
add esp, 0x18
xor eax, eax
test esi, esi
setne al
test eax, eax
jne 0x401130
lea eax, [ebp - 0xa50]
push eax
push str.Open___s__error
push str.Main
call fcn.00401935
add esp, 0xc
mov dword [ebp - 0x10], 0xfffff7f6
jmp 0x401427
and byte [0x406039], 0
push 0x406031
call dword [sym.imp.MSVCRT.dll_atoi]
pop ecx
xor ecx, ecx
test eax, eax
setg cl
test ecx, ecx
jne 0x401155
push str.The_agent_install_package_is_corrupted
jmp 0x401171
push 0
push eax
push ebx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
neg eax
sbb eax, eax
inc eax
mov dword [ebp - 0x14], eax
jne 0x401189
push str.seek_error
push str.Main
call fcn.00401935
pop ecx
mov dword [ebp - 0x10], 0xfffff7f8
pop ecx
jmp 0x401427
lea eax, [ebp - 0x12c]
push eax
lea eax, [ebp - 0xa50]
push eax
push esi
push ebx
call fcn.0040163e
add esp, 0x10
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x4011c5
push str.extract_error
push str.Main
call fcn.00401935
pop ecx
mov dword [ebp - 0x10], 0xfffff7fa
pop ecx
jmp 0x401427
cmp dword [0x407b40], 0
mov esi, 0x40730c
je 0x40128a
mov ebx, str.Agent
push ebx
push str.Install
push str.__s_s
push esi
call edi
lea eax, [ebp - 0x12c]
push str.Agent.ini
push eax
lea eax, [ebp - 0x438]
push 0x4064c0
push eax
call edi
add esp, 0x20
lea eax, [ebp - 0x438]
push eax
lea eax, [ebp - 0x334]
push 0x208
push eax
push 0x4071d8
push str.InstallPath
push ebx
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
test eax, eax
je 0x401247
lea eax, [ebp - 0x334]
push eax
push str.InstDir
push esi
push str._s___s_s
push esi
call edi
add esp, 0x14
lea eax, [ebp - 0x438]
push eax
lea eax, [ebp - 0x334]
push 0x208
push eax
push 0x4071d8
push str.DataPath
push ebx
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
test eax, eax
je 0x40128a
lea eax, [ebp - 0x334]
mov ebx, str._s___s_s
push eax
push str.DataDir
push esi
push ebx
push esi
call edi
add esp, 0x14
jmp 0x40128f
mov ebx, str._s___s_s
push dword [0x406388]
call sub.MSVCRT.dll_strlen
test eax, eax
pop ecx
jbe 0x4012b2
push dword [0x406388]
push str.EmbeddedUsername
push esi
push ebx
push esi
call edi
add esp, 0x14
push dword [0x40638c]
call sub.MSVCRT.dll_strlen
test eax, eax
pop ecx
jbe 0x4012d5
push dword [0x40638c]
push str.EmbeddedDomain
push esi
push ebx
push esi
call edi
add esp, 0x14
push dword [0x406390]
call sub.MSVCRT.dll_strlen
test eax, eax
pop ecx
jbe 0x4012f8
push dword [0x406390]
push str.EmbeddedPassword
push esi
push ebx
push esi
call edi
add esp, 0x14
cmp dword [0x407b44], 0
lea eax, [ebp - 0x12c]
push eax
je 0x401364
push str._sFramePkg.exe
lea eax, [ebp - 0x230]
push 0x104
push eax
call dword [sym.imp.MSVCRT.dll__snprintf]
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x848]
push eax
call fcn.004021b7
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x230]
push eax
push str.CreateService
push esi
push str._s___s__s_
push esi
call edi
lea eax, [ebp - 0x12c]
push eax
push str.Cleanup2
push esi
push str._s___s__s_
push esi
call edi
add esp, 0x40
jmp 0x401375
push str.Cleanup
push esi
push str._s___s__s_
push esi
call edi
add esp, 0x14
push 0x4071dc
push str.LOGDIR
push esi
push ebx
push esi
call edi
xor ebx, ebx
add esp, 0x14
cmp dword [ebp - 0x14], ebx
je 0x401427
lea eax, [ebp - 0x12c]
push str.FrmInst.exe
push eax
lea eax, [ebp - 0x640]
push 0x4064c0
push eax
call edi
add esp, 0x10
lea ecx, [ebp - 0x28]
call fcn.00402016
lea eax, [ebp - 0x640]
push esi
push eax
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], ebx
call fcn.00402052
cmp eax, ebx
je 0x401414
cmp dword [0x407b3c], ebx
je 0x4013f4
push ebx
push ebx
push 4
call fcn.0040268b
add esp, 0xc
lea ecx, [ebp - 0x28]
push 0x3e8
call fcn.00402103
mov dword [ebp - 0x10], ebx
jmp 0x40141b
lea eax, [ebp - 0x10]
lea ecx, [ebp - 0x28]
push eax
push 0xffffffffffffffff
call fcn.004020cd
cmp dword [0x407b44], ebx
je 0x40141b
call fcn.00401448
mov dword [ebp - 0x10], eax
jmp 0x40141b
mov dword [ebp - 0x10], 0xfffff7f9
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
call fcn.0040202e
xor eax, eax
pop edi
cmp dword [ebp - 0x10], eax
pop esi
pop ebx
setl al
dec eax
and ax, 0xf9bd
add eax, 0x643
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
leave
ret