Function at 0x10031d54
Capabilities:
Read file on windows

Disassembly:
mov ebx, ebx
push ebp
mov ebp, esp
sub esp, 0x1c
mov edx, dword [ebp + 0x10]
push edi
mov edi, dword [ebp + 8]
push 0xfffffffffffffffe
pop eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x1c], edx
cmp edi, eax
jne 0x10031d8b
call fcn.1002a762
and dword [eax], 0
call fcn.1002a74f
mov dword [eax], 9
or eax, 0xffffffff
jmp 0x10032308
push esi
xor esi, esi
cmp edi, esi
jl 0x10031d9a
cmp edi, dword [0x10b1bf68]
jb 0x10031db9
call fcn.1002a762
mov dword [eax], esi
call fcn.1002a74f
mov dword [eax], 9
call fcn.1002a6fd
or eax, 0xffffffff
jmp 0x10032307
mov eax, edi
sar eax, 5
push ebx
and edi, 0x1f
lea ebx, [eax*4 + 0x10b1bf80]
mov eax, dword [ebx]
shl edi, 6
mov cl, byte [eax + edi + 4]
test cl, 1
jne 0x10031deb
call fcn.1002a762
mov dword [eax], esi
call fcn.1002a74f
mov dword [eax], 9
jmp 0x10031e53
cmp edx, 0x7fffffff
ja 0x10031e41
mov dword [ebp - 0xc], esi
cmp edx, esi
je 0x10032304
test cl, 2
jne 0x10032304
cmp dword [ebp + 0xc], esi
je 0x10031e41
mov al, byte [eax + edi + 0x24]
add al, al
sar al, 1
mov byte [ebp - 2], al
movsx eax, al
dec eax
push 4
pop ecx
je 0x10031e39
dec eax
jne 0x10031e31
mov eax, edx
not eax
test al, 1
je 0x10031e41
and edx, 0xfffffffe
mov dword [ebp + 0x10], edx
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x10], esi
jmp 0x10031eb3
mov eax, edx
not eax
test al, 1
jne 0x10031e5a
call fcn.1002a762
mov dword [eax], esi
call fcn.1002a74f
mov dword [eax], 0x16
call fcn.1002a6fd
jmp 0x10031e90
mov eax, edx
shr eax, 1
mov dword [ebp + 0x10], ecx
cmp eax, ecx
jb 0x10031e68
mov dword [ebp + 0x10], eax
push dword [ebp + 0x10]
call fcn.1002cfa7
mov esi, eax
pop ecx
mov dword [ebp - 0x10], esi
test esi, esi
jne 0x10031e98
call fcn.1002a74f
mov dword [eax], 0xc
call fcn.1002a762
mov dword [eax], 8
or eax, 0xffffffff
jmp 0x10032306
push 1
push 0
push 0
push dword [ebp + 8]
call fcn.100304b8
mov ecx, dword [ebx]
mov dword [edi + ecx + 0x28], eax
add esp, 0x10
mov dword [edi + ecx + 0x2c], edx
mov ecx, dword [ebx]
add ecx, edi
test byte [ecx + 4], 0x48
mov eax, esi
je 0x10031f39
mov cl, byte [ecx + 5]
cmp cl, 0xa
je 0x10031f39
cmp dword [ebp + 0x10], 0
je 0x10031f39
dec dword [ebp + 0x10]
cmp byte [ebp - 2], 0
mov byte [esi], cl
mov ecx, dword [ebx]
lea eax, [esi + 1]
mov dword [ebp - 0xc], 1
mov byte [edi + ecx + 5], 0xa
je 0x10031f39
mov ecx, dword [ebx]
mov cl, byte [edi + ecx + 0x25]
cmp cl, 0xa
je 0x10031f39
cmp dword [ebp + 0x10], 0
je 0x10031f39
mov byte [eax], cl
mov ecx, dword [ebx]
inc eax
dec dword [ebp + 0x10]
cmp byte [ebp - 2], 1
mov dword [ebp - 0xc], 2
mov byte [edi + ecx + 0x25], 0xa
jne 0x10031f39
mov ecx, dword [ebx]
mov cl, byte [edi + ecx + 0x26]
cmp cl, 0xa
je 0x10031f39
cmp dword [ebp + 0x10], 0
je 0x10031f39
mov byte [eax], cl
mov ecx, dword [ebx]
inc eax
dec dword [ebp + 0x10]
mov dword [ebp - 0xc], 3
mov byte [edi + ecx + 0x26], 0xa
push 0
lea ecx, [ebp - 0x18]
push ecx
push dword [ebp + 0x10]
push eax
mov eax, dword [ebx]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100322ce
mov ecx, dword [ebp - 0x18]
test ecx, ecx
js 0x100322ce
cmp ecx, dword [ebp + 0x10]
ja 0x100322ce
mov eax, dword [ebx]
add dword [ebp - 0xc], ecx
lea eax, [edi + eax + 4]
test byte [eax], 0x80
je 0x10032160
cmp byte [ebp - 2], 2
je 0x1003219a
test ecx, ecx
je 0x10031f94
cmp byte [esi], 0xa
jne 0x10031f94
or byte [eax], 4
jmp 0x10031f97
and byte [eax], 0xfb
mov esi, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
add eax, esi
mov dword [ebp + 0x10], esi
mov dword [ebp - 0xc], eax
cmp esi, eax
jae 0x1003207e
mov ecx, dword [ebp + 0x10]
mov al, byte [ecx]
cmp al, 0x1a
je 0x10032069
cmp al, 0xd
je 0x10031fca
mov byte [esi], al
inc esi
inc ecx
mov dword [ebp + 0x10], ecx
jmp 0x1003205b
mov eax, dword [ebp - 0xc]
dec eax
cmp ecx, eax
jae 0x10031fea
lea eax, [ecx + 1]
cmp byte [eax], 0xa
jne 0x10031fe5
add ecx, 2
mov dword [ebp + 0x10], ecx
mov byte [esi], 0xa
jmp 0x1003205a
mov dword [ebp + 0x10], eax
jmp 0x10032057
inc dword [ebp + 0x10]
push 0
lea eax, [ebp - 0x18]
push eax
push 1
lea eax, [ebp - 1]
push eax
mov eax, dword [ebx]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10032012
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x10032057
cmp dword [ebp - 0x18], 0
je 0x10032057
mov eax, dword [ebx]
test byte [edi + eax + 4], 0x48
je 0x10032035
cmp byte [ebp - 1], 0xa
je 0x10031fe0
mov byte [esi], 0xd
mov eax, dword [ebx]
mov cl, byte [ebp - 1]
mov byte [edi + eax + 5], cl
jmp 0x1003205a
cmp esi, dword [ebp - 0x10]
jne 0x10032040
cmp byte [ebp - 1], 0xa
je 0x10031fe0
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.100304b8
add esp, 0x10
cmp byte [ebp - 1], 0xa
je 0x1003205b
mov byte [esi], 0xd
inc esi
mov eax, dword [ebp - 0xc]
cmp dword [ebp + 0x10], eax
jb 0x10031fad
jmp 0x1003207e
mov eax, dword [ebx]
lea eax, [edi + eax + 4]
test byte [eax], 0x40
jne 0x10032079
or byte [eax], 2
jmp 0x1003207e
mov al, byte [ecx]
mov byte [esi], al
inc esi
mov eax, esi
sub eax, dword [ebp - 0x10]
cmp byte [ebp - 2], 1
mov dword [ebp - 0xc], eax
jne 0x10032160
test eax, eax
je 0x10032160
dec esi
mov cl, byte [esi]
test cl, cl
js 0x100320a5
inc esi
jmp 0x1003212b
xor eax, eax
inc eax
movzx ecx, cl
jmp 0x100320bc
cmp eax, 4
jg 0x100320c5
cmp esi, dword [ebp - 0x10]
jb 0x100320c5
dec esi
movzx ecx, byte [esi]
inc eax
cmp byte [ecx + 0x100460b0], 0
je 0x100320ad
mov dl, byte [esi]
movzx ecx, dl
movsx ecx, byte [ecx + 0x100460b0]
test ecx, ecx
jne 0x100320e2
call fcn.1002a74f
mov dword [eax], 0x2a
jmp 0x1003215c
inc ecx
cmp ecx, eax
jne 0x100320eb
add esi, eax
jmp 0x1003212b
mov ecx, dword [ebx]
test byte [ecx + edi + 4], 0x48
je 0x10032119
inc esi
mov byte [ecx + edi + 5], dl
cmp eax, 2
jl 0x10032107
mov dl, byte [esi]
mov ecx, dword [ebx]
mov byte [edi + ecx + 0x25], dl
inc esi
cmp eax, 3
jne 0x10032115
mov dl, byte [esi]
mov ecx, dword [ebx]
mov byte [edi + ecx + 0x26], dl
inc esi
sub esi, eax
jmp 0x1003212b
neg eax
cdq
push 1
push edx
push eax
push dword [ebp + 8]
call fcn.100304b8
add esp, 0x10
mov eax, dword [ebp - 0x1c]
sub esi, dword [ebp - 0x10]
shr eax, 1
push eax
push dword [ebp + 0xc]
push esi
push dword [ebp - 0x10]
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0xc], eax
test eax, eax
jne 0x10032183
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.1002a775
pop ecx
or dword [ebp - 0x14], 0xffffffff
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0xc]
je 0x1003216f
push eax
call fcn.10027fb3
pop ecx
mov eax, dword [ebp - 0x14]
cmp eax, 0xfffffffe
jne 0x10032306
mov eax, dword [ebp - 0xc]
jmp 0x10032306
mov eax, dword [ebp - 0xc]
mov edx, dword [ebx]
xor ecx, ecx
cmp eax, esi
setne cl
add eax, eax
mov dword [ebp - 0xc], eax
mov dword [edi + edx + 0x30], ecx
jmp 0x10032160
test ecx, ecx
je 0x100321a9
cmp word [esi], 0xa
jne 0x100321a9
or byte [eax], 4
jmp 0x100321ac
and byte [eax], 0xfb
mov esi, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
add eax, esi
mov dword [ebp + 0x10], esi
mov dword [ebp - 0xc], eax
cmp esi, eax
jae 0x100322c3
mov eax, dword [ebp + 0x10]
movzx ecx, word [eax]
cmp ecx, 0x1a
je 0x100322aa
cmp ecx, 0xd
je 0x100321e7
mov word [esi], cx
add esi, 2
add eax, 2
mov dword [ebp + 0x10], eax
jmp 0x1003229c
mov ecx, dword [ebp - 0xc]
add ecx, 0xfffffffe
cmp eax, ecx
jae 0x1003220f
lea ecx, [eax + 2]
cmp word [ecx], 0xa
jne 0x10032207
add eax, 4
mov dword [ebp + 0x10], eax
push 0xa
jmp 0x10032295
mov dword [ebp + 0x10], ecx
jmp 0x10032293
add dword [ebp + 0x10], 2
push 0
lea eax, [ebp - 0x18]
push eax
push 2
lea eax, [ebp - 8]
push eax
mov eax, dword [ebx]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10032238
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x10032293
cmp dword [ebp - 0x18], 0
je 0x10032293
mov eax, dword [ebx]
test byte [edi + eax + 4], 0x48
je 0x1003226f
cmp word [ebp - 8], 0xa
je 0x10032200
push 0xd
pop eax
mov word [esi], ax
mov eax, dword [ebx]
mov cl, byte [ebp - 8]
mov byte [edi + eax + 5], cl
mov eax, dword [ebx]
mov cl, byte [ebp - 7]
mov byte [edi + eax + 0x25], cl
mov eax, dword [ebx]
mov byte [edi + eax + 0x26], 0xa
jmp 0x10032299
cmp esi, dword [ebp - 0x10]
jne 0x1003227b
cmp word [ebp - 8], 0xa
je 0x10032200
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [ebp + 8]
call fcn.100304b8
add esp, 0x10
cmp word [ebp - 8], 0xa
je 0x1003229c
push 0xd
pop eax
mov word [esi], ax
add esi, 2
mov eax, dword [ebp - 0xc]
cmp dword [ebp + 0x10], eax
jb 0x100321c2
jmp 0x100322c3
mov ecx, dword [ebx]
lea edi, [edi + ecx + 4]
test byte [edi], 0x40
jne 0x100322ba
or byte [edi], 2
jmp 0x100322c3
mov ax, word [eax]
mov word [esi], ax
add esi, 2
sub esi, dword [ebp - 0x10]
mov dword [ebp - 0xc], esi
jmp 0x10032160
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop edi
cmp eax, edi
jne 0x100322f2
call fcn.1002a74f
mov dword [eax], 9
call fcn.1002a762
mov dword [eax], edi
jmp 0x1003215c
cmp eax, 0x6d
jne 0x10032155
and dword [ebp - 0x14], 0
jmp 0x10032160
xor eax, eax
pop ebx
pop esi
pop edi
leave
ret