Function at 0x407680
Capabilities:
Check for time delay via gettickcount
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push esi
mov esi, ecx
xor eax, eax
mov dword [ebp - 0x18], eax
cmp dword [esi + 0xc], 0xffffffff
jne 0x40769d
cmp dword [esi + 0x10], eax
je 0x4078c2
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x10]
cmp eax, dword [esi + 0x1c]
ja 0x4076bc
jb 0x4076b4
cmp ebx, dword [esi + 0x18]
ja 0x4076bc
test edi, edi
je 0x40798f
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [0x45bb74]
cmp eax, 0x1388
jbe 0x4076df
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [0x45bb74], eax
call fcn.00407aed
lea eax, [esi + 0xe0]
push eax
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp byte [ebp + 0x14], 0
je 0x40782b
cmp byte [esi + 4], 0
jne 0x40782b
mov edx, dword [ebp + 0xc]
xor ecx, ecx
mov eax, edi
add eax, ebx
adc ecx, edx
cmp ecx, dword [esi + 0x1c]
jb 0x40772e
ja 0x40771a
cmp eax, dword [esi + 0x18]
jbe 0x40772e
push ecx
push eax
mov ecx, esi
call fcn.00407b82
test al, al
je 0x407854
mov edx, dword [ebp + 0xc]
mov ecx, dword [esi + 8]
lea eax, [ecx - 1]
and eax, ebx
sub ebx, eax
sbb edx, 0
dec eax
add eax, ecx
mov dword [ebp - 0x18], edx
add eax, edi
neg ecx
and eax, ecx
cmp byte [esi + 4], 0
mov dword [ebp + 0x10], eax
je 0x40776c
mov ecx, eax
xor eax, eax
add ecx, ebx
adc eax, edx
cmp eax, dword [esi + 0x1c]
jb 0x40776c
ja 0x407764
cmp ecx, dword [esi + 0x18]
jbe 0x40776c
mov eax, dword [esi + 0x18]
sub eax, ebx
mov dword [ebp + 0x10], eax
xor eax, eax
mov dword [ebp - 0xc], 0xffffffe0
mov byte [ebp + 0x17], al
lea edi, [esi + 0x28]
mov dword [ebp + 0xc], eax
or ecx, 0xffffffff
push 0xffffffffffffffd8
pop eax
sub eax, esi
mov dword [ebp - 4], ecx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x14], 1
cmp edx, dword [edi + 4]
jb 0x4077d1
ja 0x40779e
cmp ebx, dword [edi]
jb 0x4077d1
mov eax, dword [edi + 8]
xor ecx, ecx
add eax, dword [edi]
mov dword [ebp - 0x1c], eax
adc ecx, dword [edi + 4]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 8], eax
xor eax, eax
add dword [ebp - 8], ebx
adc eax, edx
cmp eax, ecx
jb 0x407886
ja 0x4077ce
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x1c]
jbe 0x407886
mov ecx, dword [ebp - 4]
xor eax, eax
cmp dword [edi + 0xc], eax
jne 0x407817
cmp ecx, 0xffffffff
je 0x407806
cmp dword [edi - 4], eax
jne 0x4077ed
mov eax, dword [ebp - 0xc]
xor ecx, ecx
cmp dword [eax + esi + 0x24], ecx
jne 0x407806
mov edx, dword [ebp - 0xc]
mov ecx, dword [esi + 0xfc]
mov eax, ecx
sub ecx, dword [edi + 0x10]
sub eax, dword [edx + esi + 0x38]
mov edx, dword [ebp - 0x18]
cmp ecx, eax
jbe 0x407814
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 4], ecx
mov ecx, dword [ebp - 0x20]
add ecx, edi
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp - 4]
mov eax, dword [ebp + 0xc]
add edi, 0x20
inc eax
mov dword [ebp + 0xc], eax
cmp eax, 6
jae 0x40788f
jmp 0x40778c
mov eax, dword [esi + 0x1c]
mov edx, dword [ebp + 0xc]
mov ecx, dword [esi + 0x18]
cmp edx, eax
jb 0x407865
ja 0x40783e
cmp ebx, ecx
jb 0x407865
xor eax, eax
mov dword [ebp + 0x14], edi
add dword [ebp + 0x14], ebx
adc eax, edx
cmp eax, dword [esi + 0x1c]
jb 0x407862
ja 0x407854
cmp dword [ebp + 0x14], ecx
jbe 0x407862
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40798f
mov eax, dword [esi + 0x1c]
sub ecx, ebx
sbb eax, edx
cmp dword [ebp - 0x18], eax
jb 0x40772e
ja 0x40787c
cmp edi, ecx
jbe 0x40772e
mov edi, dword [esi + 0x18]
sub edi, ebx
jmp 0x40772e
mov al, byte [ebp - 0x14]
mov ecx, dword [ebp + 0xc]
mov byte [ebp + 0x17], al
test ecx, ecx
js 0x407996
lea edi, [ecx + 1]
shl edi, 5
add edi, esi
lea eax, [edi + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
cmp byte [ebp + 0x17], 0
je 0x4078c9
inc dword [esi + 0xfc]
mov eax, dword [esi + 0xfc]
mov dword [edi + 0x18], eax
mov eax, edi
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret 0x10
cmp dword [edi + 4], 0
je 0x4078d8
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp + 0x10]
mov dword [edi + 8], ebx
mov dword [edi + 0xc], edx
mov dword [edi + 0x10], ecx
inc dword [esi + 0xfc]
mov eax, dword [esi + 0xfc]
push ecx
mov dword [edi + 0x18], eax
xor eax, eax
push ebx
mov dword [ebp + 0xc], eax
push edx
jmp 0x407917
cmp byte [ebp - 0x14], 0
je 0x407935
xor eax, eax
mov byte [ebp - 0x14], al
call fcn.00407aed
push dword [ebp + 0x10]
push ebx
push dword [ebp - 0x18]
cmp byte [esi + 4], 0
push 2
pop eax
push 4
pop ecx
cmovne eax, ecx
push eax
push dword [esi + 0x10]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [edi + 4], eax
test eax, eax
je 0x407900
cmp dword [edi + 4], 0
jne 0x40794c
push 0xffffffffffffffff
push 0xffffffffffffffff
push edi
mov ecx, esi
call fcn.00407aad
push dword [ebp + 0x10]
jmp 0x4079a0
xor ebx, ebx
cmp dword [esi], ebx
je 0x4078be
push 4
pop eax
push eax
push 0x1000
push dword [ebp + 0x10]
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
cmp eax, dword [edi + 4]
je 0x4078be
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push 0xffffffffffffffff
push 0xffffffffffffffff
push edi
mov ecx, esi
mov dword [edi + 4], ebx
mov dword [edi + 0x10], ebx
call fcn.00407aad
xor eax, eax
jmp 0x4078c0
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebx
call fcn.0042d16e
call eax
lea eax, [ebp + 0x14]
mov dword [esp], 0x455464
push eax
mov dword [ebp + 0x14], 8
call fcn.0042bf22
int3