Function at 0x4af5d1
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [0xa4ecc0]
test eax, eax
jne 0x4af5fc
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.0047bcbe
mov dword [0xa4ecc0], eax
mov dword [esp + 4], 1
mov dword [esp], 0x56e967
call fcn.0047bb3b
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.0047c5e9
mov edx, eax
mov eax, dword [0xa4ecc0]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0047be25
call fcn.004ae11d
mov dword [0xa4ecc4], eax
mov edx, dword [0x6c52dc]
mov eax, dword [0xa4ecc4]
shl eax, 3
mov ecx, eax
shl ecx, 4
mov ebx, ecx
sub ebx, eax
mov eax, ebx
add eax, edx
mov dword [0xa4ecc8], 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 0x4af67c
cmp dword [ebp - 0x20], 0x73
jne 0x4af6f9
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 0x4af698
cmp dword [ebp - 0x20], 0x63
jne 0x4af6f9
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 0x4af6b4
cmp dword [ebp - 0x20], 0x72
jne 0x4af6f9
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 0x4af6d0
cmp dword [ebp - 0x20], 0x6e
jne 0x4af6f9
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 0x4af6f9
mov eax, dword [0xa4ecc8]
mov byte [eax + 0x70], 1
mov eax, dword [0xa4ecc4]
jmp 0x4aff9d
mov eax, dword [ebp + 0xc]
and eax, 1
test eax, eax
je 0x4af70c
mov eax, dword [0xa4ecc8]
mov byte [eax + 9], 1
mov eax, dword [ebp + 0xc]
and eax, 2
test eax, eax
je 0x4af71f
mov eax, dword [0xa4ecc8]
mov byte [eax + 0xa], 1
mov eax, dword [ebp + 0x10]
and eax, 1
test eax, eax
je 0x4af732
mov eax, dword [0xa4ecc8]
mov byte [eax + 0xb], 1
mov eax, dword [ebp + 0x10]
and eax, 2
test eax, eax
je 0x4af745
mov eax, dword [0xa4ecc8]
mov byte [eax + 0xc], 1
mov eax, dword [0xa4ecc8]
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0
mov edx, dword [0xa4ecc8]
mov eax, dword [0xa4ecc0]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.004ae741
mov dword [0xa4eccc], eax
mov eax, dword [0xa4eccc]
test eax, eax
setne al
test al, al
je 0x4af7a3
mov eax, dword [0xa4eccc]
cmp eax, 0xffffffff
jne 0x4af7a3
mov eax, dword [0xa4ecc4]
mov dword [esp], eax
call fcn.004ae41c
mov eax, 0xfffffff5
jmp 0x4aff9d
mov eax, dword [0x6c52d8]
mov edx, dword [0xa4ecc4]
shl edx, 2
add eax, edx
mov dword [0xa4ecd0], eax
mov dword [0xa4eccc], 0
mov eax, dword [ebp + 0xc]
and eax, 1
test eax, eax
je 0x4af7db
mov eax, dword [0xa4eccc]
or eax, 0x80000000
mov dword [0xa4eccc], eax
mov eax, dword [ebp + 0xc]
and eax, 2
test eax, eax
je 0x4af7f4
mov eax, dword [0xa4eccc]
or eax, 0x40000000
mov dword [0xa4eccc], eax
mov dword [0xa4ecd4], 3
mov eax, dword [ebp + 0x10]
and eax, 1
test eax, eax
je 0x4af815
mov eax, dword [0xa4ecd4]
xor eax, 1
mov dword [0xa4ecd4], eax
mov eax, dword [ebp + 0x10]
and eax, 2
test eax, eax
je 0x4af82c
mov eax, dword [0xa4ecd4]
xor eax, 2
mov dword [0xa4ecd4], eax
mov eax, dword [0xa4ecc8]
movzx eax, byte [eax + 0x50]
test al, al
je 0x4afc6b
mov eax, dword [0xa4ecd8]
test eax, eax
jne 0x4af85f
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.0047bcbe
mov dword [0xa4ecd8], eax
mov eax, dword [0xa4ecc8]
movzx eax, byte [eax + 0x50]
movzx eax, al
mov dword [esp], eax
call fcn.0047e2e0
mov ebx, eax
mov dword [esp], 0x56ee79
call fcn.0047baaa
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.0047c5e9
mov edx, eax
mov eax, dword [0xa4ecd8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0047be25
mov dword [esp + 4], 2
mov dword [esp], 0x56ee7c
call fcn.0047bb3b
mov edx, eax
mov eax, dword [0xa4ecd8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0047c5e9
mov edx, eax
mov eax, dword [0xa4ecd8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0047be25
mov eax, dword [0xa4ecd8]
mov eax, dword [eax]
add eax, 2
mov byte [eax], 0x4d
mov ebx, dword [0xa4ecd0]
mov eax, dword [0xa4eccc]
mov edx, eax
mov eax, dword [0xa4ecd8]
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 [0xa4ecd0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x4af959
mov eax, dword [0xa4ecc4]
mov dword [esp], eax
call fcn.004ae41c
mov eax, 0xfffffff8
jmp 0x4aff9d
mov dword [esp + 8], 0x1c
mov dword [esp + 4], 0
mov dword [esp], 0xa4ecdc
call sub.msvcrt.dll_memset
mov dword [0xa4ecdc], 0x1c
mov eax, dword [0xa4ecd0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa4ecdc
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 0x4af9cf
mov eax, dword [0xa4ecd0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa4ecc4]
mov dword [esp], eax
call fcn.004ae41c
mov eax, 0xfffffff8
jmp 0x4aff9d
mov dword [esp + 8], 0x14
mov dword [esp + 4], 0
mov dword [esp], 0xa4ecf8
call sub.msvcrt.dll_memset
mov eax, dword [0xa4ecc8]
mov eax, dword [eax + 0x54]
mov dword [0xa4ece0], eax
mov eax, dword [0xa4ecc8]
movzx eax, byte [eax + 0x5a]
movsx eax, al
mov dword [0xa4eccc], eax
mov eax, dword [0xa4eccc]
cmp eax, 0xa
jne 0x4afa1d
mov dword [0xa4ecd4], 0
mov eax, dword [0xa4eccc]
cmp eax, 0xf
jne 0x4afa31
mov dword [0xa4ecd4], 1
mov eax, dword [0xa4eccc]
cmp eax, 0x14
jne 0x4afa45
mov dword [0xa4ecd4], 2
mov eax, dword [0xa4ecd4]
mov byte [0xa4ecf0], al
mov eax, dword [0xa4ecc8]
movzx eax, byte [eax + 0x59]
mov byte [0xa4ecee], al
mov eax, dword [0xa4ecc8]
movzx eax, byte [eax + 0x58]
movsx eax, al
mov dword [0xa4eccc], eax
mov eax, dword [0xa4eccc]
test eax, eax
jne 0x4afa81
mov dword [0xa4ecd4], 0
mov eax, dword [0xa4eccc]
cmp eax, 1
jne 0x4afa95
mov dword [0xa4ecd4], 2
mov eax, dword [0xa4eccc]
cmp eax, 2
jne 0x4afaa9
mov dword [0xa4ecd4], 1
mov eax, dword [0xa4eccc]
cmp eax, 3
jne 0x4afabd
mov dword [0xa4ecd4], 4
mov eax, dword [0xa4eccc]
cmp eax, 4
jne 0x4afad1
mov dword [0xa4ecd4], 3
mov eax, dword [0xa4ecd4]
mov byte [0xa4ecef], al
mov eax, dword [0xa4ecd4]
test eax, eax
jne 0x4afaf5
movzx eax, byte [0xa4ece4]
and eax, 0xfffffffd
mov byte [0xa4ece4], al
jmp 0x4afb04
movzx eax, byte [0xa4ece4]
or eax, 2
mov byte [0xa4ece4], al
mov eax, dword [0xa4ecc8]
movzx eax, byte [eax + 0x5d]
test al, al
je 0x4afb20
movzx eax, byte [0xa4ece5]
and eax, 0xffffffcf
mov byte [0xa4ece5], al
mov eax, dword [0xa4ecc8]
movzx eax, byte [eax + 0x5b]
test al, al
jne 0x4afb3e
movzx eax, byte [0xa4ece4]
or eax, 1
mov byte [0xa4ece4], al
jmp 0x4afb4d
movzx eax, byte [0xa4ece4]
and eax, 0xfffffffe
mov byte [0xa4ece4], al
mov byte [0xa4ecf4], 0x1a
mov eax, dword [0xa4ecd0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa4ecdc
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 0x4afba4
mov eax, dword [0xa4ecd0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa4ecc4]
mov dword [esp], eax
call fcn.004ae41c
mov eax, 0xfffffff8
jmp 0x4aff9d
mov eax, dword [0xa4ecc8]
mov eax, dword [eax + 0x68]
test eax, eax
jne 0x4afbd0
mov dword [0xa4ecf8], 0xffffffff
mov dword [0xa4ecfc], 0
mov dword [0xa4ed00], 0
jmp 0x4afbf1
mov dword [0xa4ecf8], 0
mov dword [0xa4ecfc], 0
mov eax, dword [0xa4ecc8]
mov eax, dword [eax + 0x68]
mov dword [0xa4ed00], eax
mov dword [0xa4ed04], 0
mov eax, dword [0xa4ecc8]
mov eax, dword [eax + 0x64]
mov dword [0xa4ed08], eax
mov eax, dword [0xa4ecd0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa4ecf8
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 0x4afc58
mov eax, dword [0xa4ecd0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [0xa4ecc4]
mov dword [esp], eax
call fcn.004ae41c
mov eax, 0xfffffff8
jmp 0x4aff9d
mov eax, dword [0xa4ecc8]
mov byte [eax + 8], 1
mov eax, dword [0xa4ecc4]
jmp 0x4aff9d
mov dword [0xa4ed0c], 3
cmp dword [ebp + 0x14], 0
je 0x4afc85
mov dword [0xa4ed0c], 4
mov ebx, dword [0xa4ecd0]
mov eax, dword [0xa4ed0c]
mov dword [ebp - 0x2c], eax
mov eax, dword [0xa4ecd4]
mov edi, eax
mov eax, dword [0xa4eccc]
mov esi, eax
mov eax, dword [0xa4ecc0]
mov dword [esp], eax
call fcn.00470a73
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 [0xa4ecd0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x4afe0d
cmp dword [ebp + 0x14], 3
jne 0x4afd1f
mov dword [0xa4eccc], 0x80000000
mov eax, dword [0xa4ecc8]
mov byte [eax + 9], 1
mov eax, dword [0xa4ecc8]
mov byte [eax + 0xa], 0
add dword [ebp + 0x14], 1
jmp 0x4afc85
cmp dword [ebp + 0x14], 4
jne 0x4afd4a
mov dword [0xa4eccc], 0x40000000
mov eax, dword [0xa4ecc8]
mov byte [eax + 9], 0
mov eax, dword [0xa4ecc8]
mov byte [eax + 0xa], 1
add dword [ebp + 0x14], 1
jmp 0x4afc85
mov eax, dword [0xa4ecc4]
mov dword [esp], eax
call fcn.004ae41c
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [0xa4ed10], eax
mov eax, dword [0xa4ed10]
cmp eax, 3
jne 0x4afd77
mov eax, 0xfffffffa
jmp 0x4aff9d
mov eax, dword [0xa4ed10]
cmp eax, 4
je 0x4afd95
mov eax, dword [0xa4ed10]
cmp eax, 0x1d
je 0x4afd95
mov eax, dword [0xa4ed10]
cmp eax, 0x1e
jne 0x4afd9f
mov eax, 0xfffffff7
jmp 0x4aff9d
mov eax, dword [0xa4ed10]
cmp eax, 5
je 0x4afdc7
mov eax, dword [0xa4ed10]
cmp eax, 0x13
je 0x4afdc7
mov eax, dword [0xa4ed10]
cmp eax, 0x21
je 0x4afdc7
mov eax, dword [0xa4ed10]
cmp eax, 0x20
jne 0x4afdd1
mov eax, 0xfffffff9
jmp 0x4aff9d
mov eax, dword [0xa4ed10]
cmp eax, 0xf
je 0x4afde5
mov eax, dword [0xa4ed10]
cmp eax, 0x15
jne 0x4afdef
mov eax, 0xfffffff8
jmp 0x4aff9d
mov eax, dword [0xa4ed10]
cmp eax, 2
jne 0x4afe03
mov eax, 0xfffffffb
jmp 0x4aff9d
mov eax, 0xfffffffb
jmp 0x4aff9d
cmp dword [ebp + 0x14], 2
jne 0x4aff8f
mov eax, dword [0xa4ecd0]
mov eax, dword [eax]
mov dword [esp + 4], 0xa4ed14
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileSize]
call eax
sub esp, 8
mov dword [0xa4ed18], eax
mov eax, dword [0xa4ed18]
test eax, eax
jne 0x4afe4e
mov eax, dword [0xa4ed14]
test eax, eax
je 0x4aff8f
mov eax, dword [0xa4ecd0]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov dword [0xa4ed0c], 5
mov ebx, dword [0xa4ecd0]
mov eax, dword [0xa4ed0c]
mov dword [ebp - 0x30], eax
mov eax, dword [0xa4ecd4]
mov edi, eax
mov eax, dword [0xa4eccc]
mov esi, eax
mov eax, dword [0xa4ecc0]
mov dword [esp], eax
call fcn.00470a73
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 [0xa4ecd0]
mov eax, dword [eax]
cmp eax, 0xffffffff
jne 0x4aff8f
mov eax, dword [0xa4ecc4]
mov dword [esp], eax
call fcn.004ae41c
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [0xa4ed10], eax
mov eax, dword [0xa4ed10]
cmp eax, 3
jne 0x4aff08
mov eax, 0xfffffffa
jmp 0x4aff9d
mov eax, dword [0xa4ed10]
cmp eax, 4
je 0x4aff26
mov eax, dword [0xa4ed10]
cmp eax, 0x1d
je 0x4aff26
mov eax, dword [0xa4ed10]
cmp eax, 0x1e
jne 0x4aff2d
mov eax, 0xfffffff7
jmp 0x4aff9d
mov eax, dword [0xa4ed10]
cmp eax, 5
je 0x4aff55
mov eax, dword [0xa4ed10]
cmp eax, 0x13
je 0x4aff55
mov eax, dword [0xa4ed10]
cmp eax, 0x21
je 0x4aff55
mov eax, dword [0xa4ed10]
cmp eax, 0x20
jne 0x4aff5c
mov eax, 0xfffffff9
jmp 0x4aff9d
mov eax, dword [0xa4ed10]
cmp eax, 0xf
je 0x4aff70
mov eax, dword [0xa4ed10]
cmp eax, 0x15
jne 0x4aff77
mov eax, 0xfffffff8
jmp 0x4aff9d
mov eax, dword [0xa4ed10]
cmp eax, 2
jne 0x4aff88
mov eax, 0xfffffffb
jmp 0x4aff9d
mov eax, 0xfffffffb
jmp 0x4aff9d
mov eax, dword [0xa4ecc8]
mov byte [eax + 8], 1
mov eax, dword [0xa4ecc4]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret