Function at 0x4050e0
Capabilities:
Move file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41df91
mov eax, dword fs:[0]
push eax
sub esp, 0x1cc
mov eax, dword [0x429068]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [ebp + 8], 2
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x48], 0
jge 0x4051a7
push str.Usage:_utf8_bom_remover.exe_file_path
push 0x42a0b0
call fcn.004010d0
mov edi, eax
add esp, 8
mov ecx, dword [edi]
mov ecx, dword [ecx + 4]
mov ecx, dword [ecx + edi + 0x30]
mov esi, dword [ecx + 4]
mov ecx, esi
mov dword [ebp - 0x4c], esi
mov eax, dword [esi]
call dword [eax + 4]
lea eax, [ebp - 0x50]
mov dword [ebp - 4], 0
push eax
call fcn.00401590
add esp, 4
mov ecx, dword [eax]
push 0xa
mov edx, dword [ecx + 0x20]
mov ecx, eax
call edx
mov byte [ebp - 0x48], al
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x40518c
mov eax, dword [esi]
mov ecx, esi
mov eax, dword [eax + 8]
call eax
test eax, eax
je 0x40518c
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
push dword [ebp - 0x48]
mov ecx, edi
call fcn.00403e90
mov ecx, edi
call fcn.004036a0
mov eax, 1
jmp 0x405800
mov edx, dword [edx + 4]
xorps xmm0, xmm0
mov ecx, edx
mov dword [ebp - 0x54], 0xbfbbef
mov byte [ebp - 0x55], 0
movups xmmword [ebp - 0x40], xmm0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
lea esi, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4051d0
sub ecx, esi
push ecx
push edx
lea ecx, [ebp - 0x40]
call fcn.00401370
mov ecx, dword [ebp - 0x30]
mov eax, 0x7fffffff
sub eax, ecx
mov dword [ebp - 4], 1
mov dword [ebp - 0x48], ecx
cmp eax, 4
jb 0x40581b
cmp dword [ebp - 0x2c], 0x10
lea eax, [ebp - 0x40]
mov esi, 0xf
mov dword [ebp - 0x18], 0
cmovae eax, dword [ebp - 0x40]
lea edi, [ebp - 0x28]
mov dword [ebp - 0x4c], eax
xorps xmm0, xmm0
lea eax, [ecx + 4]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x5c], eax
movups xmmword [ebp - 0x28], xmm0
cmp eax, esi
jbe 0x40526a
mov esi, eax
or esi, 0xf
cmp esi, 0x7fffffff
jbe 0x405249
mov esi, 0x7fffffff
jmp 0x405253
mov eax, 0x16
cmp esi, eax
cmovb esi, eax
lea eax, [esi + 1]
push eax
lea ecx, [ebp - 0x28]
call fcn.004030a0
mov ecx, dword [ebp - 0x48]
mov edi, eax
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x28], edi
push ecx
push dword [ebp - 0x4c]
mov dword [ebp - 0x18], eax
push edi
mov dword [ebp - 0x14], esi
call fcn.00407950
mov eax, dword [ebp - 0x48]
mov dword [edi + eax], 0x706d745f
mov byte [edi + eax + 4], 0
cmp dword [ebp - 0x14], 0x10
lea ecx, [ebp - 0x28]
lea eax, [ebp - 0x40]
cmovae ecx, dword [ebp - 0x28]
cmp dword [ebp - 0x2c], 0x10
push ecx
cmovae eax, dword [ebp - 0x40]
push eax
call fcn.0040c275
add esp, 0x14
mov dword [ebp - 0x1d8], 0x41f3e0
mov dword [ebp - 0x160], 0
mov dword [ebp - 0x140], 0
mov dword [ebp - 0x13c], 0
mov dword [ebp - 0x138], 0
push 0
lea eax, [ebp - 0x1c8]
mov byte [ebp - 4], 3
xorps xmm0, xmm0
mov dword [ebp - 0x48], 3
push eax
lea ecx, [ebp - 0x168]
mov dword [ebp - method.std::basic_istream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_istream_char__struct_std::char_traits_char__.0
mov dword [ebp - 0x16c], 0x58
movlpd qword [ebp - 0x1d0], xmm0
call fcn.004039e0
mov eax, dword [ebp - 0x1d8]
mov dword [ebp - 4], 5
mov eax, dword [eax + 4]
mov dword [ebp + eax - method.std::basic_ifstream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ifstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0x1d8]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x70]
mov dword [ebp + ecx - 0x1dc], eax
lea ecx, [ebp - 0x1c8]
call fcn.00401720
cmp dword [ebp - 0x14], 0x10
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 6
mov esi, 4
cmovae eax, dword [ebp - 0x28]
cmp dword [ebp - 0x17c], 0
jne 0x405411
push 0x40
push 0x23
push eax
call fcn.004061d5
add esp, 0xc
test eax, eax
je 0x405411
push 1
push eax
lea ecx, [ebp - 0x1c8]
call fcn.00402a90
mov eax, dword [ebp - 0x194]
mov edi, dword [eax + 4]
mov ecx, edi
mov dword [ebp - 0x4c], edi
mov eax, dword [edi]
call dword [eax + 4]
lea eax, [ebp - 0x50]
mov byte [ebp - 4], 7
push eax
call fcn.00401420
add esp, 4
lea ecx, [ebp - 0x1c8]
push eax
call fcn.00402bd0
mov byte [ebp - 4], 6
test edi, edi
je 0x4053e4
mov eax, dword [edi]
mov ecx, edi
mov eax, dword [eax + 8]
call eax
test eax, eax
je 0x4053e4
mov ecx, dword [eax]
push 1
mov edx, dword [ecx]
mov ecx, eax
call edx
mov eax, dword [ebp - 0x1d8]
xor edx, edx
mov ecx, dword [eax + 4]
mov eax, esi
cmp dword [ebp + ecx - 0x1a0], edx
cmovne eax, edx
mov dword [ebp + ecx - 0x1cc], eax
test dword [ebp + ecx - 0x1c8], eax
jne 0x405820
jmp 0x40547a
mov eax, dword [ebp - 0x1d8]
mov ecx, dword [eax + 4]
xor eax, eax
cmp dword [ebp + ecx - 0x1a0], eax
sete al
lea eax, [eax*4 + 2]
or eax, dword [ebp + ecx - 0x1cc]
and eax, 0x17
mov dword [ebp + ecx - 0x1cc], eax
mov ecx, dword [ebp + ecx - 0x1c8]
and ecx, eax
je 0x40547a
test cl, 4
je 0x405455
mov esi, str.ios_base::badbit_set
jmp 0x405465
test cl, 2
mov esi, str.ios_base::failbit_set
mov eax, str.ios_base::eofbit_set
cmove esi, eax
lea eax, [ebp - 0x50]
push 1
push eax
call fcn.00403b60
add esp, 8
push eax
push esi
jmp 0x405834
push 0
push 3
lea eax, [ebp - 0x58]
push eax
lea ecx, [ebp - 0x1d8]
call fcn.00404010
lea ecx, [ebp - 0x54]
lea eax, [ebp - 0x58]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4054b3
test dl, dl
je 0x4054af
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4054b3
add eax, 2
add ecx, 2
test dl, dl
jne 0x405493
xor eax, eax
jmp 0x4054b8
sbb eax, eax
or eax, 1
lea ecx, [ebp - 0x1d8]
test eax, eax
jne 0x405758
sub esp, 0x18
xorps xmm0, xmm0
mov eax, esp
mov dword [eax], 3
mov dword [eax + 4], 0
mov dword [eax + 8], 0
mov dword [eax + 0xc], 0
movq qword [eax + 0x10], xmm0
call fcn.00404180
mov dword [ebp - 0x120], 0x41f3f0
mov dword [ebp - 0xb0], 0
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x88], 0
push 0
lea eax, [ebp - 0x11c]
mov byte [ebp - 4], 8
push eax
lea ecx, [ebp - 0xb8]
mov dword [ebp - 0x48], 0xb
mov dword [ebp - 0xb8], vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
mov dword [ebp - 0xbc], 0x60
call fcn.004039e0
mov eax, dword [ebp - 0x120]
mov dword [ebp - 4], 0xa
mov eax, dword [eax + 4]
mov dword [ebp + eax - method.std::basic_ofstream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0x120]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x68]
mov dword [ebp + ecx - 0x124], eax
lea ecx, [ebp - 0x11c]
call fcn.00401720
cmp dword [ebp - 0x2c], 0x10
lea eax, [ebp - 0x40]
mov byte [ebp - 4], 0xb
cmovae eax, dword [ebp - 0x40]
cmp dword [ebp - 0xd0], 0
jne 0x40568b
push 0x40
push 0x22
push eax
call fcn.004061d5
add esp, 0xc
test eax, eax
je 0x40568b
push 1
push eax
lea ecx, [ebp - 0x11c]
call fcn.00402a90
mov eax, dword [ebp - 0xe8]
mov edi, dword [eax + 4]
mov ecx, edi
mov dword [ebp - 0x4c], edi
mov eax, dword [edi]
call dword [eax + 4]
lea eax, [ebp - 0x50]
mov byte [ebp - 4], 0xc
push eax
call fcn.00401420
add esp, 4
lea ecx, [ebp - 0x11c]
push eax
call fcn.00402bd0
mov byte [ebp - 4], 0xb
test edi, edi
je 0x40561c
mov eax, dword [edi]
mov ecx, edi
mov eax, dword [eax + 8]
call eax
test eax, eax
je 0x40561c
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
mov eax, dword [ebp - 0x120]
xor edx, edx
mov ecx, dword [eax + 4]
mov eax, esi
cmp dword [ebp + ecx - 0xe8], edx
cmovne eax, edx
mov dword [ebp + ecx - 0x114], eax
test dword [ebp + ecx - 0x110], eax
jne 0x405820
nop word [eax + eax]
lea ecx, [ebp - 0x1d8]
call fcn.004037f0
cmp eax, 0xffffffff
je 0x405663
mov byte [ebp - 0x41], al
mov eax, dword [ebp - 0x1d8]
mov eax, dword [eax + 4]
test byte [ebp + eax - 0x1cc], 6
jne 0x4056d4
push 0
push 1
lea eax, [ebp - 0x41]
push eax
lea ecx, [ebp - 0x120]
call fcn.00404a60
jmp 0x405650
mov eax, dword [ebp - 0x120]
xor edx, edx
mov ecx, dword [eax + 4]
mov eax, esi
cmp dword [ebp + ecx - 0xe8], edx
cmovne eax, edx
or eax, dword [ebp + ecx - 0x114]
and eax, 0x15
or eax, 2
mov dword [ebp + ecx - 0x114], eax
mov ecx, dword [ebp + ecx - 0x110]
and ecx, eax
je 0x405650
test cl, 4
je 0x405455
mov esi, str.ios_base::badbit_set
jmp 0x405465
lea ecx, [ebp - 0x1d8]
call fcn.00403410
lea ecx, [ebp - 0x11c]
call fcn.00403330
test eax, eax
jne 0x405737
mov eax, dword [ebp - 0x120]
xor ecx, ecx
mov eax, dword [eax + 4]
cmp dword [ebp + eax - 0xe8], ecx
cmovne esi, ecx
or esi, dword [ebp + eax - 0x114]
and esi, 0x15
or esi, 2
mov dword [ebp + eax - 0x114], esi
mov eax, dword [ebp + eax - 0x110]
and eax, esi
je 0x405737
test al, 4
je 0x405730
mov esi, str.ios_base::badbit_set
jmp 0x405465
test al, 2
jmp 0x405458
cmp dword [ebp - 0x14], 0x10
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push eax
call fcn.0040c20b
add esp, 4
lea ecx, [ebp - 0x120]
call fcn.00402440
jmp 0x40577d
call fcn.00403410
cmp dword [ebp - 0x2c], 0x10
lea ecx, [ebp - 0x40]
lea eax, [ebp - 0x28]
cmovae ecx, dword [ebp - 0x40]
cmp dword [ebp - 0x14], 0x10
push ecx
cmovae eax, dword [ebp - 0x28]
push eax
call fcn.0040c275
add esp, 8
lea ecx, [ebp - 0x1d8]
call fcn.004023b0
mov ecx, dword [ebp - 0x14]
cmp ecx, 0x10
jb 0x4057bc
mov edx, dword [ebp - 0x28]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4057b2
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40584a
push ecx
push edx
call fcn.0040651c
add esp, 8
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0xf
mov byte [ebp - 0x28], 0
cmp ecx, 0x10
jb 0x4057fe
mov edx, dword [ebp - 0x40]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4057f4
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40584a
push ecx
push edx
call fcn.0040651c
add esp, 8
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040652f
mov esp, ebp
pop ebp
ret
call fcn.00403090
lea eax, [ebp - 0x50]
push 1
push eax
call fcn.00403b60
add esp, 8
push eax
push str.ios_base::badbit_set
lea ecx, [ebp - 0x70]
call fcn.00401da0
push 0x42759c
lea eax, [ebp - 0x70]
push eax
call fcn.0040752e
call fcn.0040ae0f
int3