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

Disassembly:
sub esp, 0x30
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x48]
test edi, edi
jne 0x10051fb9
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret
push edi
call fcn.10054920
add esp, 4
test eax, eax
jne 0x10051fce
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
mov eax, dword [edi]
mov dword [esp + 0x48], 0
cmp eax, 1
jne 0x100521fe
mov edi, dword [edi + 4]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push 0
push 0
push edi
call ebx
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x10], esi
jne 0x10052010
push 2
push 0
push 0
push edi
call ebx
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
mov al, byte [esp + 0x48]
mov byte [esp + 0x30], al
sub ebp, esi
xor eax, eax
cmp ebp, eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], eax
jle 0x100521c3
mov esi, ebp
mov dword [esp + 0x20], esi
push 0x1000
call fcn.10055a9b
add esp, 4
cmp esi, 0x1000
mov dword [esp + 0x28], eax
mov ecx, esi
jl 0x10052069
mov ecx, 0x1000
lea edx, [esp + 0x18]
push 0
push edx
push ecx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1005212b
mov edx, dword [esp + 0x18]
xor ebx, ebx
xor eax, eax
test edx, edx
jbe 0x100520d5
mov esi, dword [esp + 0x28]
mov cl, byte [eax + esi]
test cl, cl
je 0x100520a9
cmp cl, 0xd
je 0x100520a9
cmp cl, 0xa
je 0x100520a9
inc eax
cmp eax, edx
jb 0x10052091
jmp 0x100520d5
mov edx, eax
mov dword [esp + 0x18], edx
mov cl, byte [eax + esi]
cmp cl, 0xd
jne 0x100520c7
cmp byte [eax + esi + 1], 0xa
jne 0x100520c7
mov eax, dword [esp + 0x10]
add eax, 2
jmp 0x100520cc
mov eax, dword [esp + 0x10]
inc eax
mov dword [esp + 0x10], eax
mov ebx, 1
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x38]
lea eax, [esp + 0x28]
add esi, edx
push eax
push 1
push ecx
lea ecx, [esp + 0x3c]
mov dword [esp + 0x38], edx
mov dword [esp + 0x20], esi
call fcn.10052500
test ebx, ebx
jne 0x10052145
cmp dword [esp + 0x18], 0x1000
jne 0x10052145
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x20]
add eax, 0x1000
sub esi, 0x1000
cmp eax, ebp
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], esi
jl 0x10052049
jmp 0x10052145
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x28]
push edx
call fcn.10055a61
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
jle 0x100521bf
inc eax
push eax
call fcn.10050210
mov ecx, dword [esp + 0x14]
add esp, 4
mov esi, eax
mov eax, dword [esp + 0x14]
push 0
add eax, ecx
push 0
push eax
push edi
mov dword [esp + 0x58], esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
cmp ebp, eax
mov ebx, esi
je 0x100521b7
mov ecx, dword [ebp + 4]
mov esi, dword [ebp]
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp]
mov edi, dword [ebp + 4]
push eax
add ebx, edi
call fcn.10055a61
mov eax, dword [esp + 0x3c]
add ebp, 8
add esp, 4
cmp ebp, eax
jne 0x10052181
mov esi, dword [esp + 0x48]
mov ecx, dword [esp + 0x14]
mov byte [ecx + esi], 0
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
cmp eax, eax
mov edx, eax
je 0x100521e1
mov esi, dword [eax]
add eax, 8
mov dword [ecx], esi
mov esi, dword [eax - 4]
mov dword [ecx + 4], esi
add ecx, 8
cmp eax, edx
jne 0x100521cd
mov edx, dword [esp + 0x34]
mov dword [esp + 0x38], ecx
push edx
call fcn.10066a25
mov eax, dword [esp + 0x4c]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
cmp eax, 2
jne 0x1005229c
mov esi, dword [edi + 4]
mov ecx, esi
mov eax, dword [esi]
call dword [eax + 0x14]
mov edx, dword [esi]
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x24]
lea ecx, [esp + 0x20]
push eax
push ecx
push 0xffffffffffffffff
push 0
mov ecx, esi
call dword [edx + 0x30]
mov ebp, dword [esp + 0x20]
xor edi, edi
test eax, eax
jle 0x10052247
mov cl, byte [ebp]
cmp cl, 0xd
je 0x10052247
cmp cl, 0xa
je 0x10052247
inc edi
inc ebp
cmp edi, eax
jl 0x10052234
lea edx, [edi + 1]
push edx
call fcn.10050210
mov ecx, dword [esp + 0x20]
mov ebx, eax
mov al, byte [ebp]
add esp, 4
add ecx, edi
cmp al, 0xd
mov dword [esp + 0x48], ebx
je 0x1005226a
cmp al, 0xa
jne 0x10052273
mov al, byte [ebp + 1]
inc ecx
cmp al, 0xa
jne 0x10052273
inc ecx
mov eax, dword [esi]
push 0
push ecx
mov ecx, esi
call dword [eax + 0x18]
mov ecx, dword [esp + 0x20]
push edi
push ecx
push ebx
call fcn.10055de0
mov eax, dword [esp + 0x54]
add esp, 0xc
mov byte [edi + ebx], 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
cmp eax, 3
jne 0x100524f3
mov ebp, dword [edi + 4]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push ebp
call ebx
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x14], esi
jne 0x100522d5
push 2
push 0
push 0
push ebp
call ebx
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dl, byte [esp + 0x48]
mov ecx, eax
sub ecx, esi
xor esi, esi
xor eax, eax
cmp ecx, esi
mov dword [esp + 0x24], ecx
mov byte [esp + 0x30], dl
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x20], esi
jle 0x100524c4
mov dword [esp + 0x1c], ecx
jmp 0x10052316
xor esi, esi
push 0x1000
call fcn.10055a9b
add esp, 4
mov dword [esp + 0x28], eax
push 1
push esi
push esi
push ebp
call ebx
mov esi, eax
mov eax, dword [esp + 0x1c]
cmp eax, 0x1000
jl 0x10052340
mov eax, 0x1000
mov edx, dword [esp + 0x28]
lea ecx, [esp + 0x10]
push 0
push ecx
push eax
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1005242e
mov ecx, dword [edi + 0x130]
lea eax, [edi + 0xc]
push eax
mov eax, dword [esp + 0x14]
lea edx, [edi + 0x2c]
push ecx
mov ecx, dword [esp + 0x30]
push edx
push eax
push ecx
push esi
xor ebx, ebx
call fcn.10053a30
mov edx, dword [esp + 0x28]
add esp, 0x18
xor eax, eax
test edx, edx
jbe 0x100523d2
mov esi, dword [esp + 0x28]
mov cl, byte [eax + esi]
test cl, cl
je 0x100523a6
cmp cl, 0xd
je 0x100523a6
cmp cl, 0xa
je 0x100523a6
inc eax
cmp eax, edx
jb 0x1005238e
jmp 0x100523d2
mov edx, eax
mov dword [esp + 0x10], edx
mov cl, byte [eax + esi]
cmp cl, 0xd
jne 0x100523c4
cmp byte [eax + esi + 1], 0xa
jne 0x100523c4
mov eax, dword [esp + 0x14]
add eax, 2
jmp 0x100523c9
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
mov ebx, 1
mov eax, dword [esp + 0x18]
mov dword [esp + 0x2c], edx
add eax, edx
lea edx, [esp + 0x28]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x38]
push edx
push 1
push eax
lea ecx, [esp + 0x3c]
call fcn.10052500
test ebx, ebx
jne 0x10052446
mov eax, dword [esp + 0x10]
mov ecx, 0x1000
cmp eax, ecx
jne 0x10052446
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
add eax, ecx
sub edx, ecx
mov ecx, dword [esp + 0x24]
cmp eax, ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], edx
jl 0x10052314
jmp 0x1005244c
push 2
push 0
push 0
push ebp
call ebx
mov ecx, dword [esp + 0x28]
push ecx
call fcn.10055a61
add esp, 4
jmp 0x1005244c
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [esp + 0x18]
test edi, edi
jle 0x100524c0
lea edx, [edi + 1]
push edx
call fcn.10050210
add esp, 4
mov esi, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x48], esi
push 0
add edi, eax
push 0
push edi
push ebp
call ebx
mov ebp, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
cmp ebp, eax
mov ebx, esi
je 0x100524b8
mov ecx, dword [ebp + 4]
mov esi, dword [ebp]
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp]
mov edi, dword [ebp + 4]
push eax
add ebx, edi
call fcn.10055a61
mov eax, dword [esp + 0x3c]
add ebp, 8
add esp, 4
cmp ebp, eax
jne 0x10052482
mov esi, dword [esp + 0x48]
mov ecx, dword [esp + 0x18]
mov byte [ecx + esi], 0
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
cmp eax, eax
mov edx, eax
je 0x100524e2
mov esi, dword [eax]
add eax, 8
mov dword [ecx], esi
mov esi, dword [eax - 4]
mov dword [ecx + 4], esi
add ecx, 8
cmp eax, edx
jne 0x100524ce
mov edx, dword [esp + 0x34]
mov dword [esp + 0x38], ecx
push edx
call fcn.10066a25
add esp, 4
mov eax, dword [esp + 0x48]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret