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

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
push edi
push dword [0x4054dc]
xor ebp, ebp
mov dword [esp + 0x1c], ebp
call fcn.004030d5
mov edi, eax
call fcn.00402d07
mov esi, dword [esp + 0x24]
test esi, esi
jne 0x4027ad
mov esi, 0x404024
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileW]
push ebp
push pe_nt_image_headers32
push 3
push ebp
push 1
push 0xc0000000
push esi
mov dword [edi + 0xc], ebp
call ebx
mov dword [edi], eax
cmp eax, 0xffffffff
jne 0x402854
push ebp
push pe_nt_image_headers32
push 3
push ebp
push 1
push 0x80000000
push esi
call ebx
mov dword [edi], eax
cmp eax, 0xffffffff
jne 0x402803
push ebp
push pe_nt_image_headers32
push 3
push ebp
push 3
push 0x80000000
push esi
call ebx
mov dword [edi], eax
cmp dword [edi], 0xffffffff
mov dword [edi + 0xc], 1
jne 0x402854
mov eax, dword [esp + 0x28]
push esi
mov dword [edi], ebp
mov dword [edi + 0x2c], eax
mov dword [edi + 0x18], 0xfde9
call sub.MSVCRT.dll_wcslen
pop ecx
lea eax, [eax*2 + 2]
push eax
push ebp
push dword [0x405498]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [edi + 4], eax
test eax, eax
je 0x402ad5
push esi
push eax
call sub.MSVCRT.dll_wcscpy
pop ecx
pop ecx
jmp 0x402ad5
push ebp
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
push 3
mov dword [edi + 0x18], ebp
mov dword [edi + 0x2c], eax
mov eax, dword [esp + 0x18]
pop esi
cmp eax, esi
jl 0x4028cb
push ebp
lea eax, [esp + 0x20]
push eax
push esi
lea eax, [esp + 0x1c]
push eax
push dword [edi]
call ebx
cmp dword [esp + 0x1c], esi
jne 0x4028bc
push esi
lea eax, [esp + 0x14]
push 0x404028
push eax
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x4028bc
mov dword [edi + 0x18], 0xfde9
mov eax, dword [esp + 0x14]
sub eax, esi
mov dword [esp + 0x14], eax
jmp 0x4028cb
push ebp
push ebp
push ebp
push dword [edi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x14]
test eax, eax
jle 0x402962
add eax, 2
push eax
push ebp
push dword [0x405498]
cmp dword [edi + 0x18], ebp
jne 0x402997
mov ebp, dword [sym.imp.KERNEL32.dll_HeapAlloc]
call ebp
mov esi, eax
test esi, esi
je 0x40295e
mov eax, dword [esp + 0x14]
lea eax, [eax*4 + 2]
push eax
push 0
push dword [0x405498]
call ebp
mov dword [edi + 0x10], eax
test eax, eax
je 0x40295e
push 0
lea eax, [esp + 0x20]
push eax
push dword [esp + 0x1c]
push esi
push dword [edi]
call ebx
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x14]
shl eax, 2
mov dword [esp + 0x14], eax
lea eax, [esp + 0x28]
push eax
push esi
lea eax, [esp + 0x1c]
push eax
push dword [edi + 0x10]
call fcn.00403600
push esi
push 0
mov dword [edi + 0x18], 0xfde9
push dword [0x405498]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x14]
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x402ad5
xor edx, edx
mov word [ecx + eax], dx
mov eax, dword [esp + 0x14]
mov esi, dword [edi + 0x10]
add eax, esi
mov dword [edi + 0x14], eax
push 0xa
pop ebx
cmp esi, eax
jae 0x402ad5
mov al, byte [esi]
cmp al, 0x20
je 0x402994
cmp al, 9
jne 0x4029bd
inc esi
jmp 0x40298a
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [edi + 0x10], eax
test eax, eax
je 0x40295e
push ebp
lea ecx, [esp + 0x20]
push ecx
push dword [esp + 0x1c]
push eax
push dword [edi]
call ebx
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x14], eax
jmp 0x402962
mov al, byte [esi]
cmp al, 0x3b
jne 0x402a01
inc esi
cmp byte [esi], 0x20
jne 0x4029ca
inc esi
push esi
push 2
push dword [esp + 0x20]
lea eax, [edi + 0x1c]
push eax
call fcn.00402aef
add esp, 0x10
mov dword [esp + 0x18], eax
jmp 0x4029f7
mov cl, byte [esi]
cmp cl, bl
je 0x402abe
cmp cl, 0xd
je 0x402abe
inc esi
cmp byte [esi], 0
jne 0x4029e3
jmp 0x402abe
cmp al, 0x5b
jne 0x402a52
inc esi
lea eax, [edi + 0x1c]
push esi
push 1
push dword [esp + 0x20]
push eax
call fcn.00402aef
add esp, 0x10
mov dword [esp + 0x18], eax
jmp 0x402a2e
mov al, byte [esi]
cmp al, 0x5d
je 0x402a3c
cmp al, bl
je 0x402a33
cmp al, 0xd
je 0x402a33
inc esi
cmp byte [esi], 0
jne 0x402a1f
cmp byte [esi], 0x5d
jne 0x402abe
mov byte [esi], 0
jmp 0x402a49
cmp al, bl
je 0x402ac1
cmp al, 0xd
je 0x402ac2
inc esi
mov al, byte [esi]
test al, al
jne 0x402a41
jmp 0x402ac2
cmp al, bl
je 0x402ac2
cmp al, 0xd
je 0x402ac2
mov edx, esi
jmp 0x402a6d
cmp al, 0x3d
je 0x402a71
cmp al, 0xd
je 0x402a71
cmp al, bl
je 0x402a71
inc esi
mov al, byte [esi]
test al, al
jne 0x402a5e
lea eax, [esi - 1]
jmp 0x402a83
mov cl, byte [eax]
cmp cl, 0x20
je 0x402a82
cmp cl, 9
jne 0x402a87
dec eax
cmp eax, edx
ja 0x402a76
mov byte [eax + 1], 0
inc esi
mov al, byte [esi]
cmp al, 0x20
je 0x402a8b
cmp al, 9
je 0x402a8b
push esi
push edx
push dword [esp + 0x20]
lea eax, [edi + 0x1c]
push eax
call fcn.00402aef
add esp, 0x10
mov dword [esp + 0x18], eax
jmp 0x402ab9
mov al, byte [esi]
cmp al, bl
je 0x402abe
cmp al, 0xd
je 0x402abe
inc esi
cmp byte [esi], 0
jne 0x402aae
mov byte [esi], 0
inc esi
mov al, byte [esi]
cmp al, bl
je 0x402ac1
cmp al, 0xd
je 0x402ac1
cmp esi, dword [edi + 0x14]
jb 0x40298a
mov eax, dword [edi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 8