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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x278
lea eax, [ebp - 0x16c]
push ebx
push esi
push edi
push 0x104
push eax
push 0
mov edi, ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x1002106a
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x274]
push eax
push 0x104
lea eax, [ebp - 0x16c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
je 0x1002106a
mov eax, dword [ebp - 8]
mov ecx, dword [str.fpga_debug.rbf]
push 0
push 0x80
mov dword [eax], ecx
mov eax, dword [ebp - 8]
mov ecx, dword [0x100b77f4]
push 3
push 0
mov dword [eax + 4], ecx
mov eax, dword [ebp - 8]
mov ecx, dword [0x100b77f8]
push 1
push connect
mov dword [eax + 8], ecx
mov eax, dword [ebp - 8]
mov cx, word [0x100b77fc]
mov word [eax + 0xc], cx
mov eax, dword [ebp - 8]
mov cl, byte [0x100b77fe]
mov byte [eax + 0xe], cl
lea eax, [ebp - 0x274]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x1002106a
lea eax, [ebp - 0x10]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x14], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
mov eax, dword [ebp + 8]
mov dword [eax], ecx
mov eax, dword [ebp - 0x14]
cmp eax, 0xffffffff
jne 0x10020e71
test ecx, ecx
jne 0x10021063
cmp dword [ebp - 0x10], 0
ja 0x10021063
cmp eax, 0xf42400
ja 0x10021063
push eax
call fcn.1009c863
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x10021063
push 0
lea eax, [ebp - 0x60]
push eax
push dword [ebp - 0x14]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10021063
lea eax, [ebp - 0x1c]
push eax
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi + 0x354]
mov eax, dword [ecx]
call dword [eax + 0x1d8]
mov ecx, dword [edi + 0x354]
mov eax, dword [ecx]
call dword [eax + 0x1d0]
sub eax, 0
je 0x10020f10
sub eax, 2
jne 0x10020f55
mov ecx, dword [edi + 0x354]
mov eax, dword [ecx]
call dword [eax + 0x1dc]
push ebx
call fcn.1009c348
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov cl, 1
call fcn.10020d20
mov ecx, dword [edi + 0x354]
test al, al
mov eax, dword [ecx]
jne 0x10020f4d
push 2
call dword [eax + 0x1d4]
mov ecx, dword [edi + 0x354]
mov eax, dword [ecx]
call dword [eax + 0x1dc]
push ebx
call fcn.1009c348
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 1
call dword [eax + 0x1d4]
mov ecx, dword [edi + 0x354]
mov eax, dword [ecx]
call dword [eax + 0x1dc]
mov edx, dword [ebp - 0x14]
cmp edx, 0x27ac40
jae 0x10020fd0
mov eax, dword [ebx + 4]
lea ecx, [ebx + 8]
mov esi, dword [ebx]
add edx, 0xfffffff8
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x24]
push eax
call fcn.1008d330
mov ecx, dword [ebp + 8]
add esp, 8
mov dword [ecx], eax
test eax, eax
jne 0x1002104f
push dword [ebp - 0x28]
mov eax, dword [edi]
mov ecx, edi
push esi
push dword [ebp - 0x20]
mov esi, dword [ebp - 0x24]
push esi
call dword [eax + 0x108]
mov ecx, dword [ebp + 8]
push esi
mov dword [ecx], eax
call fcn.1009c348
add esp, 4
push ebx
call fcn.1009c348
add esp, 4
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea eax, [ebp - 0x1c]
push eax
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToLocalFileTime]
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
movzx eax, word [ebp - 0x38]
sub eax, 0x76c
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x48], eax
movzx eax, word [ebp - 0x36]
dec eax
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x4c], eax
movzx eax, word [ebp - 0x32]
mov dword [ebp - 0x50], eax
movzx eax, word [ebp - 0x30]
mov dword [ebp - 0x54], eax
movzx eax, word [ebp - 0x2e]
mov dword [ebp - 0x58], eax
movzx eax, word [ebp - 0x2c]
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 0x5c]
push eax
mov dword [ebp - 0x3c], 0xffffffff
call fcn.1009d5c5
mov esi, dword [edi]
add esp, 4
mov ecx, edi
push edx
push eax
push dword [ebp - 0x14]
push ebx
call dword [esi + 0x108]
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
push ebx
call fcn.1009c348
add esp, 4
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4