Function at 0x496611
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [0xa347c0]
test eax, eax
jne 0x49663c
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.00462cfe
mov dword [0xa347c0], eax
mov dword [esp + 4], 1
mov dword [esp], 0x555127
call fcn.00462b7b
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00463629
mov edx, eax
mov eax, dword [0xa347c0]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00462e65
call fcn.0049515d
mov dword [0xa347c4], eax
mov edx, dword [0x6aaddc]
mov eax, dword [0xa347c4]
shl eax, 3
mov ecx, eax
shl ecx, 4
mov ebx, ecx
sub ebx, eax
mov eax, ebx
add eax, edx
mov dword [0xa347c8], 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 0x4966bc
cmp dword [ebp - 0x20], 0x73
jne 0x496739
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 0x4966d8
cmp dword [ebp - 0x20], 0x63
jne 0x496739
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 0x4966f4
cmp dword [ebp - 0x20], 0x72
jne 0x496739
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 0x496710
cmp dword [ebp - 0x20], 0x6e
jne 0x496739
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 0x496739
mov eax, dword [0xa347c8]
mov byte [eax + 0x70], 1
mov eax, dword [0xa347c4]
jmp 0x496fdd
mov eax, dword [ebp + 0xc]
and eax, 1
test eax, eax
je 0x49674c
mov eax, dword [0xa347c8]
mov byte [eax + 9], 1
mov eax, dword [ebp + 0xc]
and eax, 2
test eax, eax
je 0x49675f
mov eax, dword [0xa347c8]
mov byte [eax + 0xa], 1
mov eax, dword [ebp + 0x10]
and eax, 1
test eax, eax
je 0x496772
mov eax, dword [0xa347c8]
mov byte [eax + 0xb], 1
mov eax, dword [ebp + 0x10]
and eax, 2
test eax, eax
je 0x496785
mov eax, dword [0xa347c8]
mov byte [eax + 0xc], 1
mov eax, dword [0xa347c8]
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0
mov edx, dword [0xa347c8]
mov eax, dword [0xa347c0]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00495781
mov dword [0xa347cc], eax
mov eax, dword [0xa347cc]
test eax, eax
setne al
test al, al
je 0x4967e3
mov eax, dword [0xa347cc]
cmp eax, 0xffffffff
jne 0x4967e3
mov eax, dword [0xa347c4]
mov dword [esp], eax
call fcn.0049545c
mov eax, 0xfffffff5
jmp 0x496fdd
mov eax, dword [0x6aadd8]
mov edx, dword [0xa347c4]
shl edx, 2
add eax, edx
mov dword [0xa347d0], eax
mov dword [0xa347cc], 0
mov eax, dword [ebp + 0xc]
and eax, 1
test eax, eax
je 0x49681b
mov eax, dword [0xa347cc]
or eax, 0x80000000
mov dword [0xa347cc], eax
mov eax, dword [ebp + 0xc]
and eax, 2
test eax, eax
je 0x496834
mov eax, dword [0xa347cc]
or eax, 0x40000000
mov dword [0xa347cc], eax
mov dword [0xa347d4], 3
mov eax, dword [ebp + 0x10]
and eax, 1
test eax, eax
je 0x496855
mov eax, dword [0xa347d4]
xor eax, 1
mov dword [0xa347d4], eax
mov eax, dword [ebp + 0x10]
and eax, 2
test eax, eax
je 0x49686c
mov eax, dword [0xa347d4]
xor eax, 2
mov dword [0xa347d4], eax
mov eax, dword [0xa347c8]
movzx eax, byte [eax + 0x50]
test al, al
je 0x496cab
mov eax, dword [0xa347d8]
test eax, eax
jne 0x49689f
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.00462cfe
mov dword [0xa347d8], eax
mov eax, dword [0xa347c8]
movzx eax, byte [eax + 0x50]
movzx eax, al
mov dword [esp], eax
call fcn.00465320
mov ebx, eax
mov dword [esp], 0x555639
call fcn.00462aea
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.00463629
mov edx, eax
mov eax, dword [0xa347d8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00462e65
mov dword [esp + 4], 2
mov dword [esp], 0x55563c
call fcn.00462b7b
mov edx, eax
mov eax, dword [0xa347d8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00463629
mov edx, eax
mov eax, dword [0xa347d8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00462e65
mov eax, dword [0xa347d8]
mov eax, dword [eax]
add eax, 2
mov byte [eax], 0x4d
mov ebx, dword [0xa347d0]
mov eax, dword [0xa347cc]
mov edx, eax
mov eax, dword [0xa347d8]
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 [0xa347d0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x496999
mov eax, dword [0xa347c4]
mov dword [esp], eax
call fcn.0049545c
mov eax, 0xfffffff8
jmp 0x496fdd
mov dword [esp + 8], 0x1c
mov dword [esp + 4], 0
mov dword [esp], 0xa347dc
call sub.msvcrt.dll_memset
mov dword [0xa347dc], 0x1c
mov eax, dword [0xa347d0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa347dc
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 0x496a0f
mov eax, dword [0xa347d0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa347c4]
mov dword [esp], eax
call fcn.0049545c
mov eax, 0xfffffff8
jmp 0x496fdd
mov dword [esp + 8], 0x14
mov dword [esp + 4], 0
mov dword [esp], 0xa347f8
call sub.msvcrt.dll_memset
mov eax, dword [0xa347c8]
mov eax, dword [eax + 0x54]
mov dword [0xa347e0], eax
mov eax, dword [0xa347c8]
movzx eax, byte [eax + 0x5a]
movsx eax, al
mov dword [0xa347cc], eax
mov eax, dword [0xa347cc]
cmp eax, 0xa
jne 0x496a5d
mov dword [0xa347d4], 0
mov eax, dword [0xa347cc]
cmp eax, 0xf
jne 0x496a71
mov dword [0xa347d4], 1
mov eax, dword [0xa347cc]
cmp eax, 0x14
jne 0x496a85
mov dword [0xa347d4], 2
mov eax, dword [0xa347d4]
mov byte [0xa347f0], al
mov eax, dword [0xa347c8]
movzx eax, byte [eax + 0x59]
mov byte [0xa347ee], al
mov eax, dword [0xa347c8]
movzx eax, byte [eax + 0x58]
movsx eax, al
mov dword [0xa347cc], eax
mov eax, dword [0xa347cc]
test eax, eax
jne 0x496ac1
mov dword [0xa347d4], 0
mov eax, dword [0xa347cc]
cmp eax, 1
jne 0x496ad5
mov dword [0xa347d4], 2
mov eax, dword [0xa347cc]
cmp eax, 2
jne 0x496ae9
mov dword [0xa347d4], 1
mov eax, dword [0xa347cc]
cmp eax, 3
jne 0x496afd
mov dword [0xa347d4], 4
mov eax, dword [0xa347cc]
cmp eax, 4
jne 0x496b11
mov dword [0xa347d4], 3
mov eax, dword [0xa347d4]
mov byte [0xa347ef], al
mov eax, dword [0xa347d4]
test eax, eax
jne 0x496b35
movzx eax, byte [0xa347e4]
and eax, 0xfffffffd
mov byte [0xa347e4], al
jmp 0x496b44
movzx eax, byte [0xa347e4]
or eax, 2
mov byte [0xa347e4], al
mov eax, dword [0xa347c8]
movzx eax, byte [eax + 0x5d]
test al, al
je 0x496b60
movzx eax, byte [0xa347e5]
and eax, 0xffffffcf
mov byte [0xa347e5], al
mov eax, dword [0xa347c8]
movzx eax, byte [eax + 0x5b]
test al, al
jne 0x496b7e
movzx eax, byte [0xa347e4]
or eax, 1
mov byte [0xa347e4], al
jmp 0x496b8d
movzx eax, byte [0xa347e4]
and eax, 0xfffffffe
mov byte [0xa347e4], al
mov byte [0xa347f4], 0x1a
mov eax, dword [0xa347d0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa347dc
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 0x496be4
mov eax, dword [0xa347d0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa347c4]
mov dword [esp], eax
call fcn.0049545c
mov eax, 0xfffffff8
jmp 0x496fdd
mov eax, dword [0xa347c8]
mov eax, dword [eax + 0x68]
test eax, eax
jne 0x496c10
mov dword [0xa347f8], 0xffffffff
mov dword [0xa347fc], 0
mov dword [0xa34800], 0
jmp 0x496c31
mov dword [0xa347f8], 0
mov dword [0xa347fc], 0
mov eax, dword [0xa347c8]
mov eax, dword [eax + 0x68]
mov dword [0xa34800], eax
mov dword [0xa34804], 0
mov eax, dword [0xa347c8]
mov eax, dword [eax + 0x64]
mov dword [0xa34808], eax
mov eax, dword [0xa347d0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa347f8
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 0x496c98
mov eax, dword [0xa347d0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa347c4]
mov dword [esp], eax
call fcn.0049545c
mov eax, 0xfffffff8
jmp 0x496fdd
mov eax, dword [0xa347c8]
mov byte [eax + 8], 1
mov eax, dword [0xa347c4]
jmp 0x496fdd
mov dword [0xa3480c], 3
cmp dword [ebp + 0x14], 0
je 0x496cc5
mov dword [0xa3480c], 4
mov ebx, dword [0xa347d0]
mov eax, dword [0xa3480c]
mov dword [ebp - 0x2c], eax
mov eax, dword [0xa347d4]
mov edi, eax
mov eax, dword [0xa347cc]
mov esi, eax
mov eax, dword [0xa347c0]
mov dword [esp], eax
call fcn.00457ab3
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 [0xa347d0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x496e4d
cmp dword [ebp + 0x14], 3
jne 0x496d5f
mov dword [0xa347cc], 0x80000000
mov eax, dword [0xa347c8]
mov byte [eax + 9], 1
mov eax, dword [0xa347c8]
mov byte [eax + 0xa], 0
add dword [ebp + 0x14], 1
jmp 0x496cc5
cmp dword [ebp + 0x14], 4
jne 0x496d8a
mov dword [0xa347cc], 0x40000000
mov eax, dword [0xa347c8]
mov byte [eax + 9], 0
mov eax, dword [0xa347c8]
mov byte [eax + 0xa], 1
add dword [ebp + 0x14], 1
jmp 0x496cc5
mov eax, dword [0xa347c4]
mov dword [esp], eax
call fcn.0049545c
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [0xa34810], eax
mov eax, dword [0xa34810]
cmp eax, 3
jne 0x496db7
mov eax, 0xfffffffa
jmp 0x496fdd
mov eax, dword [0xa34810]
cmp eax, 4
je 0x496dd5
mov eax, dword [0xa34810]
cmp eax, 0x1d
je 0x496dd5
mov eax, dword [0xa34810]
cmp eax, 0x1e
jne 0x496ddf
mov eax, 0xfffffff7
jmp 0x496fdd
mov eax, dword [0xa34810]
cmp eax, 5
je 0x496e07
mov eax, dword [0xa34810]
cmp eax, 0x13
je 0x496e07
mov eax, dword [0xa34810]
cmp eax, 0x21
je 0x496e07
mov eax, dword [0xa34810]
cmp eax, 0x20
jne 0x496e11
mov eax, 0xfffffff9
jmp 0x496fdd
mov eax, dword [0xa34810]
cmp eax, 0xf
je 0x496e25
mov eax, dword [0xa34810]
cmp eax, 0x15
jne 0x496e2f
mov eax, 0xfffffff8
jmp 0x496fdd
mov eax, dword [0xa34810]
cmp eax, 2
jne 0x496e43
mov eax, 0xfffffffb
jmp 0x496fdd
mov eax, 0xfffffffb
jmp 0x496fdd
cmp dword [ebp + 0x14], 2
jne 0x496fcf
mov eax, dword [0xa347d0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa34814
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileSize]
call eax
sub esp, 8
mov dword [0xa34818], eax
mov eax, dword [0xa34818]
test eax, eax
jne 0x496e8e
mov eax, dword [0xa34814]
test eax, eax
je 0x496fcf
mov eax, dword [0xa347d0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov dword [0xa3480c], 5
mov ebx, dword [0xa347d0]
mov eax, dword [0xa3480c]
mov dword [ebp - 0x30], eax
mov eax, dword [0xa347d4]
mov edi, eax
mov eax, dword [0xa347cc]
mov esi, eax
mov eax, dword [0xa347c0]
mov dword [esp], eax
call fcn.00457ab3
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 [0xa347d0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x496fcf
mov eax, dword [0xa347c4]
mov dword [esp], eax
call fcn.0049545c
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [0xa34810], eax
mov eax, dword [0xa34810]
cmp eax, 3
jne 0x496f48
mov eax, 0xfffffffa
jmp 0x496fdd
mov eax, dword [0xa34810]
cmp eax, 4
je 0x496f66
mov eax, dword [0xa34810]
cmp eax, 0x1d
je 0x496f66
mov eax, dword [0xa34810]
cmp eax, 0x1e
jne 0x496f6d
mov eax, 0xfffffff7
jmp 0x496fdd
mov eax, dword [0xa34810]
cmp eax, 5
je 0x496f95
mov eax, dword [0xa34810]
cmp eax, 0x13
je 0x496f95
mov eax, dword [0xa34810]
cmp eax, 0x21
je 0x496f95
mov eax, dword [0xa34810]
cmp eax, 0x20
jne 0x496f9c
mov eax, 0xfffffff9
jmp 0x496fdd
mov eax, dword [0xa34810]
cmp eax, 0xf
je 0x496fb0
mov eax, dword [0xa34810]
cmp eax, 0x15
jne 0x496fb7
mov eax, 0xfffffff8
jmp 0x496fdd
mov eax, dword [0xa34810]
cmp eax, 2
jne 0x496fc8
mov eax, 0xfffffffb
jmp 0x496fdd
mov eax, 0xfffffffb
jmp 0x496fdd
mov eax, dword [0xa347c8]
mov byte [eax + 8], 1
mov eax, dword [0xa347c4]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret