Function at 0x10040860
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x10
push ebx
push ebp
push esi
push edi
push 0x680
call fcn.10002a34
mov edi, eax
mov eax, dword [0x10069e54]
sub eax, dword [0x10069f28]
add esp, 4
add eax, dword [esp + 0x18]
mov dword [0x10069f28], eax
call fcn.100026e7
mov ebx, eax
mov dword [esp + 0x14], ebx
call fcn.100021c1
push 0
lea ecx, [esp + 0x1c]
mov esi, eax
call fcn.100020bf
mov eax, dword [esi + 4]
cmp eax, 0xffffffff
jae 0x100408bb
add eax, 1
mov dword [esi + 4], eax
lea ecx, [esp + 0x18]
call fcn.100020e0
push 0x680
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov esi, dword [0x10069f28]
mov ecx, esi
shl ecx, 4
sub ecx, esi
add ecx, ecx
mov edx, ecx
mov ecx, 0x20
sub ecx, edx
mov edx, dword [0x10069e54]
mov edi, eax
mov word [0x10069e5c], cx
mov eax, 0x10069f70
cmp edx, dword [0x10069f08]
je 0x10040920
sub dword [eax], edx
mov ebp, 0xe
sub ebp, edx
sub ebp, esi
add ebp, ebp
sub eax, 8
add cx, bp
cmp eax, 0x10069ef4
jg 0x100408fe
movzx eax, cx
push eax
mov word [0x10069e5c], cx
call fcn.1000a490
mov ecx, dword [0x10069f28]
add esp, 4
sub ecx, edi
mov esi, eax
xor eax, eax
sub ecx, 0x60
push 0x10078a68
add esi, ecx
push 0x680
adc eax, eax
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
cmp dword [0x10069f20], 5
mov word [0x10069e5c], ax
je 0x1004097d
movzx edx, byte [0x10069e58]
movzx eax, ax
sub eax, edx
add eax, 0xf2f5
mov dword [0x10069f28], eax
jmp 0x10040996
movzx cx, byte [0x10069e58]
sub cx, ax
add cx, word [0x10069f28]
mov word [0x10069e5c], cx
push 0
push 6
push 6
push 0
call dword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
mov ecx, dword [0x10069ecc]
mov dword [0x10078a64], eax
mov eax, dword [0x10069ec8]
sub eax, dword [0x10069ea8]
sbb ecx, dword [0x10069eac]
cmp eax, 0x1d2
jne 0x100409ed
test ecx, ecx
jne 0x100409ed
movzx eax, word [0x10069e5c]
mov edx, dword [0x10069f28]
mov dword [esp + 0x1c], ecx
mov ecx, eax
imul ecx, edx
lea esi, [edx + edx + 8]
imul ecx, ecx, 0x1078a
jmp 0x10040a08
movzx eax, word [0x10069e5c]
mov ecx, dword [0x10069f28]
mov edx, esi
sub edx, eax
sub edx, dword [0x10069ed8]
lea ecx, [ecx + edx - 2]
mov edx, esi
sub edx, ecx
mov ecx, esi
shl ecx, 4
sub ecx, esi
add edx, edi
add ecx, ecx
sub eax, ecx
mov esi, eax
movzx eax, byte [0x10069e58]
mov dword [0x10069f28], edx
cdq
mov ecx, 0x10069f70
mov edi, edi
cmp eax, dword [0x10069ea0]
jne 0x10040a40
cmp edx, dword [0x10069ea4]
je 0x10040a50
sub dword [ecx], eax
sbb dword [ecx + 4], edx
sub ecx, 0x10
cmp ecx, 0x10069e78
jg 0x10040a30
call fcn.1000a380
mov di, word [0x10069e5c]
mov dword [0x10069e54], eax
xor edx, edx
mov ecx, 0x10069f70
cmp esi, dword [0x10069ea0]
jne 0x10040a78
cmp edx, dword [0x10069ea4]
je 0x10040a9b
sub dword [ecx], esi
movzx ebx, di
sbb dword [ecx + 4], edx
mov ebp, 0xe
sub ebp, ebx
mov ebx, dword [esp + 0x14]
sub ebp, esi
sub ecx, 0x10
cmp ecx, 0x10069e78
lea eax, [eax + ebp*2]
jg 0x10040a68
cmp dword [0x10069e60], 0x2164
mov dword [0x10069e54], eax
jne 0x10040adc
cmp dword [0x10069e64], edx
jne 0x10040adc
add di, word [0x10069ed0]
mov word [0x10069e5c], di
mov eax, dword [0x10069e5c]
mov edx, eax
imul edx, eax
imul edx, edx, 0x78a
mov di, dx
mov word [0x10069e5c], di
movzx eax, di
push eax
call fcn.10001200
movzx edx, word [0x10069e5c]
mov ecx, dword [0x10069f28]
add esp, 4
cmp edx, ecx
jb 0x10040b1e
mov edx, dword [0x10069f18]
mov eax, dword [0x10069e54]
imul edx, eax
mov dword [0x10069f18], edx
mov edx, ecx
shl edx, 4
sub edx, ecx
add edx, edx
sub eax, edx
mov word [0x10069e5c], ax
test ebx, ebx
je 0x10040b61
push 0
lea ecx, [esp + 0x1c]
call fcn.100020bf
mov eax, dword [ebx + 4]
test eax, eax
jbe 0x10040b3f
cmp eax, 0xffffffff
jae 0x10040b3f
add eax, 0xffffffff
mov dword [ebx + 4], eax
mov esi, dword [ebx + 4]
neg esi
sbb esi, esi
not esi
lea ecx, [esp + 0x18]
and esi, ebx
call fcn.100020e0
test esi, esi
je 0x10040b61
mov eax, dword [esi]
mov edx, dword [eax]
push 1
mov ecx, esi
call edx
pop edi
mov eax, 1
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret 0xc