Function at 0x476d49
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [0xa150e0]
test eax, eax
jne 0x476d74
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.00443436
mov dword [0xa150e0], eax
mov dword [esp + 4], 1
mov dword [esp], 0x535f87
call fcn.004432b3
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00443d61
mov edx, eax
mov eax, dword [0xa150e0]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0044359d
call fcn.00475895
mov dword [0xa150e4], eax
mov edx, dword [0x68b6fc]
mov eax, dword [0xa150e4]
shl eax, 3
mov ecx, eax
shl ecx, 4
mov ebx, ecx
sub ebx, eax
mov eax, ebx
add eax, edx
mov dword [0xa150e8], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
movzx eax, byte [eax]
movzx eax, al
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0x53
je 0x476df4
cmp dword [ebp - 0x20], 0x73
jne 0x476e71
add dword [ebp - 0x1c], 1
mov eax, dword [ebp - 0x1c]
movzx eax, byte [eax]
movzx eax, al
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0x43
je 0x476e10
cmp dword [ebp - 0x20], 0x63
jne 0x476e71
add dword [ebp - 0x1c], 1
mov eax, dword [ebp - 0x1c]
movzx eax, byte [eax]
movzx eax, al
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0x52
je 0x476e2c
cmp dword [ebp - 0x20], 0x72
jne 0x476e71
add dword [ebp - 0x1c], 1
mov eax, dword [ebp - 0x1c]
movzx eax, byte [eax]
movzx eax, al
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0x4e
je 0x476e48
cmp dword [ebp - 0x20], 0x6e
jne 0x476e71
add dword [ebp - 0x1c], 1
mov eax, dword [ebp - 0x1c]
movzx eax, byte [eax]
movzx eax, al
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0x3a
jne 0x476e71
mov eax, dword [0xa150e8]
mov byte [eax + 0x70], 1
mov eax, dword [0xa150e4]
jmp 0x477715
mov eax, dword [ebp + 0xc]
and eax, 1
test eax, eax
je 0x476e84
mov eax, dword [0xa150e8]
mov byte [eax + 9], 1
mov eax, dword [ebp + 0xc]
and eax, 2
test eax, eax
je 0x476e97
mov eax, dword [0xa150e8]
mov byte [eax + 0xa], 1
mov eax, dword [ebp + 0x10]
and eax, 1
test eax, eax
je 0x476eaa
mov eax, dword [0xa150e8]
mov byte [eax + 0xb], 1
mov eax, dword [ebp + 0x10]
and eax, 2
test eax, eax
je 0x476ebd
mov eax, dword [0xa150e8]
mov byte [eax + 0xc], 1
mov eax, dword [0xa150e8]
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0
mov edx, dword [0xa150e8]
mov eax, dword [0xa150e0]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00475eb9
mov dword [0xa150ec], eax
mov eax, dword [0xa150ec]
test eax, eax
setne al
test al, al
je 0x476f1b
mov eax, dword [0xa150ec]
cmp eax, 0xffffffff
jne 0x476f1b
mov eax, dword [0xa150e4]
mov dword [esp], eax
call fcn.00475b94
mov eax, 0xfffffff5
jmp 0x477715
mov eax, dword [0x68b6f8]
mov edx, dword [0xa150e4]
shl edx, 2
add eax, edx
mov dword [0xa150f0], eax
mov dword [0xa150ec], 0
mov eax, dword [ebp + 0xc]
and eax, 1
test eax, eax
je 0x476f53
mov eax, dword [0xa150ec]
or eax, 0x80000000
mov dword [0xa150ec], eax
mov eax, dword [ebp + 0xc]
and eax, 2
test eax, eax
je 0x476f6c
mov eax, dword [0xa150ec]
or eax, 0x40000000
mov dword [0xa150ec], eax
mov dword [0xa150f4], 3
mov eax, dword [ebp + 0x10]
and eax, 1
test eax, eax
je 0x476f8d
mov eax, dword [0xa150f4]
xor eax, 1
mov dword [0xa150f4], eax
mov eax, dword [ebp + 0x10]
and eax, 2
test eax, eax
je 0x476fa4
mov eax, dword [0xa150f4]
xor eax, 2
mov dword [0xa150f4], eax
mov eax, dword [0xa150e8]
movzx eax, byte [eax + 0x50]
test al, al
je 0x4773e3
mov eax, dword [0xa150f8]
test eax, eax
jne 0x476fd7
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.00443436
mov dword [0xa150f8], eax
mov eax, dword [0xa150e8]
movzx eax, byte [eax + 0x50]
movzx eax, al
mov dword [esp], eax
call fcn.00445a58
mov ebx, eax
mov dword [esp], 0x536499
call fcn.00443222
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.00443d61
mov edx, eax
mov eax, dword [0xa150f8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0044359d
mov dword [esp + 4], 2
mov dword [esp], 0x53649c
call fcn.004432b3
mov edx, eax
mov eax, dword [0xa150f8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00443d61
mov edx, eax
mov eax, dword [0xa150f8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0044359d
mov eax, dword [0xa150f8]
mov eax, dword [eax]
add eax, 2
mov byte [eax], 0x4d
mov ebx, dword [0xa150f0]
mov eax, dword [0xa150ec]
mov edx, eax
mov eax, dword [0xa150f8]
mov eax, dword [eax]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileA]
call eax
sub esp, 0x1c
mov dword [ebx], eax
mov eax, dword [0xa150f0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x4770d1
mov eax, dword [0xa150e4]
mov dword [esp], eax
call fcn.00475b94
mov eax, 0xfffffff8
jmp 0x477715
mov dword [esp + 8], 0x1c
mov dword [esp + 4], 0
mov dword [esp], 0xa150fc
call sub.msvcrt.dll_memset
mov dword [0xa150fc], 0x1c
mov eax, dword [0xa150f0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa150fc
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetCommState]
call eax
sub esp, 8
test eax, eax
sete al
test al, al
je 0x477147
mov eax, dword [0xa150f0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa150e4]
mov dword [esp], eax
call fcn.00475b94
mov eax, 0xfffffff8
jmp 0x477715
mov dword [esp + 8], 0x14
mov dword [esp + 4], 0
mov dword [esp], 0xa15118
call sub.msvcrt.dll_memset
mov eax, dword [0xa150e8]
mov eax, dword [eax + 0x54]
mov dword [0xa15100], eax
mov eax, dword [0xa150e8]
movzx eax, byte [eax + 0x5a]
movsx eax, al
mov dword [0xa150ec], eax
mov eax, dword [0xa150ec]
cmp eax, 0xa
jne 0x477195
mov dword [0xa150f4], 0
mov eax, dword [0xa150ec]
cmp eax, 0xf
jne 0x4771a9
mov dword [0xa150f4], 1
mov eax, dword [0xa150ec]
cmp eax, 0x14
jne 0x4771bd
mov dword [0xa150f4], 2
mov eax, dword [0xa150f4]
mov byte [0xa15110], al
mov eax, dword [0xa150e8]
movzx eax, byte [eax + 0x59]
mov byte [0xa1510e], al
mov eax, dword [0xa150e8]
movzx eax, byte [eax + 0x58]
movsx eax, al
mov dword [0xa150ec], eax
mov eax, dword [0xa150ec]
test eax, eax
jne 0x4771f9
mov dword [0xa150f4], 0
mov eax, dword [0xa150ec]
cmp eax, 1
jne 0x47720d
mov dword [0xa150f4], 2
mov eax, dword [0xa150ec]
cmp eax, 2
jne 0x477221
mov dword [0xa150f4], 1
mov eax, dword [0xa150ec]
cmp eax, 3
jne 0x477235
mov dword [0xa150f4], 4
mov eax, dword [0xa150ec]
cmp eax, 4
jne 0x477249
mov dword [0xa150f4], 3
mov eax, dword [0xa150f4]
mov byte [0xa1510f], al
mov eax, dword [0xa150f4]
test eax, eax
jne 0x47726d
movzx eax, byte [0xa15104]
and eax, 0xfffffffd
mov byte [0xa15104], al
jmp 0x47727c
movzx eax, byte [0xa15104]
or eax, 2
mov byte [0xa15104], al
mov eax, dword [0xa150e8]
movzx eax, byte [eax + 0x5d]
test al, al
je 0x477298
movzx eax, byte [0xa15105]
and eax, 0xffffffcf
mov byte [0xa15105], al
mov eax, dword [0xa150e8]
movzx eax, byte [eax + 0x5b]
test al, al
jne 0x4772b6
movzx eax, byte [0xa15104]
or eax, 1
mov byte [0xa15104], al
jmp 0x4772c5
movzx eax, byte [0xa15104]
and eax, 0xfffffffe
mov byte [0xa15104], al
mov byte [0xa15114], 0x1a
mov eax, dword [0xa150f0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa150fc
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_SetCommState]
call eax
sub esp, 8
test eax, eax
sete al
test al, al
je 0x47731c
mov eax, dword [0xa150f0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa150e4]
mov dword [esp], eax
call fcn.00475b94
mov eax, 0xfffffff8
jmp 0x477715
mov eax, dword [0xa150e8]
mov eax, dword [eax + 0x68]
test eax, eax
jne 0x477348
mov dword [0xa15118], 0xffffffff
mov dword [0xa1511c], 0
mov dword [0xa15120], 0
jmp 0x477369
mov dword [0xa15118], 0
mov dword [0xa1511c], 0
mov eax, dword [0xa150e8]
mov eax, dword [eax + 0x68]
mov dword [0xa15120], eax
mov dword [0xa15124], 0
mov eax, dword [0xa150e8]
mov eax, dword [eax + 0x64]
mov dword [0xa15128], eax
mov eax, dword [0xa150f0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa15118
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
call eax
sub esp, 8
test eax, eax
sete al
test al, al
je 0x4773d0
mov eax, dword [0xa150f0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa150e4]
mov dword [esp], eax
call fcn.00475b94
mov eax, 0xfffffff8
jmp 0x477715
mov eax, dword [0xa150e8]
mov byte [eax + 8], 1
mov eax, dword [0xa150e4]
jmp 0x477715
mov dword [0xa1512c], 3
cmp dword [ebp + 0x14], 0
je 0x4773fd
mov dword [0xa1512c], 4
mov ebx, dword [0xa150f0]
mov eax, dword [0xa1512c]
mov dword [ebp - 0x2c], eax
mov eax, dword [0xa150f4]
mov edi, eax
mov eax, dword [0xa150ec]
mov esi, eax
mov eax, dword [0xa150e0]
mov dword [esp], eax
call fcn.004381eb
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov edx, dword [ebp - 0x2c]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileA]
call eax
sub esp, 0x1c
mov dword [ebx], eax
mov eax, dword [0xa150f0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x477585
cmp dword [ebp + 0x14], 3
jne 0x477497
mov dword [0xa150ec], 0x80000000
mov eax, dword [0xa150e8]
mov byte [eax + 9], 1
mov eax, dword [0xa150e8]
mov byte [eax + 0xa], 0
add dword [ebp + 0x14], 1
jmp 0x4773fd
cmp dword [ebp + 0x14], 4
jne 0x4774c2
mov dword [0xa150ec], 0x40000000
mov eax, dword [0xa150e8]
mov byte [eax + 9], 0
mov eax, dword [0xa150e8]
mov byte [eax + 0xa], 1
add dword [ebp + 0x14], 1
jmp 0x4773fd
mov eax, dword [0xa150e4]
mov dword [esp], eax
call fcn.00475b94
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [0xa15130], eax
mov eax, dword [0xa15130]
cmp eax, 3
jne 0x4774ef
mov eax, 0xfffffffa
jmp 0x477715
mov eax, dword [0xa15130]
cmp eax, 4
je 0x47750d
mov eax, dword [0xa15130]
cmp eax, 0x1d
je 0x47750d
mov eax, dword [0xa15130]
cmp eax, 0x1e
jne 0x477517
mov eax, 0xfffffff7
jmp 0x477715
mov eax, dword [0xa15130]
cmp eax, 5
je 0x47753f
mov eax, dword [0xa15130]
cmp eax, 0x13
je 0x47753f
mov eax, dword [0xa15130]
cmp eax, 0x21
je 0x47753f
mov eax, dword [0xa15130]
cmp eax, 0x20
jne 0x477549
mov eax, 0xfffffff9
jmp 0x477715
mov eax, dword [0xa15130]
cmp eax, 0xf
je 0x47755d
mov eax, dword [0xa15130]
cmp eax, 0x15
jne 0x477567
mov eax, 0xfffffff8
jmp 0x477715
mov eax, dword [0xa15130]
cmp eax, 2
jne 0x47757b
mov eax, 0xfffffffb
jmp 0x477715
mov eax, 0xfffffffb
jmp 0x477715
cmp dword [ebp + 0x14], 2
jne 0x477707
mov eax, dword [0xa150f0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa15134
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileSize]
call eax
sub esp, 8
mov dword [0xa15138], eax
mov eax, dword [0xa15138]
test eax, eax
jne 0x4775c6
mov eax, dword [0xa15134]
test eax, eax
je 0x477707
mov eax, dword [0xa150f0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov dword [0xa1512c], 5
mov ebx, dword [0xa150f0]
mov eax, dword [0xa1512c]
mov dword [ebp - 0x30], eax
mov eax, dword [0xa150f4]
mov edi, eax
mov eax, dword [0xa150ec]
mov esi, eax
mov eax, dword [0xa150e0]
mov dword [esp], eax
call fcn.004381eb
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov edx, dword [ebp - 0x30]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileA]
call eax
sub esp, 0x1c
mov dword [ebx], eax
mov eax, dword [0xa150f0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x477707
mov eax, dword [0xa150e4]
mov dword [esp], eax
call fcn.00475b94
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [0xa15130], eax
mov eax, dword [0xa15130]
cmp eax, 3
jne 0x477680
mov eax, 0xfffffffa
jmp 0x477715
mov eax, dword [0xa15130]
cmp eax, 4
je 0x47769e
mov eax, dword [0xa15130]
cmp eax, 0x1d
je 0x47769e
mov eax, dword [0xa15130]
cmp eax, 0x1e
jne 0x4776a5
mov eax, 0xfffffff7
jmp 0x477715
mov eax, dword [0xa15130]
cmp eax, 5
je 0x4776cd
mov eax, dword [0xa15130]
cmp eax, 0x13
je 0x4776cd
mov eax, dword [0xa15130]
cmp eax, 0x21
je 0x4776cd
mov eax, dword [0xa15130]
cmp eax, 0x20
jne 0x4776d4
mov eax, 0xfffffff9
jmp 0x477715
mov eax, dword [0xa15130]
cmp eax, 0xf
je 0x4776e8
mov eax, dword [0xa15130]
cmp eax, 0x15
jne 0x4776ef
mov eax, 0xfffffff8
jmp 0x477715
mov eax, dword [0xa15130]
cmp eax, 2
jne 0x477700
mov eax, 0xfffffffb
jmp 0x477715
mov eax, 0xfffffffb
jmp 0x477715
mov eax, dword [0xa150e8]
mov byte [eax + 8], 1
mov eax, dword [0xa150e4]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret