Function at 0x407183
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
xor eax, eax
push ebx
mov ebx, ecx
mov dword [esp + 0x1c], eax
push esi
mov esi, eax
mov dword [esp + 0x14], eax
push edi
mov dword [esp + 0x2c], eax
cmp dword [0x51e700], eax
jne 0x4071b5
cmp dword [0x51e6fc], eax
je 0x407640
xor edi, edi
mov byte [esp + 0xf], al
inc edi
cmp dword [ebx + 0xa], eax
jne 0x4071d4
cmp dword [0x51e6d8], eax
mov edi, dword [0x51e6e8]
mov eax, dword [0x51e6cc]
jmp 0x4071eb
cmp dword [ebx + 0xa], 1
jne 0x4071f7
cmp dword [0x51e6dc], eax
mov edi, dword [0x51e6ec]
mov eax, dword [0x51e6d0]
setne byte [esp + 0xf]
neg eax
sbb eax, eax
and eax, 4
mov dl, byte [ebx + 4]
cmp dl, 5
jb 0x407205
mov byte [ebx + 4], 4
mov dl, 4
imul ecx, eax, 5
cmp dword [ebx + 0x1e], 0x10
movzx eax, dl
mov edx, dword [ebx]
push 3
movzx esi, byte [ecx + eax + 0x4ffce0]
lea eax, [edx + ebx]
mov dword [esp + 0x24], eax
pop eax
jne 0x407427
mov eax, dword [ebx + 0x22]
mov ecx, dword [ebx + 0x2a]
mov dword [esp + 0x24], eax
mov eax, dword [ebx + 0x26]
mov dword [esp + 0x10], eax
test ecx, ecx
je 0x407264
cmp ecx, edx
jae 0x407264
mov edx, dword [esp + 0x20]
lea eax, [ecx + ebx]
mov ecx, eax
mov dword [esp + 0x28], eax
call fcn.00407171
test eax, eax
je 0x407260
mov eax, dword [esp + 0x28]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
test esi, esi
jne 0x407270
test eax, eax
je 0x407640
push 3
pop eax
cmp edi, 1
cmovne esi, eax
mov eax, esi
xor esi, esi
cmp eax, 1
cmove esi, eax
mov dword [esp + 0x30], esi
call fcn.0040a6a4
push 0x6000
push 8
pop eax
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
je 0x407640
lea eax, [edi + 0x1598]
mov ecx, 0x400
mov dword [edi + 0x1584], eax
add eax, 0x800
mov dword [edi + 0x1588], eax
add eax, ecx
mov dword [edi + 0x158c], eax
add eax, ecx
mov ecx, dword [ebx + 0x12]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x38], eax
cmp ecx, dword [ebx]
ja 0x407630
mov eax, dword [ebx + 0x16]
cmp eax, dword [ebx]
ja 0x407630
mov edx, dword [esp + 0x20]
add ecx, ebx
add eax, ebx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x28], eax
call fcn.00407171
test eax, eax
je 0x407630
mov ecx, dword [esp + 0x28]
call fcn.00407171
test eax, eax
je 0x407630
mov eax, dword [ebx + 0x1a]
test eax, eax
je 0x407344
cmp eax, dword [ebx]
jae 0x407344
lea esi, [eax + ebx]
mov ecx, esi
call fcn.00407171
mov ecx, dword [esp + 0x18]
test eax, eax
cmovne ecx, esi
mov esi, dword [esp + 0x30]
mov dword [esp + 0x18], ecx
push 0x78
pop eax
push 0x73
pop ecx
cmp esi, 1
cmovne eax, ecx
xor ecx, ecx
mov byte [edi + 0x14], al
lea eax, [edi + 0x1420]
mov byte [edi + 0x15], cl
mov byte [edi + 0x815], cl
mov byte [edi + 0x415], cl
mov byte [edi + 0xc15], cl
mov byte [edi + 0x1015], cl
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov eax, dword [esp + 0x24]
mov byte [edi + 0x1428], cl
mov byte [edi + 0x1468], cl
mov byte [edi + 0x14e8], cl
mov dword [edi + 0x1574], eax
mov eax, dword [esp + 0x10]
mov dword [edi + 0x1578], eax
lea eax, [edi + 0x1580]
push eax
mov dword [edi + 0x1568], ecx
mov dword [edi + 0x156c], ecx
mov dword [edi + 4], ebx
mov dword [edi + 0x1570], esi
mov dword [eax], ecx
push dword [ebx + 0xe]
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
jne 0x4073d7
lea ecx, [edi + 0x1580]
call fcn.0048dc50
mov ecx, dword [edi + 0x1580]
lea edx, [edi + 0x1590]
call fcn.0048de60
test eax, eax
je 0x407417
cmp dword [edi + 0x1590], 0
je 0x407417
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x38]
mov ecx, dword [edi + 0x1580]
mov dword [edi + 0x1594], eax
add eax, 0x4b0
mov dword [esp + 0x1c], eax
call fcn.0048df20
mov cl, byte [ebx + 9]
cmp cl, 0x46
jne 0x407448
mov dword [edi], 1
jmp 0x407455
cmp esi, 1
jne 0x407435
mov dword [esp + 0x10], eax
jmp 0x407273
push 2
pop ecx
xor eax, eax
cmp esi, ecx
cmove eax, ecx
mov dword [esp + 0x10], eax
jmp 0x407264
xor eax, eax
cmp cl, 0x55
push 8
pop ecx
cmove eax, ecx
mov dword [edi], eax
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x14]
mov dword [edi + 0xc], ecx
mov ecx, dword [esp + 0x18]
mov dword [edi + 0x10], ecx
mov ecx, dword [esp + 0x2c]
push 0x5c
push eax
mov dword [edi + 8], eax
mov dword [edi + 0x157c], ecx
call fcn.0049f6d0
pop ecx
pop ecx
test eax, eax
je 0x407485
inc eax
jmp 0x407489
mov eax, dword [esp + 0x14]
cmp dword [ebx + 0xa], 0
push dword [ebx + 5]
mov dword [esp + 0x1c], eax
lea eax, [edi + 0x15]
jne 0x4074a1
push dword [0x51eb38]
jmp 0x4074a7
push dword [0x51eb34]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov ebx, dword [esp + 0x28]
lea eax, [edi + 0x415]
add esp, 0xc
mov byte [eax], 0
mov edx, 0x5075cc
push ecx
mov ecx, dword [esp + 0x18]
push ebx
push eax
call fcn.004076f3
lea eax, [edi + 0x415]
add esp, 0xc
cmp byte [eax], 0
jne 0x4074e8
push dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push ecx
lea eax, [edi + 0x815]
mov edx, 0x5075d8
push ebx
mov ebx, dword [esp + 0x1c]
mov ecx, ebx
push eax
mov byte [eax], 0
call fcn.004076f3
lea eax, [edi + 0x815]
add esp, 0xc
cmp byte [eax], 0
jne 0x40751d
push dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [edi + 0x1015]
mov ecx, ebx
push eax
lea edx, [edi + 0xc15]
call fcn.0041f2c0
cmp dword [edi], 1
pop ecx
jne 0x407606
mov ecx, dword [edi + 0xc]
lea edx, [edi + 0x1428]
call fcn.0041f0b8
mov ecx, dword [edi + 0xc]
lea edx, [edi + 0x1468]
call fcn.0040c23b
mov ecx, dword [edi + 0xc]
lea edx, [edi + 0x14e8]
call fcn.0040c267
xor eax, eax
push eax
push eax
push 3
push eax
push 3
push SysReAllocString
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4075cd
lea eax, [edi + 0x1420]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
lea eax, [esp + 0x30]
push eax
push 0
lea eax, [esp + 0x40]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileTime]
test eax, eax
je 0x4075c6
lea ecx, [esp + 0x38]
call fcn.00420fc4
lea ecx, [esp + 0x30]
mov dword [edi + 0x1568], eax
call fcn.00420fc4
mov dword [edi + 0x156c], eax
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [edi + 0x1584]
xor ecx, ecx
mov byte [eax], cl
mov eax, dword [edi + 0x1588]
mov byte [eax], cl
mov eax, dword [edi + 0x158c]
mov byte [eax], cl
lea ecx, [edi + 0x1428]
push dword [edi + 0x158c]
mov edx, dword [edi + 0x1584]
push dword [edi + 0x1588]
call fcn.0041f10d
pop ecx
pop ecx
cmp esi, 1
jne 0x407612
mov ecx, edi
call fcn.00407649
cmp byte [0x51e6c8], 0
je 0x407622
mov ecx, edi
call fcn.004256e9
cmp byte [esp + 0xf], 0
je 0x407630
mov ecx, edi
call fcn.004257b4
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret