Function at 0x462180
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x24
mov eax, dword [0x4db120]
push ebx
push esi
push edi
push 1
push 0
push 0xffffffffffffffff
mov dword [esp + 0x20], ecx
mov ecx, eax
push 0
mov dword [esp + 0x20], eax
call fcn.004b04f0
mov esi, dword [ebp + 8]
or eax, 0xffffffff
mov dword [esp + 0x1c], eax
mov eax, dword [0x4d70f4]
mov byte [esp + 0xe], 0
mov byte [esp + 0xd], 0
mov dword [esp + 0x20], 0xffffffff
mov ebx, dword [eax + 0xdc]
and ebx, 0x7fffffff
mov dword [esp + 0x24], ebx
nop dword [eax]
mov edi, esi
mov al, byte [edi]
cmp al, 0x20
je 0x4621ec
cmp al, 9
jne 0x4621ef
inc edi
jmp 0x4621e2
cmp al, 0x2a
jne 0x462332
mov bl, byte [edi + 1]
lea esi, [edi + 1]
movzx eax, bl
test eax, 0xffffff80
je 0x46220b
xor edx, edx
jmp 0x462219
push 2
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__isctype]
add esp, 8
mov edx, eax
mov al, bl
and al, 0xdf
test edx, edx
movzx ecx, al
movzx eax, bl
cmove ecx, eax
movsx eax, cl
add eax, 0xffffffbd
cmp eax, 0x11
ja case.0x46223e.68
movzx eax, byte [eax + 0x4627d4]
jmp dword [eax*4 + 0x4627c0]
mov byte [esp + 0xd], 1
jmp case.0x46223e.68
lea ecx, [edi + 2]
call fcn.0044f230
mov bl, byte [esi]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], edx
test bl, bl
je 0x462284
mov ecx, 0x4c98e4
mov al, 0x20
nop dword [eax]
cmp bl, al
je 0x4622b8
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x462270
mov bl, byte [esi + 1]
inc esi
test bl, bl
jne 0x462265
mov eax, dword [0x4d70f4]
mov dword [eax + 0x30], 0x57
test byte [eax + 0xe0], 1
jne 0x462314
mov ecx, dword [0x4d995c]
push 1
push 0
push 0xffffffffffffffff
push 0x4c40b0
call fcn.004b04f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
dec esi
jmp case.0x46223e.68
lea eax, [edi + 2]
push eax
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
mov dl, byte [esi]
add esp, 4
mov dword [esp + 0x24], eax
test dl, dl
je 0x462284
mov ecx, 0x4c98e4
mov al, 0x20
nop dword [eax]
cmp dl, al
je 0x4622b8
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x4622e0
mov dl, byte [esi + 1]
inc esi
test dl, dl
jne 0x4622d2
jmp 0x462284
mov byte [esp + 0xe], 1
cmp byte [esi], 0
je 0x4621e0
inc esi
cmp byte [esi], 0
je 0x4621e0
inc esi
jmp 0x4621e0
mov ecx, dword [esp + 0x14]
push 0x4c3c29
push 0
push 0x4c40b0
call fcn.0044d1f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0
push 0x8000000
push 3
push 0
push 3
push connect
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x46236d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x4d70f4]
test byte [ecx + 0xe0], 1
mov dword [ecx + 0x30], eax
jmp 0x462297
lea eax, [esp + 0x2c]
xorps xmm0, xmm0
push eax
push ebx
movq qword [esp + 0x30], xmm0
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [esp + 0x28], esi
cmp esi, 0xffffffff
jne 0x46239d
call edi
test eax, eax
jne 0x4623aa
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov eax, esi
and eax, ecx
cmp eax, 0xffffffff
jne 0x4623c6
call edi
mov ecx, dword [0x4d70f4]
push ebx
mov dword [ecx + 0x30], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4d70f4]
jmp 0x462290
mov edx, dword [esp + 0x20]
cmp ecx, edx
jb 0x4623dc
mov eax, dword [esp + 0x1c]
ja 0x4623d8
cmp esi, eax
jbe 0x4623dc
mov esi, eax
mov ecx, edx
test ecx, ecx
jne 0x4627a1
cmp esi, 0xfffffffd
ja 0x4627a1
mov eax, esi
or eax, ecx
jne 0x462425
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4d70f4]
mov dword [eax + 0x30], 0
mov ecx, dword [0x4d995c]
push 1
push 0
push 0xffffffffffffffff
push 0x4c3cb0
call fcn.004b04f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp byte [esp + 0xd], 0
je 0x4624fc
mov edi, dword [esp + 0x10]
mov al, byte [edi + 0x17]
test al, al
jne 0x462441
mov eax, dword [edi + 0xc]
mov al, byte [eax + 0x17]
cmp al, 2
je 0x4624fc
push 0
push 1
lea eax, [esi + 1]
mov byte [esp + 0x17], 1
push eax
push 0
mov ecx, edi
call fcn.004b04f0
cmp eax, 1
jne 0x46252c
push 0
push eax
mov ecx, edi
call fcn.00401640
mov edi, eax
test edi, edi
je 0x46252c
push 0
lea eax, [esp + 0x1c]
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
mov dword [esp + 0x1c], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x4d70f4]
push ebx
mov dword [ecx + 0x30], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x4626f8
cmp byte [esp + 0xd], 0
jne 0x462686
mov ecx, dword [esp + 0x18]
cmp ecx, 3
jb 0x46253e
cmp byte [edi], 0xef
jne 0x46253e
cmp byte [edi + 1], 0xbb
jne 0x46253e
cmp byte [edi + 2], 0xbf
jne 0x46253e
mov esi, dword [esp + 0x10]
lea eax, [ecx - 3]
push 0xfde9
push eax
lea eax, [edi + 3]
mov ecx, esi
push eax
call fcn.004b1070
test eax, eax
jne 0x4625d1
xor ebx, ebx
jmp 0x4625d5
lea eax, [esi + 2]
mov byte [esp + 0xf], 0
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov edi, eax
add esp, 4
test edi, edi
jne 0x46247c
mov ecx, dword [esp + 0x14]
push 0x4c3c29
push eax
push str.Out_of_memory.
call fcn.0044d670
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp ecx, 2
jb 0x46257e
cmp byte [edi], 0xff
jne 0x46257e
cmp byte [edi + 1], 0xfe
jne 0x46257e
mov dl, 1
sub esp, 0xc
lea eax, [ecx - 2]
test dl, dl
cmove eax, ecx
mov ecx, dword [esp + 0x1c]
shr eax, 1
test dl, dl
push eax
lea eax, [edi + 2]
cmove eax, edi
push eax
call fcn.004b1140
neg eax
sbb eax, eax
and eax, esi
mov esi, dword [esp + 0x10]
mov ebx, eax
jmp 0x4625d5
mov ebx, dword [esp + 0x24]
xor dl, dl
cmp ebx, 0x4b0
je 0x462550
test ebx, ebx
je 0x4625b7
call dword [sym.imp.KERNEL32.dll_GetACP]
cmp ebx, eax
je 0x4625b3
mov esi, dword [esp + 0x10]
mov ecx, esi
push ebx
push dword [esp + 0x1c]
push edi
call fcn.004b1070
test eax, eax
jne 0x4625d1
xor ebx, ebx
jmp 0x4625d5
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
mov byte [ecx + edi], 0
mov ecx, esi
push dword [esp + 0x18]
push edi
call fcn.004b0be0
mov ebx, dword [esp + 0x1c]
jmp 0x4625df
mov ebx, dword [esp + 0x1c]
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push 0
push 1
mov ecx, esi
call fcn.00401640
cmp byte [esp + 0xe], 0
mov edi, eax
je 0x462748
cmp byte [esi + 0x17], 0
jne 0x462600
mov esi, dword [esi + 0xc]
cmp byte [esi + 0x17], 1
jne 0x462618
test byte [esi + 0x15], 8
je 0x462613
mov ecx, esi
call fcn.004014a0
lea eax, [esi + 0xc]
jmp 0x46261d
mov eax, 0x4dd524
mov eax, dword [eax]
mov edx, 0x4cdda4
mov dword [esp + 0x24], eax
mov ecx, edi
lea eax, [esp + 0x24]
push eax
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
push 1
push 0x4ce2f8
call fcn.004ac590
mov eax, dword [esp + 0x28]
add esp, 0x18
cmp byte [eax + 0x17], 0
jne 0x462653
mov esi, dword [eax + 0xc]
jmp 0x462655
mov esi, eax
cmp byte [esi + 0x17], 1
jne 0x462676
test byte [esi + 0x15], 8
je 0x462668
mov ecx, esi
call fcn.004014a0
mov eax, dword [esp + 0x24]
add esi, 0xc
mov dword [esi], eax
jmp 0x462744
mov eax, dword [esp + 0x24]
mov esi, 0x4dd524
mov dword [esi], eax
jmp 0x462744
mov ecx, dword [esp + 0x10]
mov al, byte [ecx + 0x17]
test al, al
jne 0x462697
mov eax, dword [ecx + 0xc]
mov al, byte [eax + 0x17]
cmp al, 2
jne 0x4626c0
mov edx, dword [esp + 0x18]
mov ecx, edi
call fcn.004b0320
push edi
mov esi, eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
cmp esi, 1
jne 0x462770
jmp 0x462406
mov ebx, dword [esp + 0x18]
mov byte [ebx + edi], 0
cmp byte [ecx + 0x17], 0
jne 0x4626d3
mov esi, dword [ecx + 0xc]
jmp 0x4626d5
mov esi, ecx
cmp byte [esi + 0x17], 1
jne 0x4626ef
test byte [esi + 0x15], 8
je 0x4626e8
mov ecx, esi
call fcn.004014a0
add esi, 0xc
mov dword [esi], ebx
jmp 0x462740
mov esi, 0x4dd524
mov dword [esi], ebx
jmp 0x462740
mov eax, dword [esp + 0x10]
mov byte [edi], 0
cmp byte [eax + 0x17], 0
jne 0x46270a
mov esi, dword [eax + 0xc]
jmp 0x46270c
mov esi, eax
cmp byte [esi + 0x17], 1
jne 0x462724
test byte [esi + 0x15], 8
je 0x46271f
mov ecx, esi
call fcn.004014a0
add esi, 0xc
jmp 0x462729
mov esi, 0x4dd524
cmp byte [esp + 0xf], 0
mov dword [esi], 0
jne 0x462740
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp + 0x10]
cmp byte [esi + 0x17], 0
jne 0x462751
mov esi, dword [esi + 0xc]
cmp byte [esi + 0x17], 2
jne 0x46277b
cmp dword [0x4dba88], 0
je 0x46277b
push 1
mov ecx, 0x4dba7c
call fcn.00406200
test eax, eax
jne 0x46278f
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov al, byte [esi + 0x15]
and al, 0x86
cmp byte [esp + 0xd], 0
mov byte [esi + 0x15], al
je 0x46278f
or al, 1
mov byte [esi + 0x15], al
test ebx, ebx
jne 0x462406
mov eax, dword [0x4d70f4]
jmp 0x462290
mov ecx, dword [esp + 0x14]
push 0x4c3c29
push 0
push str.Out_of_memory.
call fcn.0044d670
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4