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

Disassembly:
push ecx
push ecx
push ebx
push ebp
push esi
push edi
push dword [0x697400]
xor ebp, ebp
call fcn.00522729
mov ebx, eax
call fcn.00500d26
cmp dword [esp + 0x1c], ebp
mov esi, 0x61e260
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
cmovne esi, dword [esp + 0x1c]
xor eax, eax
push eax
push pe_nt_image_headers32
push 3
push eax
push 1
push 0xc0000000
push esi
mov dword [ebx + 0xc], eax
call edi
mov dword [ebx], eax
cmp eax, 0xffffffff
jne 0x5007f4
push ebp
push pe_nt_image_headers32
push 3
push ebp
push 1
push accept
push esi
call edi
mov dword [ebx], eax
cmp eax, 0xffffffff
jne 0x5007e4
push ebp
push pe_nt_image_headers32
push 3
push ebp
push 3
push accept
push esi
call edi
mov dword [ebx], eax
mov dword [ebx + 0xc], 1
cmp eax, 0xffffffff
je 0x500ab4
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
xor ecx, ecx
cmp dword [esp + 0x24], 2
mov eax, 0xfde9
cmovne eax, ecx
mov dword [ebx + 0x18], eax
mov eax, dword [esp + 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebx + 0x2c], eax
cmp edi, 3
jl 0x500865
push ecx
lea eax, [esp + 0x18]
push eax
push 3
lea eax, [esp + 0x1c]
push eax
push dword [ebx]
call esi
cmp dword [esp + 0x14], 3
jne 0x50091e
push 3
lea eax, [esp + 0x14]
push 0x634ce8
push eax
call fcn.004d7621
add esp, 0xc
test eax, eax
jne 0x50091e
mov dword [ebx + 0x18], 0xfde9
sub edi, 3
test edi, edi
jle 0x50094e
lea eax, [edi + 2]
xor ecx, ecx
push eax
push ecx
push dword [0x694170]
cmp dword [ebx + 0x18], ecx
jne 0x500930
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
mov dword [esp + 0x1c], esi
test esi, esi
je 0x50094e
lea eax, [edi*4 + 2]
push eax
push 0
push dword [0x694170]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebx + 0x10], eax
test eax, eax
je 0x50094e
push 0
lea eax, [esp + 0x18]
push eax
push edi
push esi
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x14]
push esi
mov byte [esi + eax], 0
call fcn.005dd8d0
mov edi, eax
push edi
call fcn.005dd770
mov esi, eax
push esi
push dword [ebx + 0x10]
call fcn.005f42a0
pop ecx
pop ecx
push esi
call fcn.005dd760
push edi
call fcn.005dd9f0
push dword [ebx + 0x10]
call fcn.005f43a0
pop ecx
push dword [esp + 0x1c]
mov dword [ebx + 0x18], 0xfde9
mov edi, eax
push 0
push dword [0x694170]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x50094e
xor eax, eax
push eax
push eax
push eax
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x50086d
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebx + 0x10], eax
test eax, eax
je 0x50094e
push 0
lea ecx, [esp + 0x18]
push ecx
push edi
push eax
push dword [ebx]
call esi
mov edi, dword [esp + 0x14]
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x500af1
xor ecx, ecx
mov word [eax + edi], cx
mov esi, dword [ebx + 0x10]
lea eax, [esi + edi]
mov dword [ebx + 0x14], eax
cmp esi, eax
jae 0x500af1
push 0x10
pop edi
mov al, byte [esi]
cmp al, 0x20
je 0x50097d
cmp al, 9
jne 0x500980
inc esi
jmp 0x500973
cmp al, 0x3b
jne 0x5009ce
inc esi
cmp byte [esi], 0x20
jne 0x50098b
inc esi
push edi
test ebp, ebp
je 0x500998
push ebp
call fcn.005230d5
jmp 0x5009a1
lea eax, [ebx + 0x1c]
push eax
call fcn.00523089
lea ebp, [eax - 8]
pop ecx
pop ecx
mov dword [ebp + 8], 2
mov dword [ebp + 0xc], esi
jmp 0x5009c3
cmp al, 0xa
je 0x500a9b
cmp al, 0xd
je 0x500a9b
inc esi
mov al, byte [esi]
test al, al
jne 0x5009b2
jmp 0x500a9b
cmp al, 0x5b
jne 0x500a35
inc esi
push edi
test ebp, ebp
je 0x5009e0
push ebp
call fcn.005230d5
jmp 0x5009e9
lea eax, [ebx + 0x1c]
push eax
call fcn.00523089
lea ebp, [eax - 8]
mov dword [ebp + 8], 1
mov dword [ebp + 0xc], esi
mov al, byte [esi]
pop ecx
pop ecx
test al, al
je 0x500a1a
mov cl, al
mov al, cl
cmp cl, 0x5d
je 0x500a1a
cmp cl, 0xa
je 0x500a1a
cmp cl, 0xd
je 0x500a1a
inc esi
mov al, byte [esi]
mov cl, al
test al, al
jne 0x500a00
mov byte [esi], 0
inc esi
cmp al, 0x5d
jne 0x500a9f
jmp 0x500a2d
cmp al, 0xa
je 0x500a9f
cmp al, 0xd
je 0x500a9f
inc esi
mov al, byte [esi]
test al, al
jne 0x500a24
jmp 0x500a9f
cmp al, 0xa
je 0x500a9f
cmp al, 0xd
je 0x500a9f
mov edx, esi
jmp 0x500a50
cmp al, 0x3d
je 0x500a54
cmp al, 0xd
je 0x500a54
cmp al, 0xa
je 0x500a54
inc esi
mov al, byte [esi]
test al, al
jne 0x500a41
lea eax, [esi - 1]
jmp 0x500a66
mov cl, byte [eax]
cmp cl, 0x20
je 0x500a65
cmp cl, 9
jne 0x500a6a
dec eax
cmp eax, edx
ja 0x500a59
mov byte [eax + 1], 0
inc esi
mov al, byte [esi]
cmp al, 0x20
je 0x500a6e
cmp al, 9
je 0x500a6e
push esi
push edx
lea eax, [ebx + 0x1c]
push ebp
push eax
call fcn.00500b0c
add esp, 0x10
mov ebp, eax
jmp 0x500a95
cmp al, 0xa
je 0x500a9b
cmp al, 0xd
je 0x500a9b
inc esi
mov al, byte [esi]
test al, al
jne 0x500a8c
mov byte [esi], 0
inc esi
mov al, byte [esi]
cmp al, 0xa
je 0x500a9e
cmp al, 0xd
je 0x500a9e
cmp esi, dword [ebx + 0x14]
jb 0x500973
jmp 0x500af1
mov eax, dword [esp + 0x20]
and dword [ebx], ebp
push esi
mov dword [ebx + 0x2c], eax
mov dword [ebx + 0x18], 0xfde9
call fcn.004cc103
pop ecx
lea eax, [eax*2 + 2]
push eax
push 0
push dword [0x694170]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebx + 4], eax
test eax, eax
je 0x500af1
push esi
push eax
call fcn.005f3ec6
pop ecx
pop ecx
mov eax, dword [ebx]
pop edi
pop esi
pop ebp
pop ebx
pop ecx
pop ecx
ret 0xc