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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x45c
push esi
push edi
lea edi, [ebp - 0x45c]
mov ecx, 0x117
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
mov eax, dword [0x4b965c]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0xc], 0xffffffff
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov esi, esp
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__strdup]
add esp, 4
cmp esi, esp
call fcn.004a09b1
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x4947ef
push 0x100
lea ecx, [ebp - 0x130]
push ecx
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.004a09b1
push eax
call fcn.00409950
add esp, 0xc
push eax
mov edx, dword [ebp + 0xc]
push edx
push str.schannel:_invalid_path_name_for_CA_file__s:__s
mov eax, dword [ebp + 0x10]
push eax
call fcn.0042e770
add esp, 0x10
mov dword [ebp - 8], 0x4d
jmp 0x494a08
mov esi, esp
push 0
push 0x80
push 3
push 0
push 1
push bind
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp esi, esp
call fcn.004a09b1
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x494863
push 0x100
lea edx, [ebp - 0x238]
push edx
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.004a09b1
push eax
call fcn.00409950
add esp, 0xc
push eax
mov eax, dword [ebp + 0xc]
push eax
push str.schannel:_failed_to_open_CA_file__s:__s
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.0042e770
add esp, 0x10
mov dword [ebp - 8], 0x4d
jmp 0x494a08
mov esi, esp
lea edx, [ebp - 0x18]
push edx
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
cmp esi, esp
call fcn.004a09b1
test eax, eax
jne 0x4948c4
push 0x100
lea ecx, [ebp - 0x340]
push ecx
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.004a09b1
push eax
call fcn.00409950
add esp, 0xc
push eax
mov edx, dword [ebp + 0xc]
push edx
push str.schannel:_failed_to_determine_size_of_CA_file__s:__s
mov eax, dword [ebp + 0x10]
push eax
call fcn.0042e770
add esp, 0x10
mov dword [ebp - 8], 0x4d
jmp 0x494a08
cmp dword [ebp - 0x14], 0
jl 0x4948f7
jg 0x4948d5
cmp dword [ebp - 0x18], 0x100000
jbe 0x4948f7
push 0x100000
push str.schannel:_CA_file_exceeds_max_size_of__u_bytes
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.0042e770
add esp, 0xc
mov dword [ebp - 8], 0x4d
jmp 0x494a08
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
add eax, 1
mov esi, esp
push eax
call dword [section..data]
add esp, 4
cmp esi, esp
call fcn.004a09b1
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x49492b
mov dword [ebp - 8], 0x1b
jmp 0x494a08
mov ecx, dword [ebp - 0x2c]
cmp ecx, dword [ebp - 0x28]
jae 0x4949e0
mov edx, dword [ebp - 0x28]
sub edx, dword [ebp - 0x2c]
mov dword [ebp - 0x348], edx
mov dword [ebp - 0x350], 0
mov esi, esp
push 0
lea eax, [ebp - 0x350]
push eax
mov ecx, dword [ebp - 0x348]
push ecx
mov edx, dword [ebp - 0x20]
add edx, dword [ebp - 0x2c]
push edx
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp esi, esp
call fcn.004a09b1
test eax, eax
jne 0x4949be
push 0x100
lea ecx, [ebp - 0x458]
push ecx
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.004a09b1
push eax
call fcn.00409950
add esp, 0xc
push eax
mov edx, dword [ebp + 0xc]
push edx
push str.schannel:_failed_to_read_from_CA_file__s:__s
mov eax, dword [ebp + 0x10]
push eax
call fcn.0042e770
add esp, 0x10
mov dword [ebp - 8], 0x4d
jmp 0x494a08
cmp dword [ebp - 0x350], 0
jne 0x4949cf
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x28], ecx
jmp 0x4949db
mov edx, dword [ebp - 0x2c]
add edx, dword [ebp - 0x350]
mov dword [ebp - 0x2c], edx
jmp 0x49492b
mov eax, dword [ebp - 0x20]
add eax, dword [ebp - 0x28]
mov byte [eax], 0
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.004943d0
add esp, 0x14
mov dword [ebp - 8], eax
cmp dword [ebp - 0xc], 0xffffffff
je 0x494a21
mov esi, esp
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, esp
call fcn.004a09b1
mov esi, esp
mov ecx, dword [ebp - 0x20]
push ecx
call dword [0x4ab004]
add esp, 4
cmp esi, esp
call fcn.004a09b1
mov dword [ebp - 0x20], 0
xor edx, edx
jne 0x494a21
cmp dword [ebp - 0x24], 0
je 0x494a65
mov esi, esp
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
cmp esi, esp
call fcn.004a09b1
mov dword [ebp - 0x24], 0
xor ecx, ecx
jne 0x494a42
mov eax, dword [ebp - 8]
push edx
mov ecx, ebp
push eax
lea edx, [0x494a9c]
call fcn.004a095d
pop eax
pop edx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a039d
add esp, 0x45c
cmp ebp, esp
call fcn.004a09b1
mov esp, ebp
pop ebp
ret