Function at 0x4059a7
Capabilities:
Check if file exists
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x3bb4
call fcn.00448a70
mov eax, dword [0x45b480]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
call fcn.00413d6a
cmp eax, 0x60001
jb 0x405e84
cmp eax, 0x60002
je 0x405e84
call fcn.00405967
mov dword [ebp - 0x3bac], eax
test eax, eax
jne 0x4059f7
call fcn.0041390d
mov ebx, eax
jmp 0x405e75
call fcn.00402506
push eax
lea ecx, [ebp - 0x3b88]
call fcn.00402331
call fcn.00402506
push eax
lea ecx, [ebp - 0x3b9c]
call fcn.00402331
lea edx, [ebp - 0x3b9c]
lea ecx, [ebp - 0x3b88]
call fcn.00404931
mov edi, dword [ebp - 0x3b88]
mov ebx, eax
test ebx, ebx
jne 0x405e5f
mov ecx, str.wimgapi.dll
call fcn.00413bc1
mov esi, eax
mov dword [ebp - 0x3ba8], esi
test esi, esi
jne 0x405a5c
call fcn.0041390d
mov ebx, eax
jmp 0x405e54
and dword [ebp - 0x3b88], 0
lea edx, [ebp - 0x3b88]
mov ecx, edi
call fcn.00404b07
mov ebx, eax
test ebx, ebx
jne 0x405e54
cmp dword [ebp - 0x3b88], eax
jne 0x405e54
push str.GlobalwimMaker
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [ebp - 0x3ba4], eax
test eax, eax
jne 0x405aab
call fcn.00413ed5
mov ebx, eax
jmp 0x405e49
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x405ac2
mov ebx, 0x8007008e
jmp 0x405e49
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WIMMountImage
push esi
call ebx
push str.WIMUnmountImage
push esi
mov dword [ebp - 0x3b90], eax
call ebx
cmp dword [ebp - 0x3b90], 0
mov ebx, eax
mov dword [ebp - 0x3ba0], ebx
je 0x405e44
test ebx, ebx
je 0x405e44
push 0x3af5
lea eax, [ebp - 0x3b04]
mov dword [ebp - 0x3b08], 0x4643534d
push 0x450b60
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
mov dword [ebp - 0x3bb4], 0x3af9
lea eax, [ebp - 0x3b08]
xor esi, esi
mov dword [ebp - 0x3bb0], eax
mov dword [ebp - 0x3b98], esi
mov dword [ebp - 0x3b94], esi
call fcn.0040d286
lea edx, [ebp - 0x3bb4]
mov dword [ebp - 0x3b98], eax
lea ecx, [ebp - 0x3b8c]
call fcn.00415584
lea ecx, [ebp - 0x3b98]
push ecx
mov ecx, dword [eax]
call fcn.00415474
pop ecx
mov ecx, dword [ebp - 0x3b8c]
lea ecx, [ecx - 0x10]
call fcn.004025d7
lea eax, [ebp - 0x3b98]
mov dword [ebp - 0x3b30], 0x44e7ac
mov dword [ebp - 0x3b2c], eax
lea ecx, [ebp - 0x3b80]
lea eax, [ebp - 0x3b30]
push eax
mov dword [ebp - 0x3b0c], eax
call fcn.00411b06
mov ecx, dword [ebp - 0x3b0c]
test ecx, ecx
je 0x405bc7
mov edx, dword [ecx]
lea eax, [ebp - 0x3b30]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
push 0x44cc18
lea ecx, [ebp - 0x3b88]
call fcn.00402969
lea eax, [ebp - 0x3b88]
push eax
lea eax, [ebp - 0x3b8c]
push eax
lea ecx, [ebp - 0x3b98]
call fcn.0040c6e3
mov ecx, dword [ebp - 0x3b88]
lea ecx, [ecx - 0x10]
call fcn.004025d7
mov eax, dword [ebp - 0x3b8c]
cmp eax, dword [ebp - 0x3b98]
jne 0x405c16
mov ebx, 0x80004001
jmp 0x405e1e
call fcn.00402506
push eax
lea ecx, [ebp - 0x3b84]
call fcn.00402331
lea edx, [ebp - 0x3b84]
mov ecx, str._SystemDrive_360SysRt360ldMount_
call fcn.00414098
mov eax, dword [ebp - 0x3b84]
cmp dword [eax - 0xc], esi
jne 0x405c4c
mov ebx, 0x80004005
jmp 0x405e16
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405c7b
push esi
push esi
push esi
push dword [ebp - 0x3b84]
call ebx
test eax, eax
jne 0x405c7b
mov ecx, dword [ebp - 0x3b84]
call fcn.00414ef8
mov ebx, eax
test ebx, ebx
jne 0x405e10
call fcn.00402506
push eax
lea ecx, [ebp - 0x3b88]
call fcn.00402331
lea ecx, [ebp - 0x3b88]
call fcn.00413d87
mov esi, dword [ebp - 0x3b88]
mov ebx, eax
test ebx, ebx
jne 0x405e08
mov ecx, dword [ebp - 0x3b84]
call fcn.00413841
mov ebx, eax
test ebx, ebx
jne 0x405e08
lea eax, [ebp - 0x3b84]
mov dword [ebp - 0x3b30], 0x44e794
mov dword [ebp - 0x3b2c], eax
lea ecx, [ebp - 0x3b58]
lea eax, [ebp - 0x3b30]
push eax
mov dword [ebp - 0x3b0c], eax
call fcn.00411b06
mov ecx, dword [ebp - 0x3b0c]
test ecx, ecx
je 0x405d08
mov edx, dword [ecx]
lea eax, [ebp - 0x3b30]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
push esi
push 1
push edi
push dword [ebp - 0x3b84]
call dword [ebp - 0x3b90]
test eax, eax
je 0x405df6
push str.WindowsSystem32NativeDism.exe
lea edx, [ebp - 0x3b84]
lea ecx, [ebp - 0x3b90]
call fcn.00401ec9
pop ecx
mov ecx, dword [eax]
mov eax, dword [ebp - 0x3b8c]
mov edx, dword [eax + 0x14]
push dword [edx]
mov edx, dword [edx + 4]
call fcn.0041410a
pop ecx
mov ecx, dword [ebp - 0x3b90]
mov ebx, eax
add ecx, 0xfffffff0
call fcn.004025d7
test ebx, ebx
jne 0x405dd0
push str.WindowsSystem32configSYSTEM
lea edx, [ebp - 0x3b84]
lea ecx, [ebp - 0x3b8c]
call fcn.00401ec9
pop ecx
push dword [eax]
push str.WinRE_SYSTEM
push SysReAllocStringLen
call dword [sym.imp.ADVAPI32.dll_RegLoadKeyW]
mov ecx, dword [ebp - 0x3b8c]
mov ebx, eax
lea ecx, [ecx - 0x10]
call fcn.004025d7
test ebx, ebx
jne 0x405dd0
push 0x32
push str.NativeDism_NativeDism_
push 7
push str.BootExecute
mov edx, str.WinRE_SYSTEMControlSet001ControlSession_Manager
mov ecx, SysReAllocStringLen
call fcn.00414530
add esp, 0x10
mov ebx, eax
push str.WinRE_SYSTEM
push SysReAllocStringLen
call dword [sym.imp.ADVAPI32.dll_RegUnLoadKeyW]
xor eax, eax
test ebx, ebx
sete al
push eax
push 1
push edi
push dword [ebp - 0x3b84]
call dword [ebp - 0x3ba0]
test eax, eax
je 0x405df6
xor edx, edx
mov ecx, edi
call fcn.00404b07
jmp 0x405dfb
call fcn.0041390d
lea ecx, [ebp - 0x3b58]
mov ebx, eax
call fcn.00411ad6
lea ecx, [esi - 0x10]
call fcn.004025d7
mov eax, dword [ebp - 0x3b84]
lea ecx, [eax - 0x10]
call fcn.004025d7
lea ecx, [ebp - 0x3b80]
call fcn.00411ad6
lea ecx, [ebp - 0x3b98]
call fcn.0040cf8d
mov ecx, dword [ebp - 0x3b98]
push 0x18
pop edx
call fcn.00401abc
jmp 0x405e49
mov ebx, 0x80004002
lea ecx, [ebp - 0x3ba4]
call fcn.0041136e
lea ecx, [ebp - 0x3ba8]
call fcn.00411b4e
mov ecx, dword [ebp - 0x3b9c]
lea ecx, [ecx - 0x10]
call fcn.004025d7
lea ecx, [edi - 0x10]
call fcn.004025d7
lea ecx, [ebp - 0x3bac]
call fcn.0041136e
mov eax, ebx
jmp 0x405e89
mov eax, 0x80004001
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004488a4
leave
ret