Function at 0x4013c0
Capabilities:
Check for peb beingdebugged flag
Get file size
Get graphical window text
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x41c
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
call sym._DoCloseFile
test eax, eax
je 0x4018c5
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
push esi
call dword [sym.imp.kernel32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x4014b8
mov edi, eax
mov dword [ebp - 0x10], ebx
push 0
push eax
call dword [sym.imp.kernel32.dll_GetFileSize]
cmp eax, 0xffffffff
je 0x401518
mov ebx, eax
mov dword [ebp - 0x1c], esi
lea ecx, [eax + 2]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x228], eax
mov eax, dword [ebp - 0x228]
mov eax, dword [eax + 0x30]
push ecx
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapAlloc]
test eax, eax
je 0x40152e
mov esi, eax
lea eax, [ebp - 0x20]
push 0
push eax
push ebx
push esi
push edi
call dword [sym.imp.kernel32.dll_ReadFile]
mov ebx, eax
push edi
call dword [sym.imp.kernel32.dll_CloseHandle]
test ebx, ebx
je 0x40153f
mov ebx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x10]
cmp eax, 0xffffffff
je 0x40156f
dec eax
cmp eax, 1
ja 0x40156a
cmp ebx, 2
jb 0x40156a
movzx eax, byte [esi]
cmp eax, 0xfe
je 0x4015be
cmp eax, 0xff
jne 0x40156a
cmp byte [esi + 1], 0xfe
mov eax, dword [ebp - 0x10]
jne 0x4015c7
jmp 0x40163a
lea edi, [ebp - 0x426]
push 0xff
push edi
push 0x17b
push dword [0x40820c]
call dword [sym.imp.user32.dll_LoadStringW]
lea ebx, [ebp - 0x228]
push esi
push edi
push 0xff
push ebx
call dword [sym.imp.shlwapi.dll_wnsprintfW]
add esp, 0x10
push 0xff
push edi
push 0x171
push dword [0x40820c]
call dword [sym.imp.user32.dll_LoadStringW]
push 0x30
push edi
push ebx
push dword [0x408210]
call dword [sym.imp.user32.dll_MessageBoxW]
jmp 0x4018c5
push edi
call dword [sym.imp.kernel32.dll_CloseHandle]
add esp, 0x41c
pop esi
pop edi
pop ebx
pop ebp
jmp sym._ShowLastError
push edi
call dword [sym.imp.kernel32.dll_CloseHandle]
call sym._ShowLastError
jmp 0x4018c5
mov eax, dword fs:[0x18]
mov dword [ebp - 0x228], eax
mov eax, dword [ebp - 0x228]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
call sym._ShowLastError
jmp 0x4018c5
mov eax, dword [ebp - 0x10]
jmp 0x4015c7
cmp ebx, 3
jb 0x40158f
movzx eax, word [esi]
xor eax, 0xbbef
movzx ecx, byte [esi + 2]
xor ecx, 0xbf
or cx, ax
je 0x4016cd
mov dword [ebp - 0x228], 0x288
lea eax, [ebp - 0x228]
push eax
push ebx
push esi
call dword [sym.imp.advapi32.dll_IsTextUnicode]
mov eax, dword [ebp - 0x228]
test al, 8
jne 0x40163a
shr eax, 6
and eax, 2
jmp 0x4015c7
cmp byte [esi + 1], 0xff
mov eax, dword [ebp - 0x10]
je 0x4015e8
cmp eax, 1
je 0x40163a
cmp eax, 3
je 0x4016cd
xor ecx, ecx
mov dword [ebp - 0x10], eax
cmp eax, 2
jne 0x4016d9
cmp ebx, 2
jb 0x40163a
mov ecx, ebx
shr ecx, 1
lea edi, [ecx - 1]
mov eax, ecx
and eax, 3
xor edx, edx
cmp edi, 3
jb 0x40161e
and ecx, 0xfffffffc
xor edx, edx
rol word [esi + edx*2], 8
rol word [esi + edx*2 + 2], 8
rol word [esi + edx*2 + 4], 8
rol word [esi + edx*2 + 6], 8
add edx, 4
cmp ecx, edx
jne 0x401600
test eax, eax
je 0x40163a
lea ecx, [esi + edx*2]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
rol word [ecx + edx*2], 8
inc edx
cmp eax, edx
jne 0x401630
shr ebx, 1
mov dword [ebp - 0x10], 1
test ebx, ebx
jle 0x40175f
xor eax, eax
cmp ebx, 1
jne 0x40168c
test bl, 1
je 0x401664
cmp word [esi + eax*2], 0
jne 0x401664
mov word [esi + eax*2], 0x20
mov word [esi + ebx*2], 0
mov eax, esi
test ebx, ebx
mov ebx, dword [ebp - 0x10]
jle 0x40176a
movzx eax, word [esi]
xor ecx, ecx
cmp eax, 0xfeff
sete cl
lea eax, [esi + ecx*2]
jmp 0x40176a
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
jmp 0x4016b5
mov word [esi + eax*2], 0x20
cmp word [esi + eax*2 + 2], 0
je 0x4016c4
add eax, 2
cmp ecx, eax
je 0x401652
cmp word [esi + eax*2], 0
je 0x4016a0
cmp word [esi + eax*2 + 2], 0
jne 0x4016ae
mov word [esi + eax*2 + 2], 0x20
jmp 0x4016ae
mov ecx, 0xfde9
mov dword [ebp - 0x10], 3
push 0
push 0
push ebx
push esi
push 0
mov dword [ebp - 0x18], ecx
push ecx
call dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [ebp - 0x14], eax
lea ecx, [eax*2 + 2]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x228], eax
mov eax, dword [ebp - 0x228]
mov eax, dword [eax + 0x30]
push ecx
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapAlloc]
test eax, eax
je 0x4018d0
mov edi, eax
push dword [ebp - 0x14]
push eax
push ebx
push esi
push 0
push dword [ebp - 0x18]
call dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x228], eax
mov eax, dword [ebp - 0x228]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
mov ebx, dword [ebp - 0x14]
mov esi, edi
test ebx, ebx
jg 0x40164b
mov word [esi + ebx*2], 0
mov eax, esi
mov ebx, dword [ebp - 0x10]
push eax
push dword [0x408218]
call dword [sym.imp.user32.dll_SetWindowTextW]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x228], eax
mov eax, dword [ebp - 0x228]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
mov esi, dword [sym.imp.user32.dll_SendMessageW]
push 0
push 0
push 0xb9
push dword [0x408218]
call esi
push 0
push 0
push 0xcd
push dword [0x408218]
call esi
push dword [0x408218]
call dword [sym.imp.user32.dll_SetFocus]
lea edi, [ebp - 0x2a]
push 5
push edi
push dword [0x408218]
call dword [sym.imp.user32.dll_GetWindowTextW]
test eax, eax
je 0x4018b4
push str..LOG
push edi
call dword [sym.imp.kernel32.dll_lstrcmpW]
test eax, eax
jne 0x4018b4
push dword [0x408218]
call dword [sym.imp.user32.dll_GetWindowTextLengthW]
push 0xffffffffffffffff
push eax
push 0xb1
push dword [0x408218]
call esi
push 0x40601c
push 1
push 0xc2
push dword [0x408218]
call esi
lea ebx, [ebp - 0x426]
push ebx
call dword [sym.imp.kernel32.dll_GetLocalTime]
lea edi, [ebp - 0x228]
push 0xff
push edi
push 0
push ebx
push 2
push 0x400
call dword [sym.imp.kernel32.dll_GetTimeFormatW]
push edi
push 1
push 0xc2
push dword [0x408218]
call esi
push 0x406040
push 1
push 0xc2
push dword [0x408218]
call esi
push 0xff
push edi
push 0
push ebx
mov ebx, dword [ebp - 0x10]
push 0
push 0x400
call dword [sym.imp.kernel32.dll_GetDateFormatW]
push edi
push 1
push 0xc2
push dword [0x408218]
call esi
push 0x40601c
push 1
push 0xc2
push dword [0x408218]
call esi
push ebx
push dword [ebp - 0x1c]
call sym._SetFileNameAndEncoding
add esp, 8
call sym._UpdateWindowCaption
add esp, 0x41c
pop esi
pop edi
pop ebx
pop ebp
ret
call sym._ShowLastError
mov eax, dword fs:[0x18]
mov dword [ebp - 0x228], eax
mov eax, dword [ebp - 0x228]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
jmp 0x4018c5