Function at 0x406f20
Capabilities:
Check mutex on windows
Get file size
Read file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x108]
sub esp, 0x108
push 0xffffffffffffffff
push 0x41f8b3
mov eax, dword fs:[0]
push eax
sub esp, 0x28
mov eax, dword [0x43f7ac]
xor eax, ebp
mov dword [ebp + 0x104], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, dword [ebp + 0x110]
mov dword [ebp - 0x1c], esi
xor ebx, ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x24], ebx
mov ecx, 0x440b94
call fcn.004038a0
mov dword [ebp - 4], ebx
cmp esi, ebx
je 0x4071f2
cmp byte [esi], bl
je 0x4071f2
push 0x440b94
lea ecx, [ebp - 0x34]
call fcn.00403ad0
mov byte [ebp - 4], 1
jmp 0x406fa0
lea ecx, [ebp - 0x34]
call fcn.00404050
mov edi, eax
test edi, edi
je 0x406fe4
mov edx, esi
lea ecx, [edi + 0xc]
mov al, byte [ecx]
cmp al, byte [edx]
jne 0x406fd3
test al, al
je 0x406fcf
mov al, byte [ecx + 1]
cmp al, byte [edx + 1]
jne 0x406fd3
add ecx, 2
add edx, 2
test al, al
jne 0x406fb3
xor eax, eax
jmp 0x406fd8
sbb eax, eax
sbb eax, 0xffffffff
mov esi, dword [ebp - 0x1c]
test eax, eax
jne 0x406fa0
mov ebx, edi
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x20], 0
test ebx, ebx
jne 0x40702f
push 0x118
call fcn.0040db80
add esp, 4
mov dword [ebp - 0x18], eax
mov byte [ebp - 4], 2
test eax, eax
je 0x407010
mov ecx, eax
call fcn.004053c0
jmp 0x407012
xor eax, eax
mov byte [ebp - 4], 1
mov ebx, eax
mov dword [ebp - 0x14], ebx
mov dword [eax + 4], 0
mov dword [eax], 0
mov dword [ebp - 0x20], 1
lea eax, [ebx + 0xc]
push eax
push esi
call fcn.00411354
add esp, 8
test eax, eax
jne 0x407048
cmp dword [ebx], eax
jne 0x4071ab
mov byte [ebp], 0
push 0x103
push 0
lea eax, [ebp + 1]
push eax
call fcn.0040feb0
push 0x103
push esi
lea ecx, [ebp]
push ecx
call fcn.00410120
lea edx, [ebp]
push edx
call fcn.0040ef40
add esp, 0x1c
lea eax, [ebp]
add eax, 0xffffffff
lea ecx, [ecx]
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x407080
mov ecx, dword [str._mtx32]
mov dword [eax], ecx
mov dx, word [0x421c84]
mov word [eax + 4], dx
mov cl, byte [0x421c86]
mov byte [eax + 6], cl
lea edx, [ebp]
push edx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov dword [ebx + 4], eax
push 0x1388
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x4071ab
mov eax, dword [ebp + 0x114]
neg eax
sbb eax, eax
and eax, 0x40000000
add eax, 0x80000000
push 0
push 0x80
push 4
push 0
push 3
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x4071a1
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x18], eax
add eax, 1
push eax
call fcn.0040db80
mov esi, eax
mov dword [ebp - 0x24], esi
mov eax, dword [ebp - 0x18]
add eax, 1
push eax
push 0
push esi
call fcn.0040feb0
add esp, 0x10
push 0
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4071a1
mov dword [ebx], edi
push 0x103
mov edx, dword [ebp - 0x1c]
push edx
lea eax, [ebx + 0xc]
push eax
call fcn.00410120
add esp, 0xc
mov eax, dword [ebp + 0x114]
mov dword [ebx + 8], eax
push esi
lea ecx, [ebx + 0x110]
call fcn.00402b80
lea edi, [ebx + 0x114]
push esi
mov ecx, edi
call fcn.00402b80
mov ecx, edi
call fcn.00402e50
push ebx
mov ecx, 0x440b94
call fcn.00403c60
mov dword [ebp - 0x20], 0
mov ecx, dword [ebx + 4]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp dword [ebp - 0x20], 0
je 0x4071dd
cmp dword [ebx], 0
je 0x4071bf
mov edx, dword [ebx]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebx + 4], 0
je 0x4071cf
mov eax, dword [ebx + 4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
mov ecx, ebx
call fcn.004062a0
xor ebx, ebx
mov dword [ebp - 0x14], ebx
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x34]
call fcn.00403af0
mov dword [ebp - 4], 0xffffffff
jmp 0x407217
xor eax, eax
jmp 0x407264
mov dword [ebp - 4], 4
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x40722e
push eax
call fcn.0040dbc0
add esp, 4
mov dword [ebp - 4], 0xffffffff
jmp 0x407258
mov ecx, 0x440b94
call fcn.00403910
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x104]
xor ecx, ebp
call fcn.0040fe67
add ebp, 0x108
mov esp, ebp
pop ebp
ret 8