Function at 0x40cec0
Capabilities:
Get common file path
Resolve function by parsing pe exports
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x2d0c
call fcn.004312b0
mov eax, dword [0x4c3354]
push ebx
push esi
inc eax
push edi
mov edi, ecx
mov dword [esp + 0x18], edi
mov dword [0x4c3354], eax
cmp eax, 0x30
jge 0x47436d
mov bh, 1
lea ecx, [esp + 0x40]
mov dword [esp + 0x10], 0
mov byte [esp + 0xf], bh
mov byte [esp + 0xe], bh
mov byte [esp + 0x14], 0
call fcn.00404ead
mov esi, dword [ebp + 8]
push esi
lea ecx, [esp + 0x80]
call fcn.0040df29
push 0x2000
lea eax, [esp + 0x80]
push eax
lea ecx, [esp + 0x48]
call fcn.00404a5b
test al, al
je 0x40d3d8
xor bl, bl
lea ecx, [esp + 0x7c]
call fcn.00408d6e
test bl, bl
jne 0x474387
lea eax, [esp + 0x6f8]
push eax
push 0x104
call dword [sym.imp.KERNEL32.DLL_GetCurrentDirectoryW]
lea eax, [esp + 0xa4]
push eax
lea eax, [esp + 0x2e4]
push eax
push 0x104
push esi
call dword [sym.imp.KERNEL32.DLL_GetFullPathNameW]
mov edi, dword [esp + 0x50]
mov esi, dword [esp + 0x54]
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x90]
push eax
lea ecx, [esp + 0x48]
mov dword [esp + 0x34], 0x18
call fcn.004046a8
push 0
push esi
push edi
lea ecx, [esp + 0x4c]
call fcn.00404d60
cmp dword [esp + 0x9c], 0x21335541
je 0x4743a3
lea eax, [esp + 0x2b10]
push eax
lea eax, [esp + 0x290c]
push eax
lea eax, [esp + 0x4f8]
push eax
lea eax, [esp + 0xb4]
push eax
lea eax, [esp + 0x2f0]
push eax
call fcn.004235e0
add esp, 0x14
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0xd4]
push eax
call fcn.004225b3
lea eax, [esp + 0x4f8]
push eax
lea eax, [esp + 0xdc]
push eax
call fcn.00422584
add esp, 0x10
lea eax, [esp + 0xd0]
push eax
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryW]
mov al, byte [esp + 0xe]
cmp al, 1
jne 0x40d2ff
xor eax, eax
lea ecx, [esp + 0x58]
mov word [esp + 0x908], ax
call fcn.0040d59d
mov eax, dword [esp + 0x6c]
test al, 3
jne 0x474784
test al, 4
jne 0x474764
push 0x10
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0x10
call fcn.00420d7a
add esp, 4
mov dword [esp + 0x1c], eax
push 4
mov byte [eax], 0
call fcn.00420d7a
add esp, 4
test eax, eax
je 0x474777
mov dword [eax], 1
mov dword [esp + 0x28], eax
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x44]
call fcn.0040d3f0
test al, al
jne 0x40d0cf
mov esi, dword [esp + 0x28]
dec dword [esi]
jne 0x40d0cb
push dword [esp + 0x1c]
call fcn.00420dee
add esp, 4
push esi
call fcn.00420dee
add esp, 4
xor al, al
jmp 0x40d0e9
lea eax, [esp + 0x58]
push eax
lea eax, [esp + 0x20]
push eax
call fcn.0040d600
lea ecx, [esp + 0x1c]
call fcn.00408d6e
mov al, 1
test al, al
je 0x40d2ff
mov esi, dword [esp + 0x5c]
cmp esi, 0xffe
ja 0x474797
mov ebx, dword [esp + 0x58]
lea eax, [esp + 0x908]
push ebx
push eax
call fcn.004225b3
inc dword [esp + 0x18]
add esp, 8
xor esi, esi
xor edi, edi
mov edi, edi
movzx ebx, word [esp + esi*2 + 0x908]
push ebx
call fcn.00422f3d
add esp, 4
test eax, eax
je 0x40d145
push ebx
call fcn.00422f60
add esp, 4
test eax, eax
je 0x40d145
inc esi
jmp 0x40d120
cmp word [esp + esi*2 + 0x908], di
je 0x40d16f
nop
mov ax, word [esp + esi*2 + 0x908]
mov word [esp + edi*2 + 0x908], ax
lea esi, [esi + 1]
inc edi
cmp word [esp + esi*2 + 0x908], 0
jne 0x40d150
xor eax, eax
mov word [esp + edi*2 + 0x908], ax
lea eax, [esp + 0x908]
push eax
call fcn.0040d710
test al, al
lea eax, [esp + 0x908]
push eax
je 0x4747da
call fcn.0042256b
add esp, 4
test eax, eax
je 0x40d1e0
lea esi, [eax - 1]
test esi, esi
js 0x40d1d6
lea esp, [esp]
movzx edi, word [esp + esi*2 + 0x908]
push edi
call fcn.00422f3d
add esp, 4
test eax, eax
je 0x40d1d6
push edi
call fcn.00422f60
add esp, 4
test eax, eax
jne 0x40d371
xor eax, eax
mov word [esp + esi*2 + 0x90a], ax
lea eax, [esp + 0x908]
push eax
xor bl, bl
call fcn.0042256b
mov esi, eax
add esp, 4
cmp esi, 2
jle 0x40d219
mov cx, word [esp + esi*2 + 0x904]
and cx, 0x7f
movzx ecx, cx
push ecx
call fcn.00422f60
add esp, 4
test eax, eax
jne 0x40d351
cmp byte [esp + 0x14], 1
je 0x40d3b8
mov edi, dword [esp + 0x18]
lea eax, [esp + 0x40]
push eax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x2e8]
push eax
lea eax, [esp + 0x914]
push eax
mov ecx, edi
call fcn.0040d7e4
cmp eax, 3
jne 0x40d37d
cmp dword [edi + 8], 0
je 0x40d3a3
mov eax, dword [edi + 0xc]
mov eax, dword [eax]
cmp word [eax], 0
je 0x40d340
push 0x10
call fcn.00420d7a
mov ecx, dword [edi + 0xc]
add esp, 4
mov dword [ecx + 0xc], eax
mov dword [edi + 0xc], eax
mov eax, dword [edi + 0xc]
mov dword [eax + 0xc], 0
lea eax, [esp + 0x908]
push eax
call fcn.0042256b
xor ecx, ecx
inc eax
add esp, 4
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00420d7a
mov esi, eax
add esp, 4
lea eax, [esp + 0x908]
push eax
push esi
call fcn.004225b3
mov ecx, dword [edi + 0xc]
mov eax, dword [esp + 0x18]
mov dword [ecx], esi
mov ecx, dword [edi + 0xc]
add esp, 8
mov dword [ecx + 4], eax
mov eax, dword [edi + 0xc]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 8], ecx
inc dword [edi + 0x10]
mov bh, byte [esp + 0xf]
mov al, byte [esp + 0xe]
cmp bl, 1
je 0x40d3ce
mov byte [esp + 0x14], 0
cmp bh, 1
je 0x40d030
lea ecx, [esp + 0x40]
call fcn.00404f19
lea eax, [esp + 0x6f8]
push eax
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryW]
lea ecx, [esp + 0x40]
call fcn.00404eef
mov al, bh
dec dword [0x4c3354]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
push eax
call fcn.00420dee
add esp, 4
dec dword [edi + 0x10]
jmp 0x40d27e
cmp word [esp + esi*2 + 0x906], 0x5f
jne 0x40d219
xor eax, eax
mov word [esp + esi*2 + 0x906], ax
mov bl, 1
jmp 0x40d219
dec esi
jns 0x40d1b0
jmp 0x40d1d6
sub eax, 0
je 0x40d3df
sub eax, 2
je 0x40d252
mov bh, byte [esp + 0xf]
sub eax, 2
jne 0x40d2e4
xor al, al
mov byte [esp + 0xe], al
jmp 0x40d2e8
push 0x10
call fcn.00420d7a
add esp, 4
mov dword [edi + 8], eax
mov dword [edi + 0xc], eax
jmp 0x40d27e
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x908]
push eax
call fcn.00420426
jmp 0x40d2e0
mov byte [esp + 0x14], 1
jmp 0x40d2f6
mov bl, 1
jmp 0x40cf3d
xor bh, bh
mov byte [esp + 0xf], bh
jmp 0x40d2e4
push dword [ebp + 0x14]
push str.include_depth_exceeded.__Make_sure_there_are_no_recursive_includes
push dword [ebp + 0x18]
push dword [ebp + 0x10]
call fcn.00443edc
xor al, al
jmp 0x40d331
push dword [ebp + 0x14]
mov ecx, edi
push str.Error_opening_the_file
push dword [ebp + 0x18]
push dword [ebp + 0x10]
call fcn.00443edc
xor bh, bh
jmp 0x40d326
cmp dword [esp + 0xa0], 0x36304145
jne 0x40cfc1
lea ecx, [esp + 0x40]
call fcn.00404f19
push 2
push dword [ebp + 8]
lea ecx, [esp + 0x94]
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0xa0], 0
mov dword [esp + 0xa4], 0
mov byte [esp + 0xa8], 0
call fcn.00404733
test eax, eax
jne 0x47442b
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x14]
push eax
push str.___AUTOIT_SCRIPT___
lea ecx, [esp + 0x98]
call fcn.0044d9ed
lea ecx, [esp + 0x8c]
test eax, eax
je 0x474449
call fcn.00404a07
push dword [ebp + 0x14]
mov ecx, dword [esp + 0x1c]
push str.Error_opening_the_file
push dword [ebp + 0x18]
push dword [ebp + 0x10]
call fcn.00443edc
xor bh, bh
jmp 0x40d326
call fcn.00404a07
mov ebx, dword [esp + 0x10]
push 0x10
mov eax, dword [ebx]
mov dword [esp + 0x38], eax
or eax, 0xffffffff
mov esi, 4
mov word [esp + 0x28], ax
mov dword [esp + 0x80], 0x49ed8c
mov dword [esp + 0x84], 0
mov dword [esp + 0x88], 0
mov dword [esp + 0x8c], 0
call fcn.00420d7a
mov edi, eax
add esp, 4
test edi, edi
je 0x4744be
mov dword [edi], 0x49ed8c
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
jmp 0x4744c0
xor edi, edi
or eax, 0xffffffff
push 5
lea ecx, [esp + 0x20]
mov dword [esp + 0x30], edi
mov word [esp + 0x2a], ax
call fcn.0040c9c1
mov eax, dword [esp + 0x34]
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x1c]
push eax
mov ecx, edi
call fcn.0040c890
cmp dword [esp + 0x34], 1
mov dword [esp + 0x38], 0
mov dword [esp + 0x30], 1
jl 0x4746dd
lea eax, [esi + ebx]
inc esi
movzx eax, byte [eax]
push eax
lea ecx, [esp + 0x20]
mov dword [esp + 0x18], esi
mov dword [esp + 0x40], eax
call fcn.0040c9c1
lea ecx, [esp + 0x1c]
call fcn.0044b277
test al, al
je 0x47453d
lea eax, [esi + ebx]
add esi, 4
mov eax, dword [eax]
mov dword [esp + 0x1c], eax
jmp 0x474671
lea ecx, [esp + 0x1c]
call fcn.0044b261
test al, al
je 0x474563
mov eax, dword [esi + ebx]
lea ecx, [esi + ebx]
mov dword [esp + 0x1c], eax
mov eax, dword [ecx + 4]
add esi, 8
mov dword [esp + 0x20], eax
jmp 0x474671
lea ecx, [esp + 0x1c]
call fcn.0044b24b
test al, al
je 0x474586
movsd xmm0, qword [esi + ebx]
lea eax, [esi + ebx]
add esi, 8
movsd qword [esp + 0x1c], xmm0
jmp 0x474671
lea ecx, [esp + 0x1c]
call fcn.0041eaa2
test al, al
je 0x474671
lea eax, [esp + 0x14]
push eax
push ebx
call fcn.00443cd8
mov ebx, eax
mov eax, dword [esp + 0x3c]
push ebx
cmp eax, 0x31
jne 0x4745ec
lea ecx, [esp + 0xc4]
call fcn.0040df29
mov eax, dword [esp + 0x18]
push dword [esp + 0xc0]
mov ecx, dword [eax + 4]
mov edx, dword [ecx]
call dword [edx + 4]
lea ecx, [esp + 0xc0]
mov esi, eax
call fcn.00408d6e
push 1
lea ecx, [esp + 0x20]
call fcn.0040c9c1
mov dword [esp + 0x1c], esi
jmp 0x474660
cmp eax, 0x30
jne 0x474629
lea ecx, [esp + 0xb4]
call fcn.0040df29
lea eax, [esp + 0xb0]
push eax
call fcn.004440e0
lea ecx, [esp + 0xb0]
mov esi, eax
call fcn.00408d6e
push 0
lea ecx, [esp + 0x20]
call fcn.0040c9c1
mov dword [esp + 0x1c], esi
jmp 0x474660
cmp eax, 0x37
jne 0x474657
mov esi, dword [esp + 0x1c]
mov ecx, esi
call fcn.00443bf9
test eax, eax
je 0x474732
push ebx
call fcn.00420dee
mov esi, dword [esp + 0x18]
mov ebx, dword [esp + 0x14]
add esp, 4
jmp 0x474506
lea ecx, [esp + 0x20]
call fcn.0044b1de
push ebx
call fcn.00420dee
mov esi, dword [esp + 0x18]
mov ebx, dword [esp + 0x14]
add esp, 4
lea eax, [esp + 0x1c]
push eax
mov ecx, edi
call fcn.0040c890
cmp dword [esp + 0x3c], 0x7f
jne 0x474506
mov ecx, dword [edi + 8]
cmp ecx, 2
jbe 0x4746c3
mov eax, dword [edi + 4]
mov eax, dword [eax + ecx*4 - 8]
cmp word [eax + 8], 0x7f
je 0x4746c3
inc dword [esp + 0x38]
mov eax, 0x3b
mov word [esp + 0x14], ax
push 0xffffffffffffffff
lea eax, [esp + 0x18]
push eax
mov eax, dword [esp + 0x20]
mov ecx, eax
push dword [eax + 0x10]
call fcn.00443b87
jmp 0x4746ca
mov ecx, edi
call fcn.004440bb
mov eax, dword [esp + 0x30]
inc eax
mov dword [esp + 0x30], eax
cmp eax, dword [esp + 0x34]
jle 0x474506
push 5
lea ecx, [esp + 0x20]
call fcn.0040c9c1
mov eax, dword [esp + 0x38]
mov ecx, dword [edi + 4]
mov dword [esp + 0x1c], eax
mov ecx, dword [ecx]
lea eax, [esp + 0x1c]
push eax
call fcn.0044b13a
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x2c]
push eax
lea ecx, [ecx + 0x48]
call fcn.004637a3
push ebx
call fcn.0042352d
add esp, 4
mov bh, 1
lea ecx, [esp + 0x7c]
call fcn.00406f00
lea ecx, [esp + 0x1c]
call fcn.0044b124
jmp 0x40d326
mov eax, dword [esp + 0x30]
push 0x49ebf0
push str.Bad_directive_syntax_error
push eax
push dword [ebp + 8]
mov ecx, esi
call fcn.00443edc
push ebx
call fcn.00420dee
add esp, 4
push dword [esp + 0x10]
call fcn.0042352d
add esp, 4
xor bh, bh
jmp 0x47471b
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0x44]
call fcn.004472a6
jmp 0x40d0e9
mov dword [esp + 0x28], 0
jmp 0x40d09c
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0x44]
call fcn.004471a8
jmp 0x40d0e9
lea ecx, [esp + 0x58]
add esi, 0xfffff002
call fcn.0040ca6c
mov edi, dword [esp + 0x5c]
mov ebx, dword [esp + 0x58]
sub edi, esi
lea eax, [edi*2 - 0x1ffa]
push eax
lea eax, [ebx + 0x1ffc]
lea eax, [eax + esi*2]
push eax
lea eax, [ebx + 0x1ffc]
push eax
call fcn.00420710
add esp, 0xc
mov dword [esp + 0x5c], edi
jmp 0x40d105
mov ecx, dword [esp + 0x1c]
push str.Unterminated_string
push dword [esp + 0x18]
push dword [ebp + 0x10]
call fcn.00443edc
xor bh, bh
jmp 0x40d2ff