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

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, 0x45b154
push esi
push ebx
sub esp, 0x7c
mov esi, dword [sym.imp.msvcrt.dll_fopen]
mov dword [esp + 4], 0x45b139
mov dword [ebp - 0x64], esi
mov dword [esp], str.ascii.tst
call esi
mov dword [esp + 8], 3
mov dword [esp + 0xc], eax
mov ebx, eax
mov dword [esp + 4], 1
mov dword [esp], 0x45b146
call sub.msvcrt.dll_fwrite
mov eax, dword [sym.imp.msvcrt.dll_fclose]
mov dword [esp], ebx
mov dword [ebp - 0x68], eax
call eax
mov dword [esp + 4], 0x45b14a
mov dword [esp], str.ascii.tst
call esi
mov dword [esp + 4], 0x187
lea esi, [ebp - 0x58]
mov dword [esp], 0x45a2c0
mov ebx, eax
call fcn.0044c860
lea eax, [ebp - 0x58]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll_fgets]
mov dword [esp + 4], 0x40
mov dword [ebp - 0x60], eax
call eax
mov dword [esp + 4], str.fgets_n
test eax, eax
setne al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x188
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov ecx, 3
repe cmpsb byte [esi], byte es:[edi]
mov dword [esp + 4], str.CR_CR_LF_not_read_as_CR_LF_n
seta al
sbb al, 0
test al, al
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [sym.imp.msvcrt.dll_rewind]
mov dword [esp], ebx
mov dword [ebp - 0x6c], eax
call eax
mov dword [esp + 4], 0x18a
mov dword [esp], 0x45a2c0
call fcn.0044c860
lea eax, [ebp - 0x58]
mov dword [esp + 0xc], ebx
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll_fread]
mov dword [esp + 8], 0x40
mov dword [esp + 4], 1
mov dword [ebp - 0x70], eax
call eax
xor edx, edx
cmp eax, 2
jne 0x40ec44
mov ecx, 3
lea esi, [ebp - 0x58]
mov edi, 0x45b154
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
xor edx, edx
test al, al
sete dl
mov dword [esp], edx
mov dword [esp + 4], str.CR_CR_LF_not_read_as_CR_LF_n
call fcn.0044cad0
mov esi, dword [ebp - 0x68]
mov dword [esp], ebx
call esi
mov eax, dword [sym.imp.msvcrt.dll__unlink]
mov dword [esp], str.ascii.tst
mov dword [ebp - 0x74], eax
call eax
mov edi, dword [ebp - 0x64]
mov dword [esp], str.ascii.tst
mov dword [esp + 4], 0x45b139
call edi
mov dword [esp + 8], 4
mov dword [esp + 0xc], eax
mov ebx, eax
mov dword [esp + 4], 1
mov dword [esp], 0x45b173
call sub.msvcrt.dll_fwrite
mov eax, dword [sym.imp.msvcrt.dll_fseek]
mov dword [esp], ebx
mov dword [esp + 8], 0
mov dword [esp + 4], 0x10000
mov dword [ebp - 0x5c], eax
call eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 3
mov dword [esp + 4], 1
mov dword [esp], 0x45b178
call sub.msvcrt.dll_fwrite
mov dword [esp], ebx
call esi
mov dword [esp + 4], 0x45b14a
lea esi, [ebp - 0x58]
mov dword [esp], str.ascii.tst
call edi
mov dword [esp + 4], 0x195
mov edi, 0x45b187
mov dword [esp], 0x45a2c0
mov ebx, eax
call fcn.0044c860
lea eax, [ebp - 0x58]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov eax, dword [ebp - 0x60]
mov dword [esp + 4], 0x40
call eax
mov dword [esp + 4], str.fgets_foo_n
test eax, eax
setne al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x196
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov ecx, 4
repe cmpsb byte [esi], byte es:[edi]
mov dword [esp + 4], str.foo_Z_not_read_as_foo_by_fgets_n
seta al
sbb al, 0
test al, al
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x197
mov dword [esp], 0x45a2c0
call fcn.0044c860
lea edx, [ebp - 0x58]
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x60]
mov dword [esp], edx
mov dword [esp + 4], 0x40
call eax
mov dword [esp + 4], str.fgets_after_logical_EOF_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x6c]
mov dword [esp], ebx
call eax
mov dword [esp + 4], 0x199
mov dword [esp], 0x45a2c0
call fcn.0044c860
lea eax, [ebp - 0x58]
mov dword [esp + 0xc], ebx
mov dword [esp], eax
mov eax, dword [ebp - 0x70]
mov dword [esp + 8], 0x40
mov dword [esp + 4], 1
call eax
xor edx, edx
cmp eax, 3
jne 0x40ee1b
mov ecx, 4
lea esi, [ebp - 0x58]
mov edi, 0x45b187
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
xor edx, edx
test al, al
sete dl
mov dword [esp], edx
mov dword [esp + 4], str.foo_Z_not_read_as_foo_by_fread_n
call fcn.0044cad0
mov dword [esp + 4], 0x19a
mov dword [esp], 0x45a2c0
call fcn.0044c860
lea eax, [ebp - 0x58]
mov dword [esp + 0xc], ebx
mov dword [esp], eax
mov eax, dword [ebp - 0x70]
mov dword [esp + 8], 0x40
mov dword [esp + 4], 1
call eax
mov dword [esp + 4], str.fread_after_logical_EOF_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov esi, dword [ebp - 0x68]
mov dword [esp], ebx
call esi
mov edi, dword [ebp - 0x64]
mov dword [esp], str.ascii.tst
mov dword [esp + 4], 0x45b139
call edi
mov dword [esp + 8], 0x1e
mov dword [esp + 0xc], eax
mov ebx, eax
mov dword [esp + 4], 1
mov dword [esp], str.0_r_n1_r_n2_r_n3_r_n4_r_n5_r_n6_r_n7_r_n8_r_n9_r_n
call sub.msvcrt.dll_fwrite
mov dword [esp], ebx
call esi
mov dword [esp + 4], 0x45af56
mov dword [esp], str.ascii.tst
call edi
mov esi, dword [sym.imp.msvcrt.dll_fgetc]
mov ebx, eax
mov dword [esp], eax
call esi
mov dword [esp + 4], 0x1a4
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
cmp edi, 0x30
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.fgetc_failed__expected_0__got__c_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
call esi
mov dword [esp + 4], 0x1a6
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
cmp edi, 0xa
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.fgetc_failed__expected__n__got__c_n
mov edi, 1
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 0
mov dword [esp], ebx
call eax
lea esi, [esi]
mov dword [esp + 4], 0x1a9
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_ftell]
lea ecx, [edi + edi*2]
mov dword [esp + 4], str.ftell_fails_in_TEXT_mode_n
cmp ecx, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 0
mov dword [esp], ebx
call eax
mov dword [esp + 4], 0x1ab
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], ebx
call esi
lea ecx, [edi + 0x30]
mov dword [esp + 8], edi
cmp ecx, eax
mov dword [esp + 4], str.fgetc_after_fseek_failed_in_line__d_n
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
call esi
mov dword [esp + 4], 0x1ad
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x60], eax
call fcn.0044c860
mov eax, dword [ebp - 0x60]
mov dword [esp + 4], str.fgetc_failed__expected__n__got__c_n
cmp eax, 0xa
mov dword [esp + 8], eax
sete al
add edi, 1
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
cmp edi, 0xa
jne 0x40ef60
mov eax, dword [ebp - 0x6c]
mov dword [esp], ebx
call eax
mov dword [esp], ebx
call esi
mov dword [esp + 4], 0x1b2
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
cmp edi, 0x30
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.fgetc_failed__expected_0__got__c_n
mov edi, 1
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 2
mov dword [esp], ebx
call eax
lea esi, [esi]
mov dword [esp + 4], 0x1b5
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], ebx
call esi
lea ecx, [edi + 0x30]
mov dword [esp + 8], edi
cmp ecx, eax
mov dword [esp + 4], str.fgetc_after_fseek_with_pos_Offset_failed_in_line__d_n
sete al
add edi, 1
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 2
mov dword [esp], ebx
call eax
cmp edi, 0xa
jne 0x40f090
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 0x1b
mov dword [esp], ebx
call eax
mov dword [esp], ebx
call esi
mov dword [esp + 4], 0x1ba
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
cmp edi, 0x39
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.fgetc_failed__expected_9__got__c_n
mov edi, 8
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 0xfffffffc
mov dword [esp], ebx
call eax
mov dword [esp + 4], 0x1bd
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], ebx
call esi
lea ecx, [edi + 0x30]
mov dword [esp + 8], edi
cmp ecx, eax
mov dword [esp + 4], str.fgetc_after_fseek_with_neg_Offset_failed_in_line__d_n
sete al
sub edi, 1
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 0xfffffffc
mov dword [esp], ebx
call eax
cmp edi, 0xffffffff
jne 0x40f154
mov edi, dword [ebp - 0x68]
mov dword [esp], ebx
call edi
mov dword [esp + 4], 0x45af56
mov eax, dword [ebp - 0x64]
mov dword [esp], str.ascii.tst
call eax
mov dword [esp + 8], 0
mov ebx, eax
mov dword [esp], eax
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 3
call eax
mov dword [esp + 4], 0x1c4
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], ebx
call esi
mov dword [esp + 4], str.fgetc_fails_to_read_next_char_when_positioned_on__r_n
cmp eax, 0x31
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
call edi
mov dword [esp], str.ascii.tst
mov eax, dword [ebp - 0x74]
call eax
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret