Function at 0x1012a18
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
xor esi, esi
mov ebx, ecx
mov eax, dword [ebx + 0x10]
push edi
xor edi, edi
cmp eax, esi
mov dword [ebp - 4], edi
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x14], esi
mov dword [ebp - 8], esi
mov dword [ebp - 0x18], 1
je 0x1012a50
cmp dword [ebx + 0x18], esi
jne 0x1012a59
cmp dword [ebp + 0xc], esi
je 0x1012a50
cmp dword [ebp + 8], esi
jne 0x1012a62
cmp dword [ebx + 0x18], esi
je 0x1012c56
push 0xfffffffffffffffb
jmp 0x1012c5c
xor esi, esi
mov eax, dword [ebx + 0x1c]
cmp eax, dword [ebx + 0x20]
jl 0x1012aad
push esi
lea eax, [ebp - 0x10]
push eax
push 0x2000
push dword [ebx + 4]
mov dword [ebp - 0x10], esi
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, esi
jne 0x1012a9c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
jne 0x1012c0d
mov dword [ebx + 0x18], 1
mov eax, dword [ebp - 0x10]
cmp eax, esi
je 0x1012bf8
mov dword [ebx + 0x20], eax
mov dword [ebx + 0x1c], esi
cmp dword [ebx + 0x234], esi
je 0x1012ac2
mov ecx, ebx
call fcn.01012732
mov dword [ebx + 0x234], esi
cmp dword [ebp - 0x18], esi
je 0x1012b26
cmp dword [ebx + 0x230], esi
je 0x1012ae0
mov eax, dword [ebp + 8]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0xc]
add eax, 0xfffffffe
mov dword [ebp - 0xc], eax
jmp 0x1012b23
mov eax, dword [ebp + 0xc]
shr eax, 1
dec eax
dec eax
lea esi, [eax + 2]
cmp esi, dword [ebx + 0xc]
mov dword [ebp - 0xc], eax
jle 0x1012b1b
mov eax, dword [ebx + 8]
test eax, eax
je 0x1012b04
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [ebx + 8], 0
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [ebx + 8], eax
je 0x1012c11
mov dword [ebx + 0xc], esi
mov eax, dword [ebx + 8]
mov dword [ebp - 8], eax
xor esi, esi
mov dword [ebp - 0x18], esi
mov ecx, dword [ebx + 0x1c]
mov esi, dword [ebx + 4]
mov eax, dword [ebx + 0x20]
add esi, ecx
sub eax, ecx
mov ecx, dword [ebp - 0xc]
sub ecx, edi
cmp eax, ecx
mov dword [ebp - 0x10], esi
jl 0x1012b41
mov eax, ecx
lea edx, [eax + esi]
cmp esi, edx
jae 0x1012b6f
mov edx, dword [ebp - 0x10]
cmp byte [edx], 0xa
jne 0x1012b63
cmp dword [ebx + 0x230], 0
je 0x1012bc7
cmp edx, esi
je 0x1012b63
cmp byte [edx - 1], 0
je 0x1012bc7
inc edx
mov dword [ebp - 0x10], edx
lea edx, [eax + esi]
cmp dword [ebp - 0x10], edx
jb 0x1012b48
mov edx, dword [ebp - 8]
add dword [ebp - 4], eax
add edi, edx
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add dword [ebx + 0x1c], eax
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0xc]
jne 0x1012b99
mov dword [ebp - 0x14], 1
mov edi, dword [ebp - 4]
cmp dword [ebp - 0x14], 0
je 0x1012a60
mov eax, dword [ebp - 8]
add eax, edi
lea ecx, [ebx + 0x230]
xor esi, esi
mov byte [eax], 0
cmp dword [ecx], esi
je 0x1012c15
mov byte [eax + 1], 0
cmp dword [ecx], esi
je 0x1012c15
shr edi, 1
push edi
jmp 0x1012c32
xor eax, eax
cmp dword [ebx + 0x230], eax
setne al
inc eax
sub eax, esi
add eax, edx
cmp eax, ecx
jg 0x1012b9c
mov edx, dword [ebp - 8]
add edi, edx
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add dword [ebx + 0x1c], eax
add dword [ebp - 4], eax
jmp 0x1012b92
mov eax, edi
neg eax
sbb eax, eax
and eax, 6
mov dword [ebx + 0x18], 1
add eax, 0xfffffffb
jmp 0x1012c69
push 0xfffffffffffffff8
jmp 0x1012c5c
push 0xfffffffffffffffe
jmp 0x1012c5c
mov eax, dword [ebp + 0xc]
shr eax, 1
push eax
push dword [ebp + 8]
push 0xffffffffffffffff
push dword [ebx + 8]
push 1
push esi
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
cmp eax, esi
je 0x1012c41
dec eax
push eax
push dword [ebp + 8]
mov ecx, ebx
call fcn.0101282c
xor eax, eax
inc eax
jmp 0x1012c69
call dword [sym.imp.KERNEL32.dll_GetLastError]
sub eax, 0x7a
neg eax
sbb eax, eax
and eax, 3
add eax, 0xfffffffc
jmp 0x1012c69
cmp eax, esi
jne 0x1012c5f
push 0xfffffffffffffffa
pop eax
jmp 0x1012c69
xor eax, eax
cmp dword [ebx + 4], esi
setne al
dec eax
dec eax
pop edi
pop esi
pop ebx
leave
ret 8