Function at 0x4038cc
Capabilities:
Get file attributes
Read .ini file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x214
and dword [ebp - 0xc], 0
mov ax, word [0x406384]
cmp dword [ebp + 8], 0
push ebx
push esi
push edi
mov word [ebp - 2], ax
je 0x40399e
push 1
pop edx
cmp dword [ebp + 0xc], edx
jb 0x40399e
mov eax, dword [ebp + 0x14]
or ebx, 0xffffffff
mov ecx, ebx
lea esi, [ebp - 0x110]
lea edi, [eax + 0x30c]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [ebp - 8], esi
mov eax, ecx
mov esi, edi
mov edi, dword [ebp - 8]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x110]
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [ebp + ecx - 0x111], 0x5c
jne 0x40395b
lea edi, [ebp - 0x110]
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
and byte [ebp + ecx - 0x111], al
lea edi, [ebp - 0x110]
mov ecx, ebx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, edx
jb 0x40399e
lea edi, [ebp - 0x110]
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [ebp + ecx - 0x111]
test eax, eax
je 0x40399e
lea ecx, [ebp - 0x110]
cmp eax, ecx
je 0x4039ab
mov cl, byte [eax]
test cl, cl
je 0x4039ab
cmp cl, 0x5c
je 0x4039a5
dec eax
jne 0x403986
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
and byte [eax], 0
mov dword [ebp - 0xc], edx
test eax, eax
je 0x4039cf
lea ecx, [ebp - 0x110]
cmp eax, ecx
je 0x4039cf
mov cl, byte [eax]
test cl, cl
je 0x4039cf
cmp cl, 0x5c
je 0x4039c9
dec eax
jne 0x4039af
jmp 0x4039cf
and byte [eax], 0
mov dword [ebp - 0xc], edx
cmp dword [ebp - 0xc], 0
je 0x40399e
mov edx, str.SCM_AT.ini
mov ecx, ebx
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [ebp - 0x110]
mov esi, ecx
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
add esi, ecx
cmp esi, 0x104
jae 0x40399e
mov edi, edx
mov ecx, ebx
repne scasb al, byte es:[edi]
lea esi, [ebp - 0x110]
not ecx
mov eax, esi
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, eax
mov ecx, ebx
xor eax, eax
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [ebp - 0x110]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, ebx
jne 0x403a55
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00403651
add esp, 0x10
jmp 0x4039a0
cmp dword [ebp + 0x10], 0
lea eax, [ebp - 0x110]
push eax
push dword [ebp + 0xc]
je 0x403a93
mov esi, dword [ebp + 8]
lea eax, [ebp - 2]
push esi
push eax
push str.PATH
push str.SuccessLog
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea eax, [ebp - 0x214]
push str.SCMAtScs.log
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
pop ecx
pop ecx
jmp 0x403ac1
push dword [ebp + 8]
lea eax, [ebp - 2]
push eax
push str.PATH
push str.ErrorLog
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea eax, [ebp - 0x214]
push str.SCMAtErr.log
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov esi, dword [ebp + 8]
pop ecx
pop ecx
mov edi, esi
mov ecx, ebx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
jbe 0x40399e
mov al, byte [esi]
cmp al, byte [ebp - 2]
je 0x40399e
mov edi, esi
mov ecx, ebx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [ebp - 0x214]
mov edx, ecx
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [edx + ecx + 1]
cmp eax, dword [ebp + 0xc]
jae 0x40399e
mov edi, esi
mov ecx, ebx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [ecx + esi - 1], 0x5c
je 0x403b40
mov edi, 0x40605c
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, dword [ebp + 8]
mov edx, ecx
mov ecx, ebx
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x214]
mov ecx, ebx
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, dword [ebp + 8]
mov edx, ecx
mov ecx, ebx
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
pop eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4039a0