Function at 0x40de90
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov eax, 0x3179
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov word [ebp - 0x2b], ax
mov eax, dword [0x46d7ac]
mov dword [ebp - 0x2f], 0x74706d65
mov byte [ebp - 0x29], 0
test eax, eax
je 0x40ea80
lea ebx, [ebp - 0x2f]
lea edi, [ebp - 0x38]
mov dword [esp + 8], 0x45af06
mov dword [esp], edi
mov dword [esp + 4], ebx
call eax
mov dword [esp + 4], 0x776
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
xor eax, eax
test esi, esi
mov dword [esp + 8], esi
sete al
mov dword [esp + 4], str.fopen_s_failed_with__d_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x777
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov edx, dword [ebp - 0x38]
xor eax, eax
mov dword [esp + 4], str.fopen_s_failed_to_return_value_n
test edx, edx
setne al
mov dword [esp], eax
call fcn.0044cad0
mov edx, dword [sym.imp.msvcrt.dll_fwrite]
mov eax, dword [ebp - 0x38]
mov dword [esp + 8], 1
mov dword [esp + 4], 7
mov dword [ebp - 0x44], edx
mov dword [esp + 0xc], eax
mov dword [esp], ebx
call edx
mov eax, dword [ebp - 0x38]
mov esi, dword [sym.imp.msvcrt.dll_fclose]
mov dword [esp], eax
call esi
mov dword [esp + 4], 0x77b
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x3c], eax
call fcn.0044c860
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], str.File_failed_to_close_n
cmp eax, 0xffffffff
setne al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x45af56
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_fopen]
mov dword [esp + 4], 0x77e
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x38], eax
call fcn.0044c860
mov ecx, dword [ebp - 0x38]
xor eax, eax
mov dword [esp + 4], str.fopen_failed_n
test ecx, ecx
setne al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp + 8], 7
mov dword [esp + 4], 1
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x28]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll_fread]
mov dword [ebp - 0x3c], eax
call eax
mov dword [esp + 4], 0x780
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.File_length_is__d_n
cmp eax, 7
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x782
mov dword [esp], 0x45a2c0
mov byte [ebp - 0x21], 0
call fcn.0044c860
lea edx, [ebp - 0x28]
mov dword [esp], ebx
mov dword [esp + 4], edx
call dword [sym.imp.msvcrt.dll_strcmp]
lea edx, [ebp - 0x28]
mov dword [esp + 0xc], ebx
test eax, eax
mov dword [esp + 8], edx
sete al
mov dword [esp + 4], str.File_content_mismatch__Got__s__expected__s_n
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp + 4], 0x785
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.File_failed_to_close_n
cmp eax, 0xffffffff
setne al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], edi
mov dword [esp + 8], str.w___ccsUNIcode
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x788
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fopen_s_failed_with__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x44]
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp + 0xc], eax
mov dword [esp], 0x45aa3a
call edx
mov dword [esp + 4], 0x78a
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fwrite_returned__d_n
cmp eax, 2
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp], edi
mov dword [esp + 8], 0x45af56
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x78e
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fopen_s_failed_with__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
lea ecx, [ebp - 0x28]
mov dword [esp + 8], 2
mov dword [esp], ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], 1
call eax
mov dword [esp + 4], 0x790
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.len___d_n
cmp eax, 2
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x791
mov dword [esp], 0x45a2c0
call fcn.0044c860
movzx ecx, byte [ebp - 0x27]
movzx edx, byte [ebp - 0x28]
mov dword [esp + 4], str.buff_0__02x__buff_1__02x_n
mov eax, ecx
mov dword [esp + 0xc], ecx
movzx ecx, dl
cmp al, 0xfe
mov dword [esp + 8], ecx
sete cl
xor eax, eax
cmp dl, 0xff
sete al
and eax, ecx
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp], edi
mov dword [esp + 8], str.r_ccsunicode
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x796
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fopen_s_failed_with__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
lea edx, [ebp - 0x28]
mov dword [esp + 8], 2
mov dword [esp], edx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], 1
call eax
mov dword [esp + 4], 0x798
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.len___d_n
cmp eax, 2
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x799
mov dword [esp], 0x45a2c0
call fcn.0044c860
movzx ecx, byte [ebp - 0x27]
movzx edx, byte [ebp - 0x28]
mov dword [esp + 4], str.buff_0__02x__buff_1__02x_n
mov eax, ecx
mov dword [esp + 0xc], ecx
movzx ecx, dl
test al, al
mov dword [esp + 8], ecx
sete cl
xor eax, eax
cmp dl, 0x61
sete al
and eax, ecx
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp], edi
mov dword [esp + 8], str.r_ccsutf_16le
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x79e
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fopen_s_failed_with__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
lea ecx, [ebp - 0x28]
mov dword [esp + 8], 2
mov dword [esp], ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], 1
call eax
mov dword [esp + 4], 0x7a0
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.len___d_n
cmp eax, 2
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7a1
mov dword [esp], 0x45a2c0
call fcn.0044c860
movzx ecx, byte [ebp - 0x27]
movzx edx, byte [ebp - 0x28]
mov dword [esp + 4], str.buff_0__02x__buff_1__02x_n
mov eax, ecx
mov dword [esp + 0xc], ecx
movzx ecx, dl
test al, al
mov dword [esp + 8], ecx
sete cl
xor eax, eax
cmp dl, 0x61
sete al
and eax, ecx
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp], edi
mov dword [esp + 8], str.r_ccsutf_8
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x7a6
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fopen_s_failed_with__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
lea edx, [ebp - 0x28]
mov dword [esp + 8], 2
mov dword [esp], edx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], 1
call eax
mov dword [esp + 4], 0x7a8
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.len___d_n
cmp eax, 2
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7a9
mov dword [esp], 0x45a2c0
call fcn.0044c860
movzx ecx, byte [ebp - 0x27]
movzx eax, byte [ebp - 0x28]
mov dword [esp + 4], str.buff_0__02x__buff_1__02x_n
mov edx, ecx
cmp al, 0x61
mov dword [esp + 0xc], ecx
movzx ecx, al
mov dword [esp + 8], ecx
sete cl
xor eax, eax
test dl, dl
sete al
and eax, ecx
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp], edi
mov dword [esp + 8], str.w_ccsutf_16le
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x7ae
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fopen_s_failed_with__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp], edi
mov dword [esp + 8], 0x45af56
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x7b2
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fopen_s_failed_with__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
lea ecx, [ebp - 0x28]
mov dword [esp + 8], 3
mov dword [esp], ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], 1
call eax
mov dword [esp + 4], 0x7b4
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.len___d_n
cmp eax, 2
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7b5
mov dword [esp], 0x45a2c0
call fcn.0044c860
movzx ecx, byte [ebp - 0x27]
movzx edx, byte [ebp - 0x28]
mov dword [esp + 4], str.buff_0__02x__buff_1__02x_n
mov eax, ecx
mov dword [esp + 0xc], ecx
movzx ecx, dl
cmp al, 0xfe
mov dword [esp + 8], ecx
sete cl
xor eax, eax
cmp dl, 0xff
sete al
and eax, ecx
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp], edi
mov dword [esp + 8], str.w_ccsutf_8
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x7ba
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x40], eax
call fcn.0044c860
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.fopen_s_failed_with__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov dword [esp], edi
mov dword [esp + 8], 0x45af56
mov dword [esp + 4], ebx
call dword [0x46d7ac]
mov dword [esp + 4], 0x7be
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
test edi, edi
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.fopen_s_failed_with__d_n
lea edi, [ebp - 0x28]
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], edi
mov dword [esp + 8], 4
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], 1
call eax
mov dword [esp + 4], 0x7c0
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
cmp edi, 3
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.len___d_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7c1
mov dword [esp], 0x45a2c0
call fcn.0044c860
movzx eax, byte [ebp - 0x27]
movzx edi, byte [ebp - 0x26]
mov dword [esp + 4], str.buff_0__02x__buff_1__02x__buff_2__02x_n
movzx edx, byte [ebp - 0x28]
cmp al, 0xbb
mov ecx, edi
mov dword [esp + 0x10], edi
movzx edi, al
sete al
cmp dl, 0xef
mov dword [esp + 0xc], edi
movzx edi, dl
sete dl
mov dword [esp + 8], edi
and edx, eax
xor eax, eax
cmp cl, 0xbf
sete al
and eax, edx
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x38]
mov dword [eax + 0xc], 0xfefefefe
mov dword [eax], 0xfefefefe
mov dword [eax + 4], 0xfefefefe
mov dword [eax + 8], 0xfefefefe
mov dword [eax + 0x10], 0xfefefefe
mov dword [eax + 0x14], 0xfefefefe
mov dword [eax + 0x18], 0xfefefefe
mov dword [eax + 0x1c], 0xfefefefe
mov eax, dword [ebp - 0x38]
mov dword [eax + 0xc], 0
lea eax, [ebp - 0x34]
mov dword [esp + 8], 0x45af56
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [0x46d7ac]
mov dword [esp + 4], 0x7ca
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
test edi, edi
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.fopen_s_failed_with__d_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7cb
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], str.file___file2__p__p_n
cmp edx, eax
mov dword [esp + 8], eax
sete al
mov dword [esp + 0xc], edx
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7cc
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], str.file___ptr___NULL_n
mov edi, dword [eax]
xor eax, eax
test edi, edi
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7cd
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], str.file___cnt___0_n
mov eax, dword [eax + 4]
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7ce
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], str.file___base___NULL_n
mov eax, dword [eax + 8]
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7cf
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x38]
mov eax, dword [eax + 0xc]
mov dword [esp + 4], str.file___flag___x_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7d0
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], str.file___file__0_n
mov eax, dword [eax + 0x10]
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7d1
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x38]
mov eax, dword [eax + 0x14]
mov dword [esp + 4], str.file___charbuf___x_n
cmp eax, 0xfefefefe
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7d2
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x38]
mov eax, dword [eax + 0x18]
mov dword [esp + 4], str.file___bufsiz___x_n
cmp eax, 0xfefefefe
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x7d3
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], str.file___tmpfname___NULL_n
mov eax, dword [eax + 0x1c]
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call esi
mov dword [esp + 4], 0x7d6
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__unlink]
mov dword [esp + 8], ebx
test eax, eax
mov dword [esp + 4], str.Couldnt_unlink_file_named__s_n
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], 0x771
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], str.Skipping_fopen_s_test_n
call fcn.0044cbe0
jmp 0x40ea70