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

Disassembly:
sub esp, 0x1c
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push esi
push 0x644
push 8
mov dword [esp + 0x14], 0
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x40210c
pop esi
mov dword [0x428388], 8
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
push ebx
mov ebx, dword [esp + 0x2c]
push edi
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x402159
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
push 0
mov dword [esp + 0x1c], eax
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
or eax, edi
pop edi
pop ebx
pop esi
mov dword [0x428388], 2
pop ebp
add esp, 0x1c
ret
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
push eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
mov ebp, eax
lea eax, [esp + 0x18]
push eax
push 0x2e
lea ebx, [esi + 0x610]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4021ad
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop ebx
pop esi
mov dword [0x428388], eax
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
push 0x4212ec
push ebx
call fcn.00417ec0
add esp, 8
test eax, eax
je 0x4021d9
mov ebx, dword [esi + 0x62e]
push 0
push 0
add ebx, 0x2e
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x4021f5
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop ebx
pop esi
mov dword [0x428388], 0xd
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
mov eax, dword [esi + 0x63a]
shr eax, 8
dec eax
je 0x4024bb
dec eax
je 0x402224
push edi
mov dword [0x428388], 3
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop ebx
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
push 0
lea ecx, [esp + 0x18]
push ecx
push 8
lea edx, [esp + 0x30]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x402503
mov eax, dword [esp + 0x24]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
push 8
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [esp + 0x28]
push ecx
push 8
mov ebp, eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0
lea edx, [esp + 0x18]
push edx
mov ebx, eax
mov eax, dword [esp + 0x2c]
push eax
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x402503
mov ecx, dword [esp + 0x24]
push ecx
push ebp
lea edx, [esp + 0x30]
push edx
push ebx
call fcn.00401910
add esp, 0x10
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x636]
sub eax, dword [esi + 0x632]
add eax, 0xfffffff9
xor ebp, ebp
test eax, eax
mov ecx, ebx
mov dword [esi + 0x640], eax
jbe 0x4022eb
mov dword [esp + 0x18], eax
mov eax, ecx
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4022c8
sub eax, edi
lea ecx, [ecx + eax + 1]
mov al, byte [ecx + 0xc]
test al, al
jne 0x4022dd
inc ebp
mov eax, dword [esp + 0x18]
add ecx, 0x11
dec eax
mov dword [esp + 0x18], eax
jne 0x4022c3
mov ecx, dword [esi + 0x640]
push ecx
push ebp
push str.V2_dirent_parse:__d_out_of__d_n
call fcn.00401e30
mov eax, dword [esi + 0x640]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
sub eax, ebp
mov dword [esi + 0x640], eax
imul eax, eax, 0x8c
add esp, 0xc
push eax
push 8
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
mov dword [esi + 0x608], eax
jne 0x402350
push ebx
push eax
mov dword [0x428388], 8
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop ebx
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
mov eax, dword [esi + 0x640]
mov edx, eax
imul edx, edx, 0x8c
xor ebp, ebp
cmp eax, ebp
mov dword [esi + 0x60c], edx
mov dword [esp + 0x10], ebp
jbe 0x402733
cmp byte [ebx], 0
je 0x4024a7
mov edx, dword [esi + 0x608]
xor eax, eax
lea edi, [edx + ebp + 0x1f]
mov ecx, 0x1b
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0x608]
push 0x6c
lea ecx, [eax + ebp + 0x1f]
push ebx
push ecx
call fcn.004180a0
mov eax, ebx
add esp, 0xc
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4023b0
sub eax, edx
lea ebx, [ebx + eax + 1]
mov eax, dword [esp + 0x34]
test eax, eax
mov edi, ebx
je 0x4023da
mov edx, dword [esi + 0x640]
mov ecx, dword [esp + 0x10]
push edx
push ecx
push 0
call eax
add esp, 0xc
mov al, byte [edi + 0xc]
add ebx, 0x11
cmp al, 1
je 0x4023fb
cmp al, 3
je 0x4023fb
cmp al, 5
je 0x4023fb
dec dword [esp + 0x10]
sub ebp, 0x8c
jmp 0x402480
mov edx, dword [esi + 0x608]
mov eax, dword [edi]
mov dword [edx + ebp + 4], eax
mov ecx, dword [esi + 0x608]
mov edx, dword [edi + 4]
mov dword [ecx + ebp + 8], edx
mov eax, dword [esi + 0x608]
mov ecx, dword [edi + 8]
mov dword [eax + ebp + 0xc], ecx
mov edx, dword [edi + 0xd]
mov eax, dword [esi + 0x608]
add edx, 0x2e
mov dword [eax + ebp + 0x10], edx
mov ecx, dword [esi + 0x608]
mov dl, byte [edi + 0xc]
mov byte [ecx + ebp + 0x14], dl
mov eax, dword [esi + 0x608]
mov ecx, dword [esi + 0x63a]
mov dword [eax + ebp + 0x18], ecx
mov edx, dword [edi]
xor eax, eax
mov al, byte [edi + 0xc]
push edx
push eax
call fcn.004018d0
mov ecx, dword [esi + 0x608]
mov byte [ecx + ebp + 0x1e], al
mov edx, dword [esi + 0x608]
mov byte [edx + ebp + 0x8b], 1
mov eax, dword [esi + 0x608]
add esp, 8
mov dword [eax + ebp], esi
mov eax, dword [esp + 0x10]
mov ecx, dword [esi + 0x640]
inc eax
add ebp, 0x8c
cmp eax, ecx
mov dword [esp + 0x10], eax
jb 0x402372
pop edi
pop ebx
mov eax, esi
pop esi
pop ebp
add esp, 0x1c
ret
mov ecx, dword [esp + 0x10]
pop edi
pop ebx
mov dword [esi + 0x640], ecx
mov eax, esi
pop esi
pop ebp
add esp, 0x1c
ret
sub ebp, ebx
push ebp
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
jne 0x4024ef
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop ebx
pop esi
mov dword [0x428388], 8
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
push 0
lea edx, [esp + 0x18]
push edx
push ebp
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402520
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov dword [0x428388], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop ebx
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
cmp ebp, eax
mov dword [esi + 0x640], eax
jbe 0x402551
mov edx, dword [eax + ebx]
lea ecx, [eax + ebx]
cmp byte [ecx + edx + 0x10], 0
je 0x402546
inc dword [esi + 0x640]
mov ecx, dword [eax + ebx]
lea eax, [eax + ecx + 0x15]
cmp eax, ebp
jb 0x402533
mov edx, dword [esi + 0x640]
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
imul edx, edx, 0x8c
push edx
push 8
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
mov dword [esi + 0x608], eax
jne 0x4025a1
push edi
mov dword [0x428388], 8
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push 0
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop ebx
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
mov eax, dword [esi + 0x640]
mov edx, dword [esi + 0x640]
imul eax, eax, 0x8c
mov dword [esi + 0x60c], eax
xor ecx, ecx
xor eax, eax
test edx, edx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], eax
jbe 0x402733
xor ebp, ebp
jmp 0x4025d5
mov eax, dword [esp + 0x18]
mov edi, dword [eax + ebx]
mov edx, dword [esp + 0x34]
add edi, eax
add edi, ebx
test edx, edx
je 0x4025fb
mov eax, dword [esi + 0x640]
push eax
push ecx
push 0
call edx
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
add esp, 0xc
mov dl, byte [edi + 0x10]
test dl, dl
jne 0x40260e
dec ecx
sub ebp, 0x8c
jmp 0x40270f
mov ecx, dword [eax + ebx]
push 1
sub ecx, 6
push ecx
lea edx, [eax + ebx + 6]
push edx
call fcn.004017a0
mov ecx, eax
lea edx, [eax + 1]
add esp, 0xc
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], edx
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x402631
sub eax, dword [esp + 0x1c]
cmp eax, 0x6b
jae 0x402733
mov edx, dword [edi + 0xc]
mov eax, dword [edi + 4]
sub eax, edx
mov edx, dword [esi + 0x608]
sub eax, 0x2cb
mov dword [edx + ebp + 4], eax
mov eax, dword [edi + 8]
mov edx, dword [esi + 0x608]
sub eax, 0x92cb
mov dword [edx + ebp + 8], eax
mov eax, dword [esi + 0x608]
mov edx, dword [edi + 0xc]
mov dword [eax + ebp + 0xc], edx
mov eax, dword [edi + 0x11]
mov edx, dword [esi + 0x608]
add eax, 0x2e
mov dword [edx + ebp + 0x10], eax
mov edx, dword [esi + 0x63a]
mov eax, dword [esi + 0x608]
mov dword [eax + ebp + 0x18], edx
mov eax, dword [esi + 0x608]
mov dl, byte [edi + 0x10]
mov byte [eax + ebp + 0x14], dl
mov eax, dword [esi + 0x608]
mov edx, dword [eax + ebp + 4]
push edx
push ecx
call fcn.00401830
mov ecx, dword [esi + 0x608]
mov byte [ecx + ebp + 0x1e], al
mov edx, dword [esi + 0x608]
mov byte [edx + ebp + 0x8b], 1
mov eax, dword [esi + 0x608]
mov dword [eax + ebp], esi
mov edx, dword [esi + 0x608]
xor eax, eax
lea edi, [edx + ebp + 0x1f]
mov ecx, 0x1b
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x28]
mov ecx, dword [esi + 0x608]
push 0x6c
push eax
lea edx, [ecx + ebp + 0x1f]
push edx
call fcn.004180a0
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x2c]
add esp, 0x14
mov edx, dword [eax + ebx]
lea eax, [eax + edx + 0x15]
inc ecx
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0x640]
add ebp, 0x8c
cmp ecx, eax
mov dword [esp + 0x10], ecx
jb 0x4025d1
pop edi
pop ebx
mov eax, esi
pop esi
pop ebp
add esp, 0x1c
ret