Function at 0x40a806
Capabilities:
Set current directory

Disassembly:
mov eax, 0x1444
call fcn.005b3d10
mov eax, dword [0x6ccd44]
xor eax, esp
mov dword [esp + 0x1440], eax
push ebx
push ebp
mov ebp, dword [esp + 0x1450]
lea ecx, [esp + 0x24]
push esi
mov esi, dword [0x72a344]
push edi
mov dword [esp + 0x18], edx
xor edi, edi
push 1
push 4
mov edx, 0x400
call fcn.004811d1
mov ebx, eax
pop ecx
pop ecx
mov dword [esp + 0x14], ebx
cmp dword [ebx - 0xc], edi
jbe 0x40a85e
mov eax, dword [ebx - 0x10]
add eax, 0x10
add eax, ebx
jmp 0x40a860
xor eax, eax
mov dword [eax], esi
mov eax, dword [esi + 0x40]
test eax, eax
je 0x40a86f
push 2
call eax
jmp 0x40a875
call dword [sym.imp.USER32.dll_SetProcessDPIAware]
cmp dword [esp + 0x18], 1
jne 0x40a8ad
mov eax, dword [ebp]
mov ecx, 0x6d1e38
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x40a8a4
test dl, dl
je 0x40a8a0
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x40a8a4
add eax, 2
add ecx, 2
test dl, dl
jne 0x40a884
xor eax, eax
jmp 0x40a8a9
sbb eax, eax
or eax, 1
test eax, eax
je 0x40a901
cmp dword [esp + 0x18], 2
jne 0x40a978
mov ecx, dword [ebp + 4]
mov edx, 0x6d1e40
mov eax, ecx
mov bl, byte [eax]
cmp bl, byte [edx]
mov byte [esp + 0x13], bl
mov ebx, dword [esp + 0x14]
jne 0x40a8f8
cmp byte [esp + 0x13], 0
je 0x40a8f4
mov bl, byte [eax + 1]
cmp bl, byte [edx + 1]
mov byte [esp + 0x13], bl
mov ebx, dword [esp + 0x14]
jne 0x40a8f8
add eax, 2
add edx, 2
cmp byte [esp + 0x13], 0
jne 0x40a8c2
xor eax, eax
jmp 0x40a8fd
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40a918
mov edx, dword [esi + 0x18]
mov ecx, dword [esi]
call fcn.00476f83
and dword [esi], edi
mov dword [esi + 0xb30], eax
jmp 0x40ae6e
mov eax, str.__netinfo
mov dl, byte [ecx]
cmp dl, byte [eax]
jne 0x40a93d
test dl, dl
je 0x40a939
mov dl, byte [ecx + 1]
cmp dl, byte [eax + 1]
jne 0x40a93d
add ecx, 2
add eax, 2
test dl, dl
jne 0x40a91d
xor eax, eax
jmp 0x40a942
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40a978
lea ecx, [esp + 0x14]
call fcn.0040ee00
test eax, eax
jle 0x40ae6e
push dword [esp + 0x14]
push str._s_r_n
call fcn.00401109
push 1
push dword [esp + 0x20]
call fcn.005e7dd0
add esp, 0x10
jmp 0x40ae6e
xor ecx, ecx
cmp dword [esi + 0x1c], ecx
jne 0x40a9b6
push 0x800
lea eax, [esp + 0x454]
mov dword [esi + 0x1c], ebx
push eax
push ecx
mov byte [ebx], cl
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor ecx, ecx
lea eax, [esp + 0x450]
push ecx
push ecx
push dword [ebx - 0x10]
push ebx
push 0xffffffffffffffff
push eax
push ecx
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ecx, dword [esi + 0x1c]
lea edx, [esi + 0x9c4]
call fcn.00403911
xor ebx, ebx
inc ebx
cmp dword [esp + 0x18], ebx
jle 0x40aa70
cmp dword [ebp + ebx*4], edi
jne 0x40a9db
xor eax, eax
jmp 0x40a9eb
push 0x1000
push dword [ebp + ebx*4]
call fcn.005ea5b0
pop ecx
pop ecx
mov ecx, dword [ebp + ebx*4]
mov edx, eax
push 1
push 0x6d1e5c
call fcn.00487d81
mov dword [esp + 0x1c], eax
pop ecx
pop ecx
cmp eax, 2
jle 0x40aa5c
push 2
push 0x6d1e60
push dword [ebp + ebx*4]
call fcn.005e3050
add esp, 0xc
test eax, eax
jne 0x40aa5c
cmp dword [esp + 0x14], 0xf
jne 0x40aa5c
mov eax, dword [ebp + ebx*4]
push 0xd
add eax, 2
push str.configUsesCWD
push eax
call fcn.005e3050
add esp, 0xc
test eax, eax
jne 0x40aa5c
mov eax, dword [ebp + ebx*4]
push 1
add eax, 0x10
push 0x6d1e74
push eax
call fcn.005e3050
add esp, 0xc
test eax, eax
je 0x40aa69
inc ebx
cmp ebx, dword [esp + 0x18]
jl 0x40a9d1
jmp 0x40aa70
mov dword [esi + 0x28], 1
push ecx
mov ecx, dword [esi + 0x1c]
mov edx, str..log
call fcn.00402f85
pop ecx
xor edx, edx
mov ecx, eax
call fcn.00487fca
mov dword [0x72a310], eax
call fcn.0047fbb9
mov ecx, dword [esi]
mov edx, 0x407573
push esi
call fcn.004815db
mov ecx, dword [ebp]
or edx, 0xffffffff
push 0x6d1e80
call fcn.00487dc6
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
jle 0x40ab06
push ebx
push dword [ebp]
push 0x10000
push 0x730000
call fcn.005e22a0
add esp, 0x10
cmp ebx, 0x10000
jae 0x40ae89
push 0x1000
mov byte [ebx + 0x730000], 0
mov ebx, 0x72c000
push ebx
push 0xffffffffffffffff
push 0x730000
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push ebx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor ebx, ebx
mov dword [esp + 0x20], esi
lea eax, [esp + 0x18]
mov dword [esp + 0x28], ebp
mov dword [esp + 0x24], eax
cmp dword [esi + 0x10], ebx
jne 0x40ae2e
cmp dword [esp + 0x18], 2
push 3
pop eax
jl 0x40ab6f
mov ecx, dword [ebp + 4]
or edx, 0xffffffff
push 1
push eax
push 0x6d1e84
call fcn.00487cbf
add esp, 0xc
test eax, eax
jne 0x40ae2e
cmp dword [esp + 0x18], 2
jl 0x40ab6f
mov ecx, dword [ebp + 4]
or edx, 0xffffffff
push 1
push 4
push 0x6d1e88
call fcn.00487cbf
add esp, 0xc
test eax, eax
jne 0x40ae2e
mov ecx, dword [esi]
lea eax, [esp + 0x20]
push eax
push ebx
mov edx, 0x40a7d8
call fcn.004816b8
pop ecx
pop ecx
mov ecx, dword [esi]
call fcn.00483f2a
mov dword [esi], ebx
cmp dword [esi + 0x24], ebx
je 0x40ae56
cmp dword [esi + 0x99c], ebx
je 0x40ae21
cmp dword [esi + 0xb3c], ebx
jne 0x40ad0b
call fcn.00475d69
mov edx, dword [esi + 0x24]
mov ebp, eax
mov ecx, ebp
call fcn.0047ad02
or edx, 0xffffffff
mov ecx, ebp
call fcn.004193c5
test eax, eax
je 0x40acef
or edx, 0xffffffff
mov ecx, ebp
call fcn.00417298
lea eax, [esp + 0x14]
or edx, 0xffffffff
push eax
mov ecx, ebp
call fcn.00418df8
mov ebx, dword [esp + 0x18]
xor edx, edx
pop ecx
mov dword [esp + 0x1c], eax
push 3
pop ecx
lea eax, [ebx*4 + 4]
div ecx
push 0xfffffffffffffffa
mov edi, eax
lea ecx, [ebx + 1]
pop eax
sub eax, edi
cmp ecx, eax
jae 0x40ac5b
push 0xfffffffffffffffe
pop eax
lea ecx, [edi + 5]
sub eax, ebx
cmp ecx, eax
jae 0x40ac5b
lea eax, [ebx + 6]
add eax, edi
cmp eax, 0xffffffef
jae 0x40ac5b
test ecx, ecx
je 0x40ac32
lea eax, [ebx + 0x16]
add eax, edi
cmp eax, 0xffffffef
jae 0x40ac5b
xor eax, eax
cmp eax, ecx
push 0x16e3
sbb eax, eax
and eax, 0x10
add eax, 0x16
push 0x6d1e90
add eax, edi
add eax, ebx
push 1
push eax
call fcn.005e7f10
add esp, 0x10
mov ecx, eax
jmp 0x40ac5d
xor ecx, ecx
lea eax, [edi + 5]
push 0
push eax
lea edx, [ebx + 1]
call fcn.004811d1
mov edi, eax
pop ecx
pop ecx
cmp dword [edi - 0xc], 0
jbe 0x40ac83
mov ecx, dword [edi - 0x10]
add ecx, 0x10
add ecx, edi
mov dword [esp + 0x14], ecx
jmp 0x40ac88
and dword [esp + 0x14], 0
push ebx
push dword [esp + 0x20]
lea edx, [ebx + 1]
mov ecx, edi
call section..text
pop ecx
pop ecx
mov ecx, ebp
call fcn.00458f36
mov ecx, edi
cmp ebx, 0x7fffffff
jbe 0x40acc6
call fcn.00481286
xor ebx, ebx
mov edi, ebx
cmp dword [esi + 0x9a8], ebx
je 0x40ae21
push str._Service_Parameters___ERROR
jmp 0x40ad00
lea eax, [esp + 0x14]
mov edx, ebx
push eax
call fcn.00486648
xor ebx, ebx
pop ecx
cmp dword [esi + 0x9a8], ebx
je 0x40ae21
push edi
push str._Service_Parameters____s
call fcn.00488afe
pop ecx
jmp 0x40ad05
cmp dword [esi + 0x9a8], ebx
je 0x40ae21
push str._Service_Parameters___NONE
call fcn.00488afe
pop ecx
jmp 0x40ae21
mov ebx, dword [esi + 0xb4c]
mov ecx, str.meshagent
mov eax, ebx
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x40ad38
test dl, dl
je 0x40ad34
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x40ad38
add eax, 2
add ecx, 2
test dl, dl
jne 0x40ad18
xor eax, eax
jmp 0x40ad3d
sbb eax, eax
or eax, 1
test eax, eax
je 0x40ae1f
mov edi, dword [ebx - 0x10]
xor edx, edx
push 3
pop ebp
push 0xfffffffffffffffa
lea eax, [edi*4 + 0x78]
div ebp
pop ecx
mov ebx, eax
lea edx, [edi + 0x1e]
sub ecx, ebx
cmp edx, ecx
jae 0x40adb3
push 0xffffffffffffffe1
pop ecx
lea edx, [ebx + 5]
sub ecx, edi
cmp edx, ecx
jae 0x40adb3
lea eax, [edi + 0x23]
add eax, ebx
cmp eax, 0xffffffef
jae 0x40adb3
test edx, edx
je 0x40ad88
lea eax, [edi + 0x33]
add eax, ebx
cmp eax, 0xffffffef
jae 0x40adb3
xor eax, eax
cmp eax, edx
push 0x16fd
sbb eax, eax
add edi, 0x33
and eax, 0x10
push str...meshcore_agentcore.c
add eax, edi
add eax, ebx
push 1
push eax
call fcn.005e7f10
add esp, 0x10
mov edi, eax
xor ebx, ebx
jmp 0x40adb7
xor ebx, ebx
mov edi, ebx
mov eax, dword [esi + 0xb4c]
xor edx, edx
push ebx
mov ecx, dword [eax - 0x10]
lea eax, [ecx*4 + 0x78]
div ebp
lea edx, [ecx + 0x1e]
mov ecx, edi
add eax, 5
push eax
call fcn.004811d1
mov edi, eax
pop ecx
pop ecx
cmp dword [edi - 0xc], ebx
jbe 0x40adf1
mov eax, dword [edi - 0x10]
add eax, 0x10
add eax, edi
mov dword [esp + 0x14], eax
jmp 0x40adf5
mov dword [esp + 0x14], ebx
lea eax, [esp + 0x14]
push eax
push dword [esi + 0xb4c]
push str.____meshServiceName__s___
push dword [edi - 0x10]
push edi
call fcn.0040117f
add esp, 0x10
mov edx, eax
mov ecx, edi
call fcn.00486648
jmp 0x40ad05
xor ebx, ebx
mov ecx, dword [esi + 0x24]
call fcn.0048b17c
mov dword [esi + 0x24], ebx
jmp 0x40ae4b
mov ecx, dword [esi]
lea eax, [esp + 0x20]
push eax
push ebx
mov edx, 0x40a7c3
call fcn.004816b8
pop ecx
pop ecx
mov ecx, dword [esi]
call fcn.00483f2a
mov dword [esi], ebx
test edi, edi
je 0x40ae56
mov ecx, edi
call fcn.00481286
call fcn.0047fc91
mov eax, dword [0x72a310]
test eax, eax
je 0x40ae6e
push 1
push eax
call fcn.005e7dd0
pop ecx
pop ecx
mov ecx, dword [esp + 0x1450]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.005b35b0
add esp, 0x1444
ret
call fcn.005b3710
int3