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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x124
mov eax, dword [0x10b806c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
xor ebx, ebx
mov dword [ebp - 0x118], eax
xor esi, esi
mov eax, dword [ebp + 0xc]
push eax
mov dword [ebp - 0x108], eax
mov dword [ebp - 0x10c], edi
call fcn.01013310
add esp, 4
mov dword [ebp - 0x11c], eax
test eax, eax
jne 0x1039210
push 0x100
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.01013cc0
push eax
push dword [ebp - 0x108]
push str.schannel:_invalid_path_name_for_CA_file__s:__s
push edi
call fcn.01003c90
push esi
call dword [0x10b809c]
add esp, 0x20
lea eax, [ebx + 0x4d]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00feec0c
mov esp, ebp
pop ebp
ret
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x114], eax
cmp eax, 0xffffffff
jne 0x1039273
push 0x100
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.01013cc0
push eax
push dword [ebp - 0x108]
push str.schannel:_failed_to_open_CA_file__s:__s
push edi
call fcn.01003c90
push 0
mov esi, 0x4d
call dword [0x10b809c]
add esp, 0x20
jmp 0x1039389
lea ecx, [ebp - 0x124]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x10392bc
push 0x100
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.01013cc0
push eax
push dword [ebp - 0x108]
push str.schannel:_failed_to_determine_size_of_CA_file__s:__s
push edi
call fcn.01003c90
add esp, 0x1c
mov esi, 0x4d
jmp 0x1039373
mov edi, dword [ebp - 0x124]
cmp dword [ebp - 0x120], ebx
jl 0x10392f6
jg 0x10392d4
cmp edi, 0x100000
jbe 0x10392f6
push 0x100000
push str.schannel:_CA_file_exceeds_max_size_of__u_bytes
push dword [ebp - 0x10c]
call fcn.01003c90
add esp, 0xc
mov esi, 0x4d
jmp 0x1039373
lea eax, [edi + 1]
push eax
call dword [0x10b8098]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x103930e
lea esi, [eax + 0x1b]
jmp 0x1039373
test edi, edi
je 0x1039351
lfence
push 0
lea eax, [ebp - 0x110]
mov dword [ebp - 0x110], 0
push eax
mov eax, edi
sub eax, esi
push eax
lea eax, [esi + ebx]
push eax
push dword [ebp - 0x114]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10393ae
mov eax, dword [ebp - 0x110]
test eax, eax
je 0x10393aa
add esi, eax
cmp esi, edi
jb 0x1039315
push dword [ebp - 0x10c]
mov byte [edi + ebx], 0
push dword [ebp - 0x108]
push edi
push ebx
push dword [ebp - 0x118]
call fcn.01038ef0
add esp, 0x14
mov esi, eax
push dword [ebp - 0x114]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [0x10b809c]
add esp, 4
push dword [ebp - 0x11c]
call fcn.01043d14
mov ecx, dword [ebp - 4]
add esp, 4
mov eax, esi
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.00feec0c
mov esp, ebp
pop ebp
ret
mov edi, esi
jmp 0x1039351
push 0x100
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.01013cc0
push eax
push dword [ebp - 0x108]
push str.schannel:_failed_to_read_from_CA_file__s:__s
push dword [ebp - 0x10c]
call fcn.01003c90
add esp, 0x1c
mov esi, 0x4d
jmp 0x1039373