Function at 0x408080
Capabilities:
Resolve function by parsing pe exports
Set current directory
Terminate process

Disassembly:
sub esp, 0x40
mov eax, dword [0x6019e4]
xor eax, esp
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x44]
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov dword [esp + 0x14], eax
mov ebp, edx
mov dword [esp + 0x2c], 0
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], 0
mov ebx, dword [edi + 0x10]
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], ebx
test ebx, ebx
jne 0x40826a
push ebx
push 0x62d420
push 0x10000
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
mov edx, 0x62d420
lea ecx, [esp + 0x30]
mov ebx, eax
call fcn.004b4770
mov dword [esp + 0x34], eax
test eax, eax
jne 0x40804a
push 0x62d420
push str.ERROR_loading__s_n
call fcn.004010e0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3c]
xor ecx, esp
call fcn.005852a8
add esp, 0x40
ret
lea eax, [esp + 0x1c]
push eax
push 0
lea edx, [ebx + 1]
lea ecx, [ebp*4 + 4]
call fcn.004aeee0
mov esi, dword [esp + 0x24]
add esp, 8
mov dword [esp + 0x18], eax
test esi, esi
jne 0x408075
xor eax, eax
xor ecx, ecx
jmp 0x40807a
mov eax, dword [esi - 4]
mov ecx, eax
push eax
push 0x62d420
push ecx
push esi
call fcn.00588e28
mov eax, dword [esp + 0x28]
add esp, 0xc
mov edx, ebx
mov ecx, 0x62d420
push 0x604a90
mov dword [eax], esi
call fcn.004b44a0
add esp, 8
cmp eax, 0x10000
jae 0x40861a
push 0x62d420
mov byte [eax + 0x62d420], 0
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov esi, 2
cmp ebp, esi
jle 0x40825c
mov eax, dword [esp + 0x18]
add eax, 4
mov dword [esp + 0x1c], eax
nop dword [eax]
cmp dword [edi + 0x24], 0
jne 0x408131
mov edx, dword [esp + 0x14]
lea ebp, [esi*4]
push 0xb
push str.__script_db
push dword [edx + ebp]
call fcn.0058c240
add esp, 0xc
test eax, eax
jne 0x408131
lea ebx, [esi + 1]
cmp ebx, dword [esp + 0x24]
jge 0x408131
mov eax, dword [esp + 0x14]
mov ecx, dword [edi + 0x1c]
mov edx, dword [eax + ebp + 4]
call fcn.004035f0
mov ecx, eax
call fcn.004b7970
mov dword [edi + 0x24], eax
mov esi, ebx
jmp 0x40824f
mov eax, dword [esp + 0x14]
lea ebp, [esi*4]
push 0xe
push str.__script_flags
push dword [eax + ebp]
call fcn.0058c240
add esp, 0xc
test eax, eax
jne 0x4081c0
lea ebx, [esi + 1]
cmp ebx, dword [esp + 0x24]
jge 0x4081c0
mov eax, dword [esp + 0x14]
mov eax, dword [eax + ebp + 4]
movzx eax, word [eax]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
mov ecx, 0x3078
cmp ax, cx
jne 0x40824f
mov esi, dword [esp + 0x14]
mov eax, dword [esi + ebp + 4]
test eax, eax
je 0x408197
push 0x20
push eax
call fcn.0058d536
add esp, 8
cmp eax, 0xa
jg 0x4081b9
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esi + ebp + 4]
lea edx, [eax - 2]
add ecx, 2
call fcn.004ad370
push dword [esp + 0x28]
call dword [sym.imp.WS2_32.dll_ntohl]
mov dword [esp + 0x28], eax
mov esi, ebx
jmp 0x40824f
mov eax, dword [esp + 0x14]
push 0x10
push str.__script_timeout
push dword [eax + ebp]
call fcn.0058c240
add esp, 0xc
test eax, eax
jne 0x4081fb
lea ebx, [esi + 1]
cmp ebx, dword [esp + 0x24]
jge 0x4081fb
mov eax, dword [esp + 0x14]
push dword [eax + ebp + 4]
call fcn.0058d50c
add esp, 4
mov dword [esp + 0x2c], eax
mov esi, ebx
jmp 0x40824f
mov eax, dword [esp + 0x14]
push 0x10
push str.__script_connect
push dword [eax + ebp]
call fcn.0058c240
add esp, 0xc
test eax, eax
jne 0x40823b
mov dword [esp + 0x20], 1
cmp dword [edi + 0x24], eax
jne 0x40824f
mov ecx, dword [edi + 0x1c]
mov edx, 0x604ad8
call fcn.004035f0
mov ecx, eax
call fcn.004b7970
mov dword [edi + 0x24], eax
jmp 0x40824f
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
mov eax, dword [eax + ebp]
mov dword [ecx], eax
add ecx, 4
mov dword [esp + 0x1c], ecx
mov ebp, dword [esp + 0x24]
inc esi
cmp esi, ebp
jl 0x4080e0
mov eax, dword [esp + 0x30]
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x1c], eax
jmp 0x4082d6
mov eax, dword [edi + 0x14]
lea esi, [ebp*4 + 4]
push esi
mov dword [esp + 0x38], eax
call fcn.0058db11
add esp, 4
mov dword [esp + 0x18], eax
test eax, eax
je 0x40861f
push esi
push 0
push eax
call fcn.00587250
mov ebx, 1
add esp, 0xc
cmp ebp, ebx
jle 0x4082c2
mov eax, dword [esp + 0x18]
lea edx, [ebp - 1]
mov esi, dword [esp + 0x14]
lea ebx, [edx + 1]
sub esi, eax
lea ecx, [eax + 4]
mov eax, dword [esi + ecx]
mov dword [ecx], eax
add ecx, 4
sub edx, 1
jne 0x4082b5
mov eax, dword [esp + 0x18]
mov dword [eax + ebx*4], 0
mov ebx, dword [esp + 0x18]
mov eax, dword [edi + 0x1c]
mov dword [ebx], eax
cmp dword [esp + 0x20], 0
mov dword [edi + 0x30], 1
je 0x4082e9
mov esi, dword [edi + 0x24]
jmp 0x4082eb
xor esi, esi
push 0x49cea0
push ecx
push 0x49ce40
mov edx, 0x49cd30
mov ecx, 0x49cca0
call fcn.00430610
add esp, 0xc
test eax, eax
je 0x4086c6
mov ecx, dword [eax + 0x70]
test ecx, ecx
je 0x4086c6
xor eax, eax
mov edx, 0x406a70
cmp dword [esp + 0x20], eax
push edi
cmove eax, edx
mov edx, dword [esp + 0x2c]
push eax
push dword [edi + 0x18]
push dword [edi + 0x1c]
push esi
push ebx
push dword [edi]
push dword [esp + 0x48]
call fcn.0049d9e0
push edi
mov edx, 0x407bd0
mov dword [edi + 8], eax
mov ecx, eax
call fcn.004718b0
mov ecx, dword [edi + 8]
add esp, 0x24
cmp dword [esp + 0x20], 0
je 0x40836d
push edi
call fcn.00403530
add esp, 4
jmp 0x408512
mov eax, dword [ecx + 0x2c]
xor edx, edx
mov ebx, dword [ecx + 0x44]
or edx, 0xfff90000
mov dword [esp + 0x3c], edx
mov esi, dword [eax + 0x78]
cmp ebx, dword [ecx + 0x38]
jae 0x408660
lea eax, [ebx + 8]
mov dword [ecx + 0x44], eax
mov dword [ebx], esi
mov dword [ebx + 4], edx
mov ebx, 0xfff8
cmp word [esp + 0x3e], bx
jb 0x4083a5
inc dword [esi + 4]
call fcn.004145c0
mov ecx, dword [edi + 8]
mov edx, dword [ecx + 0x44]
cmp edx, dword [ecx + 0x38]
jae 0x408674
lea eax, [edx + 8]
mov dword [ecx + 0x44], eax
xor eax, eax
or eax, 0xfff60000
mov dword [edx], edi
mov dword [edx + 4], eax
mov edx, 0xfffffffe
mov ecx, dword [edi + 8]
push 0x604adc
mov dword [esp + 0x30], eax
call fcn.00410110
mov esi, dword [edi + 8]
add esp, 4
mov ecx, dword [esi + 0x44]
cmp ecx, dword [esi + 0x40]
je 0x408688
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
mov eax, dword [ecx + 4]
mov edx, dword [ecx]
mov dword [esp + 0x3c], eax
mov eax, 0xfff3
mov word [ecx + 6], ax
cmp word [esp + 0x3e], bx
jb 0x408422
add dword [edx + 4], 0xffffffff
jne 0x408422
push edx
push esi
call fcn.00432010
add esp, 8
mov ecx, dword [edi + 8]
mov edx, str.meshDesktop
push 0x407bf0
call fcn.00456a80
mov ecx, dword [edi + 8]
xor esi, esi
or esi, 0xfff90000
add esp, 4
mov dword [esp + 0x3c], esi
mov ebx, dword [ecx + 0x44]
mov edx, dword [ecx + 0x64]
cmp ebx, dword [ecx + 0x38]
jae 0x40869e
lea eax, [ebx + 8]
mov dword [ecx + 0x44], eax
mov dword [ebx], edx
mov dword [ebx + 4], esi
mov ebx, 0xfff8
cmp word [esp + 0x3e], bx
jb 0x40846f
inc dword [edx + 4]
mov ecx, dword [edi + 8]
mov edx, 0x407d40
push 6
push 0x18075380
push 0
call fcn.00414b50
mov ecx, dword [edi + 8]
add esp, 0xc
mov edx, dword [ecx + 0x44]
cmp edx, dword [ecx + 0x38]
jae 0x4086b2
lea eax, [edx + 8]
mov dword [ecx + 0x44], eax
mov eax, dword [esp + 0x2c]
mov dword [edx], edi
mov dword [edx + 4], eax
mov edx, 0xfffffffe
mov ecx, dword [edi + 8]
push 0x604b00
call fcn.00410110
mov ecx, dword [edi + 8]
add esp, 4
mov edx, 0xfffffffe
push str.startMeshAgent
call fcn.00410110
mov esi, dword [edi + 8]
add esp, 4
mov ecx, dword [esi + 0x44]
cmp ecx, dword [esi + 0x40]
je 0x408688
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
mov eax, dword [ecx + 4]
mov edx, dword [ecx]
mov dword [esp + 0x3c], eax
mov eax, 0xfff3
mov word [ecx + 6], ax
cmp word [esp + 0x3e], bx
jb 0x40850e
add dword [edx + 4], 0xffffffff
jne 0x40850e
push edx
push esi
call fcn.00432010
add esp, 8
mov ebx, dword [esp + 0x18]
cmp dword [edi + 0x10], 0
jne 0x40851c
mov eax, dword [ebx]
jmp 0x408521
mov eax, 0x604b20
mov ebx, dword [esp + 0x1c]
mov edx, ebx
mov ecx, dword [edi + 8]
push 0
push eax
push dword [esp + 0x3c]
call fcn.0049e030
add esp, 0xc
test eax, eax
jne 0x40854b
mov ecx, dword [edi + 8]
xor edx, edx
call fcn.0040e7d0
test eax, eax
je 0x40859e
mov ecx, dword [edi + 8]
or edx, 0xffffffff
push 0
call fcn.00413080
mov esi, dword [edi + 8]
add esp, 4
mov ecx, dword [esi + 0x44]
cmp ecx, dword [esi + 0x40]
je 0x408688
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
mov eax, dword [ecx + 4]
mov edx, dword [ecx]
mov dword [esp + 0x3c], eax
mov eax, 0xfff3
mov word [ecx + 6], ax
mov eax, 0xfff8
cmp word [esp + 0x3e], ax
jb 0x40859e
add dword [edx + 4], 0xffffffff
jne 0x40859e
push edx
push esi
call fcn.00432010
add esp, 8
push ebx
call fcn.0058c812
add esp, 4
push dword [esp + 0x18]
call fcn.0058c812
add esp, 4
cmp dword [esp + 0x20], 0
je 0x408037
push 0x604b5c
call fcn.004010e0
add esp, 4
mov edx, ebp
mov ecx, edi
push 0
push dword [esp + 0x18]
call fcn.00406d40
add esp, 8
test eax, eax
jne 0x408037
mov esi, dword [edi]
mov eax, dword [esi + 0x10]
mov dword [esi], 2
test eax, eax
jne 0x4085fa
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push esi
push eax
push 0x4af5c0
call dword [sym.imp.KERNEL32.dll_QueueUserAPC]
mov ecx, dword [esp + 0x4c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.005852a8
add esp, 0x40
ret
call fcn.005853dc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0xfe
push 0x4c4
mov edx, 0x624148
xor ecx, ecx
call fcn.004b4f80
add esp, 0xc
push 0x4c4
push 0x624164
push 0x624180
call fcn.004010e0
add esp, 0xc
push 0xfe
call fcn.005885bd
push str.cannot_push_beyond_allocated_stack
push 0x3001039
mov edx, 0x6059b0
call fcn.0040d970
push str.cannot_push_beyond_allocated_stack
push 0x30010f5
mov edx, 0x605a80
call fcn.0040d970
push 0x605c78
push 0x300167f
mov edx, 0x605c88
mov ecx, esi
call fcn.0040d970
push str.cannot_push_beyond_allocated_stack
push 0x3001039
mov edx, 0x6059b0
call fcn.0040d970
push str.cannot_push_beyond_allocated_stack
push 0x30010f5
mov edx, 0x605a80
call fcn.0040d970
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0xfe
push 0x784
mov edx, 0x6219bc
xor ecx, ecx
call fcn.004b4f80
add esp, 0xc
push 0x784
push 0x6219ec
push 0x621a1c
call fcn.004010e0
add esp, 0xc
push 0xfe
call fcn.005885bd
int3