Function at 0x407910
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x4a84a8
push 0x47eeb0
mov eax, dword fs:[0]
push eax
sub esp, 8
mov eax, 0x10110
call fcn.004891f0
mov eax, dword [0x4aab30]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10118], eax
mov dword [ebp - 0x10114], ecx
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x10108], eax
mov ebx, edx
xor esi, esi
mov dword [ebp - 0x100fc], esi
mov dword [ebp - 0x100f8], esi
mov dword [ebp - 0x10120], esi
mov dword [ebp - 4], esi
call fcn.00406d10
mov dword [ebp - 0x10120], eax
call fcn.004078f0
push 0x4b1b4c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [0x4b1c14], 1
push 0x4b1b4c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp byte [0x4b1c15], 0
jne 0x407ddb
cmp dword [ebx + 4], esi
ja 0x4079c1
cmp dword [ebx], esi
jbe 0x4079dc
push 0xfffffffffffffffe
lea edx, [ebp - 0x10]
push edx
push 0x4aab30
call fcn.00487c7c
add esp, 0xc
or eax, 0xffffffff
jmp 0x407ded
mov eax, dword [ebp - 0x10108]
push eax
call fcn.00407520
add esp, 4
mov dword [ebp - 0x10110], eax
mov dword [ebp - 0x1010c], edx
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
lea ecx, [ecx]
mov dword [ebp - 0x100f8], 0
push 0
push 0x80
push 3
push 0
push 7
push SysReAllocString
mov ecx, dword [ebp - 0x10108]
push ecx
call edi
mov dword [ebp - 0x10100], eax
cmp eax, 0xffffffff
jne 0x407a57
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x100f8], eax
cmp esi, 0xa
jb 0x407a48
push esi
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp esi, 0x3e8
jae 0x407a57
inc esi
mov dword [ebp - 0x10124], esi
cmp dword [ebp - 0x100fc], 0
je 0x407a73
push 0
mov edx, dword [ebp - 0x100fc]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x407a8d
cmp byte [0x4b1c15], 0
jne 0x407a8d
cmp dword [ebp - 0x100f8], 0x20
jne 0x407a8d
xor al, al
jne 0x407a00
cmp dword [ebp - 0x10100], 0xffffffff
jne 0x407ac9
mov eax, dword [ebp - 0x10108]
push eax
push str.Unable_to_open_file_for_reading._File_name:__s.
mov esi, dword [ebp - 0x100f8]
mov ecx, esi
call fcn.00405e70
push 0xfffffffffffffffe
lea ecx, [ebp - 0x10]
push ecx
push 0x4aab30
call fcn.00487c7c
add esp, 0x14
mov eax, esi
jmp 0x407ded
mov eax, dword [ebx]
mov edx, dword [ebx + 4]
mov ecx, eax
or ecx, edx
jne 0x407ae1
lea eax, [ebp - 0x10088]
call fcn.0040f7a0
jmp 0x407b03
mov ecx, 0x1a
xor esi, esi
lea edi, [ebp - 0x10088]
rep movsd dword es:[edi], dword [esi]
push 0
push 0
push edx
push eax
mov edx, dword [ebp - 0x10100]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
cmp dword [ebx + 4], 0
ja 0x407b1f
jb 0x407b13
cmp dword [ebx], 0x1000
jae 0x407b1f
mov dword [ebp - 0x1011c], 0x1000
jmp 0x407b29
mov dword [ebp - 0x1011c], 0x10000
mov eax, dword [0x4b1c20]
or eax, dword [0x4b1c24]
jne 0x407b41
push 0x4b1c20
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov esi, dword [ebp - 0x1010c]
push 0
lea ecx, [ebp - 0x10104]
push ecx
mov edx, dword [ebp - 0x1011c]
push edx
lea eax, [ebp - 0x10020]
push eax
mov ecx, dword [ebp - 0x10100]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov byte [ebp - 0x100f1], al
mov edi, dword [ebp - 0x10104]
test al, al
je 0x407cca
test edi, edi
je 0x407cc6
xor eax, eax
je 0x407bb1
mov edx, dword [ebx]
or edx, dword [ebx + 4]
jne 0x407bb1
cmp edi, 2
jbe 0x407bb1
cmp byte [ebp - 0x10020], 0x4d
jne 0x407bae
cmp byte [ebp - 0x1001f], 0x5a
jne 0x407bae
mov byte [eax], 1
jmp 0x407bb1
mov byte [eax], 0
mov eax, dword [ebx]
mov ecx, dword [ebx + 4]
test ecx, ecx
ja 0x407c67
jb 0x407bcb
cmp eax, 0x1000
jae 0x407c67
mov edx, edi
add edx, eax
mov eax, 0
adc eax, ecx
cmp eax, esi
ja 0x407bf0
jb 0x407be4
cmp edx, dword [ebp - 0x10110]
jae 0x407bf0
test eax, eax
ja 0x407bf0
cmp edx, 0x1000
jb 0x407c67
mov ecx, 0x1a
lea esi, [ebp - 0x10088]
lea edi, [ebp - 0x100f0]
rep movsd dword es:[edi], dword [esi]
test eax, eax
ja 0x407c0f
cmp edx, 0x1000
jb 0x407c16
mov eax, 0x1000
jmp 0x407c1c
mov eax, dword [ebp - 0x10110]
sub eax, dword [ebx]
test eax, eax
je 0x407c37
lea ecx, [ebp - 0x10020]
push ecx
lea esi, [ebp - 0x100f0]
call fcn.00412200
add esp, 4
cmp dword [ebp - 0x10118], 0
je 0x407c51
mov edi, dword [ebp - 0x10118]
lea ecx, [ebp - 0x100f0]
call fcn.00412290
mov dword [ebp - 0x1011c], 0x10000
mov edi, dword [ebp - 0x10104]
mov esi, dword [ebp - 0x1010c]
test edi, edi
je 0x407c88
lea edx, [ebp - 0x10020]
push edx
mov eax, edi
lea esi, [ebp - 0x10088]
call fcn.00412200
add esp, 4
mov esi, dword [ebp - 0x1010c]
add dword [ebx], edi
adc dword [ebx + 4], 0
cmp dword [ebp - 0x10114], 0
jne 0x407cf2
mov ecx, dword [ebx]
mov eax, dword [ebx + 4]
test eax, eax
ja 0x407d45
jb 0x407cb2
cmp ecx, 0x1000
jae 0x407d45
cmp eax, esi
jb 0x407cf2
ja 0x407d45
cmp ecx, dword [ebp - 0x10110]
jb 0x407cf2
jmp 0x407d45
test al, al
jne 0x407cf2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x100f8], eax
mov ecx, dword [ebp - 0x10108]
push ecx
push str.Error_during_reading._File_name:__s.
mov ecx, eax
call fcn.00405e70
add esp, 8
mov edi, dword [ebp - 0x10104]
cmp dword [ebp - 0x100fc], 0
je 0x407d14
push 0
mov edx, dword [ebp - 0x100fc]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x407d45
mov edi, dword [ebp - 0x10104]
cmp byte [0x4b1c15], 0
jne 0x407d45
cmp byte [ebp - 0x100f1], 0
je 0x407d45
test edi, edi
je 0x407d45
mov eax, dword [ebx + 4]
cmp eax, esi
jb 0x407b47
ja 0x407d45
mov ecx, dword [ebx]
cmp ecx, dword [ebp - 0x10110]
jb 0x407b47
xor eax, eax
je 0x407d58
mov ecx, 0x1a
lea esi, [ebp - 0x10088]
xor edi, edi
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x10114], 0
je 0x407dc5
mov ebx, dword [ebp - 0x10114]
mov edi, ebx
lea ecx, [ebp - 0x10088]
call fcn.00412290
mov ecx, 8
mov esi, ebx
mov edi, dword [ebp - 0x10118]
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x4ac308
test ecx, ecx
je 0x407dc5
mov edx, 0xb
test edx, edx
je 0x407dc5
lea eax, [ebp - 0x10088]
call fcn.0040f7a0
push ecx
mov eax, edx
lea esi, [ebp - 0x10088]
call fcn.00412200
push ebx
mov eax, 0x20
call fcn.00412200
add esp, 8
mov edi, ebx
mov ecx, esi
call fcn.00412290
cmp dword [ebp - 0x10100], 0xffffffff
je 0x407ddb
mov edx, dword [ebp - 0x10100]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0xfffffffe
call fcn.00407e09
mov eax, dword [ebp - 0x100f8]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.0047a722
mov esp, ebp
pop ebp
ret