Function at 0x479980
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x8c
mov eax, dword [esp + 0xa4]
and eax, 3
je 0x479a6c
mov edi, dword [esp + 0xa0]
xor esi, esi
xor ecx, ecx
mov dword [esp + 0x7c], esi
mov eax, dword [eax*4 + 0x4d4cb0]
xor edx, edx
mov dword [esp + 0x70], ecx
mov ebp, dword [edi + 0x10]
mov ebx, eax
mov dword [esp + 0x80], edi
sar ebx, 0x1f
mov dword [esp + 0x78], ebp
mov ebp, edi
add ebp, 0x14
mov dword [esp + 0x74], edx
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], ebx
mov esi, dword [ebp]
xor ebx, ebx
mov eax, dword [esp + 0x68]
mov edi, dword [esp + 0x6c]
mov ecx, dword [esp + 0x68]
mul esi
imul edi, esi
imul ecx, ebx
mov dword [esp + 0x10], eax
mov eax, edx
add eax, edi
add eax, ecx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
add eax, dword [esp + 0x70]
adc edx, dword [esp + 0x74]
xor ebx, ebx
inc dword [esp + 0x7c]
mov dword [esp + 0x74], ebx
mov ebx, dword [esp + 0x78]
mov dword [ebp], eax
add ebp, 4
cmp dword [esp + 0x7c], ebx
mov dword [esp + 0x70], edx
jl 0x4799da
mov ebp, dword [esp + 0x74]
or ebp, edx
je 0x479a5e
mov edx, dword [esp + 0xa0]
cmp dword [edx + 8], ebx
jle 0x479d8a
mov eax, dword [esp + 0x78]
mov ebp, dword [esp + 0x80]
mov ecx, dword [esp + 0x70]
mov dword [ebp + eax*4 + 0x14], ecx
inc eax
mov dword [ebp + 0x10], eax
mov esi, dword [esp + 0x80]
mov dword [esp + 0xa0], esi
mov ebx, dword [esp + 0xa4]
sar ebx, 2
mov dword [esp + 0x20], ebx
je 0x479c92
mov edx, dword [0x54f4f0]
test edx, edx
mov dword [esp + 0x84], edx
je 0x479d2d
test byte [esp + 0x20], 1
je 0x479c6e
mov edi, dword [esp + 0x84]
mov esi, dword [esp + 0xa0]
mov ecx, dword [edi + 0x10]
cmp dword [esi + 0x10], ecx
jge 0x479abf
mov esi, edi
mov edi, dword [esp + 0xa0]
mov ebx, dword [edi + 0x10]
xor eax, eax
mov ebp, dword [esi + 0x10]
mov edx, dword [esi + 4]
mov dword [esp + 0xc], ebx
add ebx, ebp
cmp dword [esi + 8], ebx
mov dword [esp + 0x60], ebx
setl al
add eax, edx
mov dword [esp], eax
call fcn.00479240
mov dword [esp + 0x64], eax
add eax, 0x14
lea edx, [eax + ebx*4]
mov dword [esp + 0x24], eax
jmp 0x479afd
mov dword [eax], 0
add eax, 4
cmp eax, edx
jb 0x479af4
mov ecx, dword [esp + 0xc]
add esi, 0x14
add edi, 0x14
mov dword [esp + 0x1c], esi
lea ebx, [esi + ebp*4]
mov ebp, dword [esp + 0x24]
mov dword [esp + 0x5c], ebx
lea esi, [edi + ecx*4]
cmp edi, esi
mov dword [esp + 0x58], edi
mov dword [esp + 0x54], esi
mov dword [esp + 0x50], ebp
jae 0x479bcd
jmp 0x479b40
mov edi, dword [esp + 0x58]
mov ebp, dword [edi]
add edi, 4
mov dword [esp + 0x58], edi
test ebp, ebp
je 0x479bba
mov edi, dword [esp + 0x1c]
xor edx, edx
xor eax, eax
mov dword [esp + 0x48], edx
mov esi, dword [esp + 0x50]
mov dword [esp + 0x4c], eax
lea esi, [esi]
lea edi, [edi]
mov eax, dword [edi]
mov ebx, dword [esp + 0x48]
mov ecx, dword [esp + 0x4c]
mul ebp
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0x14], edx
mov edx, dword [esi]
add dword [esp + 0x10], edx
adc dword [esp + 0x14], eax
add dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x10]
adc dword [esp + 0x14], ecx
add edi, 4
xor eax, eax
mov dword [esi], ebx
add esi, 4
cmp edi, dword [esp + 0x5c]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x4c], eax
mov dword [esp + 0x48], edx
jb 0x479b70
mov dword [esi], edx
add dword [esp + 0x50], 4
mov esi, dword [esp + 0x54]
cmp dword [esp + 0x58], esi
jb 0x479b40
mov ebp, dword [esp + 0x60]
mov edi, dword [esp + 0x24]
test ebp, ebp
lea edx, [edi + ebp*4]
jle 0x479c05
cmp dword [edx - 4], 0
lea eax, [edx - 4]
jne 0x479c05
lea esi, [esi]
lea edi, [edi]
dec dword [esp + 0x60]
mov ecx, dword [esp + 0x60]
test ecx, ecx
jle 0x479c05
sub eax, 4
mov ebx, dword [eax]
test ebx, ebx
je 0x479bf0
mov eax, dword [esp + 0xa0]
mov esi, dword [esp + 0x60]
mov edx, dword [esp + 0x64]
test eax, eax
mov dword [edx + 0x10], esi
je 0x479c63
mov ecx, dword [0x54eb70]
cmp ecx, 2
je 0x479ce1
test ecx, ecx
je 0x47a007
cmp ecx, 1
je 0x479ca4
cmp ecx, 2
je 0x479ce1
mov ebx, dword [esp + 0xa0]
cmp ecx, 2
mov edx, dword [ebx + 4]
mov eax, dword [edx*4 + 0x54ebb0]
mov dword [ebx], eax
mov dword [edx*4 + 0x54ebb0], ebx
je 0x479d19
mov ecx, dword [esp + 0x64]
mov dword [esp + 0xa0], ecx
sar dword [esp + 0x20], 1
je 0x479c92
mov ebp, dword [esp + 0x84]
mov esi, dword [ebp]
test esi, esi
je 0x479e45
mov dword [esp + 0x84], esi
jmp 0x479a95
mov eax, dword [esp + 0xa0]
add esp, 0x8c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 1
call sub.KERNEL32.dll_Sleep
mov ecx, dword [0x54eb70]
sub esp, 4
cmp ecx, 1
jne 0x479c37
mov dword [esp], 1
call sub.KERNEL32.dll_Sleep
mov ecx, dword [0x54eb70]
sub esp, 4
cmp ecx, 1
je 0x479ca4
jmp 0x479c37
mov dword [esp], 0x54eb80
call sub.KERNEL32.dll_EnterCriticalSection
mov ecx, dword [0x54eb70]
sub esp, 4
mov ebx, dword [esp + 0xa0]
cmp ecx, 2
mov edx, dword [ebx + 4]
mov eax, dword [edx*4 + 0x54ebb0]
mov dword [ebx], eax
mov dword [edx*4 + 0x54ebb0], ebx
jne 0x479c63
mov dword [esp], 0x54eb80
call sub.KERNEL32.dll_LeaveCriticalSection
sub esp, 4
jmp 0x479c63
mov eax, dword [0x54eb70]
cmp eax, 2
je 0x47a1a2
test eax, eax
je 0x47a150
cmp eax, 1
je 0x47a0f0
cmp eax, 2
je 0x47a1a2
mov eax, dword [0x54f4f0]
test eax, eax
mov dword [esp + 0x84], eax
je 0x47a254
cmp dword [0x54eb70], 2
jne 0x479a95
mov dword [esp], 0x54eb98
call sub.KERNEL32.dll_LeaveCriticalSection
sub esp, 4
jmp 0x479a95
mov ebx, dword [edx + 4]
inc ebx
mov dword [esp], ebx
call fcn.00479240
mov ecx, dword [esp + 0xa0]
mov ebp, eax
mov eax, dword [ecx + 0x10]
mov esi, ecx
add esi, 0xc
lea edx, [eax*4]
lea ecx, [edx + 8]
cmp ecx, 7
lea eax, [ebp + 0xc]
ja 0x47a12b
cld
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov edx, dword [esp + 0xa0]
test edx, edx
je 0x479e39
mov ecx, dword [0x54eb70]
cmp ecx, 2
je 0x47a203
test ecx, ecx
je 0x47a1b6
cmp ecx, 1
jne 0x479e06
mov dword [esp], 1
call sub.KERNEL32.dll_Sleep
sub esp, 4
mov ecx, dword [0x54eb70]
cmp ecx, 1
je 0x479dec
cmp ecx, 2
je 0x47a203
mov edi, dword [esp + 0xa0]
cmp ecx, 2
mov ebx, dword [esp + 0xa0]
mov esi, dword [edi + 4]
mov edx, dword [esi*4 + 0x54ebb0]
mov dword [ebx], edx
mov dword [esi*4 + 0x54ebb0], ebx
je 0x47a240
mov dword [esp + 0x80], ebp
jmp 0x479a47
mov eax, dword [0x54eb70]
cmp eax, 2
je 0x479ec3
test eax, eax
je 0x47a07f
cmp eax, 1
je 0x479e8f
cmp eax, 2
je 0x479ec3
mov ecx, dword [esp + 0x84]
mov esi, dword [ecx]
test esi, esi
je 0x479edf
cmp dword [0x54eb70], 2
jne 0x479c86
mov dword [esp], 0x54eb98
call sub.KERNEL32.dll_LeaveCriticalSection
sub esp, 4
jmp 0x479c86
mov dword [esp], 1
call sub.KERNEL32.dll_Sleep
mov eax, dword [0x54eb70]
sub esp, 4
cmp eax, 1
jne 0x479e5c
mov dword [esp], 1
call sub.KERNEL32.dll_Sleep
mov eax, dword [0x54eb70]
sub esp, 4
cmp eax, 1
je 0x479e8f
jmp 0x479e5c
mov dword [esp], 0x54eb98
call sub.KERNEL32.dll_EnterCriticalSection
sub esp, 4
mov ecx, dword [esp + 0x84]
mov esi, dword [ecx]
test esi, esi
jne 0x479e6e
mov ebx, dword [ecx + 0x10]
mov edx, dword [ecx + 4]
lea ebp, [ebx + ebx]
cmp dword [ecx + 8], ebp
mov dword [esp + 0x40], ebp
setl al
movzx eax, al
add eax, edx
mov dword [esp], eax
call fcn.00479240
mov dword [esp + 0x44], eax
add eax, 0x14
lea edx, [eax + ebx*8]
mov dword [esp + 0x28], eax
jmp 0x479f18
mov dword [eax], 0
add eax, 4
cmp eax, edx
jb 0x479f0f
mov esi, dword [esp + 0x84]
add esi, 0x14
lea ebp, [esi + ebx*4]
mov dword [esp + 0x18], esi
mov ebx, dword [esp + 0x28]
cmp esi, ebp
mov dword [esp + 0x3c], esi
mov dword [esp + 0x38], ebx
jae 0x479fb9
mov edi, dword [esp + 0x3c]
add dword [esp + 0x3c], 4
mov ecx, dword [edi]
test ecx, ecx
mov dword [esp + 0x2c], ecx
je 0x479fae
mov edi, dword [esp + 0x18]
xor eax, eax
xor edx, edx
mov dword [esp + 0x30], eax
mov esi, dword [esp + 0x38]
mov dword [esp + 0x34], edx
mov eax, dword [esp + 0x2c]
mov ebx, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mul dword [edi]
mov dword [esp + 0x10], eax
mov eax, dword [esi]
mov dword [esp + 0x14], edx
xor edx, edx
add dword [esp + 0x10], eax
adc dword [esp + 0x14], edx
add dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x10]
adc dword [esp + 0x14], ecx
add edi, 4
xor edx, edx
mov dword [esi], ebx
mov eax, dword [esp + 0x14]
add esi, 4
mov dword [esp + 0x34], edx
cmp edi, ebp
mov dword [esp + 0x30], eax
jb 0x479f64
mov dword [esi], eax
add dword [esp + 0x38], 4
cmp dword [esp + 0x3c], ebp
jb 0x479f3d
mov ebp, dword [esp + 0x40]
mov esi, dword [esp + 0x28]
test ebp, ebp
lea edx, [esi + ebp*4]
jle 0x479fe6
cmp dword [edx - 4], 0
lea eax, [edx - 4]
jne 0x479fe6
dec dword [esp + 0x40]
mov edi, dword [esp + 0x40]
test edi, edi
jle 0x479fe6
sub eax, 4
mov ecx, dword [eax]
test ecx, ecx
je 0x479fd1
mov eax, dword [esp + 0x44]
mov edx, dword [esp + 0x40]
mov ebx, dword [esp + 0x84]
mov esi, eax
mov dword [eax + 0x10], edx
mov dword [ebx], eax
mov dword [eax], 0
jmp 0x479e6e
mov dword [esp], 0x54eb70
mov ebp, 1
mov dword [esp + 4], ebp
call sub.KERNEL32.dll_InterlockedExchange
sub esp, 8
test eax, eax
jne 0x47a06f
mov esi, 0x54eb80
mov ebx, 1
mov dword [esp], esi
add esi, 0x18
call sub.KERNEL32.dll_InitializeCriticalSection
sub esp, 4
dec ebx
jns 0x47a02d
mov dword [esp], 0x4791e0
call fcn.004012d0
mov dword [esp], 0x54eb80
mov edi, 2
mov dword [0x54eb70], edi
call sub.KERNEL32.dll_EnterCriticalSection
mov ecx, dword [0x54eb70]
sub esp, 4
jmp 0x479cf6
cmp eax, 2
je 0x47a04a
mov ecx, dword [0x54eb70]
jmp 0x479c32
mov dword [esp], 0x54eb70
mov esi, 1
mov dword [esp + 4], esi
call sub.KERNEL32.dll_InterlockedExchange
sub esp, 8
test eax, eax
jne 0x47a0e1
mov esi, 0x54eb80
mov ebx, 1
mov dword [esp], esi
add esi, 0x18
call sub.KERNEL32.dll_InitializeCriticalSection
sub esp, 4
dec ebx
jns 0x47a0a5
mov dword [esp], 0x4791e0
call fcn.004012d0
mov dword [esp], 0x54eb98
mov edi, 2
mov dword [0x54eb70], edi
call sub.KERNEL32.dll_EnterCriticalSection
sub esp, 4
jmp 0x479ed2
cmp eax, 2
je 0x47a0c2
mov eax, dword [0x54eb70]
jmp 0x479e57
mov dword [esp], 1
call sub.KERNEL32.dll_Sleep
mov eax, dword [0x54eb70]
sub esp, 4
cmp eax, 1
jne 0x479d4c
mov dword [esp], 1
call sub.KERNEL32.dll_Sleep
mov eax, dword [0x54eb70]
sub esp, 4
cmp eax, 1
je 0x47a0f0
jmp 0x479d4c
test al, 4
je 0x479dbd
mov edi, dword [esp + 0xa0]
lea eax, [ebp + 0x10]
lea ecx, [edx + 4]
mov esi, dword [edi + 0xc]
mov dword [ebp + 0xc], esi
mov esi, edi
add esi, 0x10
jmp 0x479dbd
mov dword [esp], 0x54eb70
mov edi, 1
mov dword [esp + 4], edi
call sub.KERNEL32.dll_InterlockedExchange
sub esp, 8
test eax, eax
jne 0x47a21d
mov esi, 0x54eb80
mov ebx, 1
mov dword [esp], esi
add esi, 0x18
call sub.KERNEL32.dll_InitializeCriticalSection
sub esp, 4
dec ebx
jns 0x47a17a
mov dword [esp], 0x4791e0
call fcn.004012d0
mov ebp, 2
mov dword [0x54eb70], ebp
mov dword [esp], 0x54eb98
call sub.KERNEL32.dll_EnterCriticalSection
sub esp, 4
jmp 0x479d55
mov dword [esp], 0x54eb70
mov ecx, 1
mov dword [esp + 4], ecx
call sub.KERNEL32.dll_InterlockedExchange
sub esp, 8
test eax, eax
jne 0x47a230
mov esi, 0x54eb80
mov ebx, 1
mov dword [esp], esi
add esi, 0x18
call sub.KERNEL32.dll_InitializeCriticalSection
sub esp, 4
dec ebx
jns 0x47a1dc
mov dword [esp], 0x4791e0
call fcn.004012d0
mov eax, 2
mov dword [0x54eb70], eax
mov dword [esp], 0x54eb80
call sub.KERNEL32.dll_EnterCriticalSection
mov ecx, dword [0x54eb70]
sub esp, 4
jmp 0x479e0f
cmp eax, 2
je 0x47a197
mov eax, dword [0x54eb70]
jmp 0x479d43
cmp eax, 2
jne 0x479dfb
jmp 0x47a1f9
mov dword [esp], 0x54eb80
call sub.KERNEL32.dll_LeaveCriticalSection
sub esp, 4
jmp 0x479e39
mov dword [esp], 1
call fcn.00479240
mov dword [0x54f4f0], eax
mov dword [eax + 0x14], 0x271
mov dword [eax + 0x10], 1
mov dword [esp + 0x84], eax
mov dword [eax], 0
jmp 0x479d69