Function at 0x10082fd
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x82c
mov eax, dword [0x1013b58]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
push edi
push 0x80
push 3
push edi
push 1
push 0x80000000
push esi
mov dword [ebp - 0x82c], eax
mov dword [ebp - 0x810], edi
mov dword [ebp - 0x824], edi
mov dword [ebp - 0x820], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x814], ebx
cmp ebx, 0xffffffff
jne 0x1008376
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jg 0x100836a
mov esi, eax
jmp 0x10087fd
and eax, 0xffff
or eax, 0x80070000
jmp 0x1008363
push edi
lea eax, [ebp - 0x818]
push eax
push 4
lea eax, [ebp - 0x81c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10083af
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jg 0x10083a3
mov esi, eax
jmp 0x10087d3
and eax, 0xffff
or eax, 0x80070000
jmp 0x100839c
cmp dword [ebp - 0x818], 4
je 0x10083c2
mov esi, 0x8007000d
jmp 0x10087d3
mov eax, dword [ebp - 0x81c]
test al, al
jne 0x10083e2
test ah, ah
jne 0x10083e2
cmp byte [ebp - 0x81a], 0xfe
jne 0x10083e2
cmp byte [ebp - 0x819], 0xff
je 0x10083b8
cmp byte [ebp - 0x819], 0
jne 0x10083fd
cmp byte [ebp - 0x81a], 0
jne 0x10083fd
cmp ah, 0xfe
jne 0x10083fd
cmp al, 0xff
je 0x10083b8
cmp ah, 0xff
jne 0x1008406
cmp al, 0xfe
je 0x10083b8
cmp al, 0xef
jne 0x1008453
cmp ah, 0xbb
jne 0x1008418
cmp byte [ebp - 0x81a], 0xbf
je 0x10083b8
push ebx
mov dword [ebp - 0x828], edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0x814], 0xffffffff
push 0x1001850
push esi
call dword [sym.imp.msvcrt.dll__wfopen]
pop ecx
pop ecx
mov dword [ebp - 0x810], eax
cmp eax, edi
jne 0x1008466
call dword [sym.imp.msvcrt.dll__errno]
mov esi, dword [eax]
cmp esi, edi
jmp 0x10086b4
cmp al, 0xff
jne 0x1008418
cmp ah, 0xfe
jne 0x1008418
mov dword [ebp - 0x828], 1
mov edi, dword [sym.imp.msvcrt.dll_fgetws]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
xor esi, esi
xor eax, eax
mov dword [ebp - 0x80c], esi
mov word [ebp - 8], ax
cmp dword [ebp - 0x828], esi
je 0x100850f
push 2
pop eax
push esi
push esi
xor ecx, ecx
push ecx
push eax
push dword [ebp - 0x814]
call ebx
test eax, eax
jne 0x1008567
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
jle 0x10087bb
and eax, 0xffff
or eax, 0x80070000
jmp 0x10087bb
lea eax, [ebp - 0x808]
push eax
call fcn.01007ace
xor eax, eax
cmp ax, word [ebp - 0x808]
je 0x100850f
push 0x3b
pop eax
cmp ax, word [ebp - 0x808]
je 0x100850f
push 0x23
pop eax
cmp ax, word [ebp - 0x808]
je 0x100850f
lea eax, [ebp - 0x80c]
push eax
push 1
push dword [ebp - 0x80c]
call fcn.0100bda5
mov esi, eax
test esi, esi
jl 0x10087bd
push dword [ebp - 0x810]
lea eax, [ebp - 0x808]
push 0x401
push eax
call edi
add esp, 0xc
test eax, eax
jne 0x10084c2
push dword [ebp - 0x810]
call dword [sym.imp.msvcrt.dll_ferror]
pop ecx
test eax, eax
jne 0x10086aa
push dword [ebp - 0x80c]
push 0
push 8
call dword [sym.imp.OLEAUT32.dll_SafeArrayCopyData]
mov dword [ebp - 0x824], eax
test eax, eax
jne 0x1008664
mov esi, 0x8007000e
jmp 0x10087bd
push esi
lea eax, [ebp - 0x818]
push eax
push 0x800
lea eax, [ebp - 0x808]
push eax
push dword [ebp - 0x814]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10084a5
mov eax, dword [ebp - 0x818]
cmp eax, 0x800
jne 0x10085e0
lea eax, [ebp - 0x808]
push 0xa
push eax
call dword [sym.imp.msvcrt.dll_wcsrchr]
pop ecx
pop ecx
cmp eax, esi
je 0x10085ec
xor ecx, ecx
mov word [eax], cx
lea ecx, [ebp - 0x808]
sub eax, ecx
sar eax, 1
add eax, eax
sub eax, dword [ebp - 0x818]
push 1
cdq
push esi
push edx
push eax
push dword [ebp - 0x814]
call ebx
test eax, eax
je 0x10084a5
jmp 0x10085ec
shr eax, 1
xor ecx, ecx
mov word [ebp + eax*2 - 0x808], cx
push 0x1001848
lea eax, [ebp - 0x808]
push eax
jmp 0x100863f
push esi
call fcn.01007ace
movzx eax, word [esi]
xor ecx, ecx
cmp cx, ax
je 0x1008638
push 0x3b
pop ecx
cmp cx, ax
je 0x1008638
push 0x23
pop ecx
cmp cx, ax
je 0x1008638
lea eax, [ebp - 0x80c]
push eax
push 1
push dword [ebp - 0x80c]
call fcn.0100bda5
mov esi, eax
test esi, esi
jl 0x10087bd
push 0x1001848
push 0
call dword [sym.imp.msvcrt.dll_wcstok]
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x10085fa
cmp dword [ebp - 0x818], 0x800
jne 0x100853f
xor esi, esi
jmp 0x1008567
lea eax, [ebp - 0x820]
push eax
push dword [ebp - 0x824]
call dword [sym.imp.OLEAUT32.dll_SafeArrayUnaccessData]
mov esi, eax
test esi, esi
jl 0x10087bd
xor esi, esi
mov dword [ebp - 0x80c], esi
cmp dword [ebp - 0x828], esi
jne 0x1008810
push esi
push esi
push dword [ebp - 0x810]
call dword [sym.imp.msvcrt.dll_fseek]
add esp, 0xc
test eax, eax
je 0x10086cb
call dword [sym.imp.msvcrt.dll__errno]
mov esi, dword [eax]
test esi, esi
jle 0x10087bd
and esi, 0xffff
or esi, 0x80070000
jmp 0x10087bd
push dword [ebp - 0x810]
lea eax, [ebp - 0x808]
push 0x401
push eax
call edi
add esp, 0xc
test eax, eax
je 0x10087a6
xor esi, esi
lea edi, [ebp - 0x808]
mov eax, edi
push eax
call fcn.01007ace
mov ax, word [ebp - 0x808]
xor ecx, ecx
cmp cx, ax
je 0x1008783
push 0x3b
pop ecx
cmp cx, ax
je 0x1008783
push 0x23
pop ecx
cmp cx, ax
je 0x1008783
cmp ax, 0x22
jne 0x100875f
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1008723
sub eax, edx
sar eax, 1
cmp word [ebp + eax*2 - 0x80a], 0x22
jne 0x100875f
lea edi, [ebp - 0x806]
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1008747
sub eax, edx
sar eax, 1
xor ecx, ecx
mov word [ebp + eax*2 - 0x808], cx
push edi
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov ecx, dword [ebp - 0x820]
mov dword [esi + ecx], eax
mov eax, dword [ebp - 0x820]
mov eax, dword [esi + eax]
add esi, 4
test eax, eax
je 0x100855d
push dword [ebp - 0x810]
lea eax, [ebp - 0x808]
push 0x401
push eax
call dword [sym.imp.msvcrt.dll_fgetws]
add esp, 0xc
test eax, eax
jne 0x10086ec
mov eax, dword [ebp - 0x82c]
push dword [ebp - 0x824]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x8c]
mov esi, eax
cmp dword [ebp - 0x810], 0
je 0x10087d3
push dword [ebp - 0x810]
call dword [sym.imp.msvcrt.dll_fclose]
pop ecx
cmp dword [ebp - 0x814], 0xffffffff
je 0x10087e8
push dword [ebp - 0x814]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x824], 0
je 0x10087fd
push dword [ebp - 0x824]
call dword [sym.imp.OLEAUT32.dll_SafeArrayGetDim]
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.0100b071
leave
ret 8
push 2
pop eax
push esi
push esi
xor ecx, ecx
push ecx
push eax
push dword [ebp - 0x814]
call ebx
test eax, eax
je 0x10084a5
push esi
lea eax, [ebp - 0x818]
push eax
mov edi, 0x800
push edi
lea eax, [ebp - 0x808]
push eax
push dword [ebp - 0x814]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10084a5
mov eax, dword [ebp - 0x818]
cmp eax, edi
jne 0x10088a0
lea eax, [ebp - 0x808]
push 0xa
push eax
call dword [sym.imp.msvcrt.dll_wcsrchr]
pop ecx
pop ecx
cmp eax, esi
je 0x10088ac
xor ecx, ecx
mov word [eax], cx
lea ecx, [ebp - 0x808]
sub eax, ecx
sar eax, 1
add eax, eax
sub eax, dword [ebp - 0x818]
push 1
cdq
push esi
push edx
push eax
push dword [ebp - 0x814]
call ebx
test eax, eax
je 0x10084a5
jmp 0x10088ac
shr eax, 1
xor ecx, ecx
mov word [ebp + eax*2 - 0x808], cx
push 0x1001848
lea eax, [ebp - 0x808]
push eax
jmp 0x1008950
push esi
call fcn.01007ace
movzx eax, word [esi]
xor ecx, ecx
cmp cx, ax
je 0x1008949
push 0x3b
pop ecx
cmp cx, ax
je 0x1008949
push 0x23
pop ecx
cmp cx, ax
je 0x1008949
cmp ax, 0x22
jne 0x100891a
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x10088e8
sub eax, edx
sar eax, 1
cmp word [esi + eax*2 - 2], 0x22
jne 0x100891a
inc esi
inc esi
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1008905
sub eax, edx
sar eax, 1
xor ecx, ecx
mov word [esi + eax*2 - 2], cx
mov edi, dword [ebp - 0x80c]
push esi
shl edi, 2
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov ecx, dword [ebp - 0x820]
inc dword [ebp - 0x80c]
mov dword [edi + ecx], eax
mov eax, dword [ebp - 0x820]
cmp dword [edi + eax], 0
je 0x100855d
push 0x1001848
push 0
call dword [sym.imp.msvcrt.dll_wcstok]
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x10088bd
cmp dword [ebp - 0x818], 0x800
jne 0x10087a6
xor esi, esi
jmp 0x1008829