Function at 0x417290
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov edx, dword [ebp + 8]
mov ecx, dword [ebp + 8]
movzx eax, byte [edx + 0x50]
mov dl, al
and dl, 3
cmp dl, 2
sete dl
movzx edx, dl
mov dword [ebp - 0x50], edx
or al, 0x43
xor esi, esi
mov byte [ecx + 0x50], al
mov eax, dword [0x42af60]
test eax, eax
je 0x417314
movzx edi, word [ecx + 0x4c]
test di, di
mov word [ebp - 0x52], di
jne 0x41731f
mov edx, dword [ecx + 0x10]
test edx, edx
je 0x4172f9
mov eax, dword [edx + 0x18]
test eax, eax
je 0x4172f9
mov ecx, dword [edx + 0xc]
xor eax, eax
cmp ecx, 0
jbe 0x41731f
mov ebx, dword [edx + 0x14]
jmp 0x4172f3
inc eax
cmp ecx, eax
jbe 0x41731f
test byte [eax + ebx], 1
jne 0x4172ee
mov eax, dword [ebp + 8]
test byte [eax + 0x51], 2
je 0x4174e7
mov word [eax + 0x4c], 0
mov word [ebp - 0x52], 0
jmp 0x41731f
mov eax, dword [ebp + 8]
movzx eax, word [eax + 0x4c]
mov word [ebp - 0x52], ax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x2c]
mov eax, dword [ecx + 0x28]
mov edi, edx
or edi, eax
jne 0x41733a
mov eax, dword [ecx + 0x20]
mov edx, dword [ecx + 0x24]
mov dword [ecx + 0x28], eax
mov dword [ecx + 0x2c], edx
mov eax, dword [ebp - 0x50]
test eax, eax
je 0x417461
mov edi, dword [ebp + 8]
test byte [edi + 0x51], 2
jne 0x417461
mov edi, dword [0x42a3f4]
test edi, edi
jne 0x417370
mov esi, dword [0x42b020]
test esi, esi
je 0x4174a1
lea esi, [esi]
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x10]
mov eax, dword [edx + 0xc]
test eax, eax
jle 0x41738c
mov edx, dword [edx + 0x14]
test byte [edx + eax - 1], 1
je 0x41738c
dec eax
test eax, eax
jg 0x417380
test eax, eax
jne 0x4174c7
xor eax, eax
xor edx, edx
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x20], eax
mov dword [ecx + 0x24], edx
mov edi, dword [ebp + 8]
mov edi, dword [edi + 0x48]
test edi, edi
mov dword [ebp - 0x5c], edi
je 0x417410
mov eax, dword [ebp + 8]
mov ecx, edi
mov ebx, dword [eax + 0x20]
mov esi, dword [eax + 0x24]
lea esi, [esi]
test byte [ecx + 0x50], 0x40
je 0x417494
mov edx, esi
or edx, ebx
je 0x4173f4
mov edx, dword [ecx + 0x24]
mov eax, dword [ecx + 0x20]
mov edi, edx
or edi, eax
je 0x4173f0
cmp edx, esi
ja 0x4173f0
jb 0x4173f4
cmp eax, ebx
jbe 0x4173f4
lea esi, [esi]
lea edi, [edi]
mov ebx, eax
mov esi, edx
mov ecx, dword [ecx + 0x30]
test ecx, ecx
jne 0x4173c0
mov ecx, dword [ebp - 0x5c]
jmp 0x417409
mov dword [ecx + 0x20], ebx
mov dword [ecx + 0x24], esi
mov ecx, dword [ecx + 0x30]
test ecx, ecx
jne 0x417400
lea esi, [esi]
mov edx, dword [ebp - 0x50]
test edx, edx
je 0x417485
cmp word [ebp - 0x52], 0xffff
je 0x4174d6
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x1c]
nop
lea esi, [esi]
test ebx, ebx
je 0x41748c
mov eax, dword [ebx + 0xc]
or byte [eax + 0x50], 3
mov eax, dword [ebx + 0xc]
or byte [eax + 0x50], 0x40
mov ecx, dword [ebp + 8]
mov edx, dword [ebx + 0xc]
movzx eax, word [ecx + 0x4c]
mov word [edx + 0x4c], ax
mov eax, dword [ebp - 0x50]
test eax, eax
je 0x41745d
test byte [edx + 0x51], 2
je 0x417470
mov ebx, dword [ebx]
jmp 0x417430
test esi, esi
je 0x4173a1
jmp 0x417352
xor eax, eax
mov dword [esp + 4], eax
mov eax, dword [ebx + 0xc]
mov dword [esp], eax
call fcn.00416ad0
mov ebx, dword [ebx]
jmp 0x417430
cmp word [ebp - 0x52], 0xffff
je 0x4174d6
add esp, 0x6c
pop ebx
pop esi
pop edi
pop ebp
ret
test ecx, ecx
jne 0x417410
jmp 0x4173fb
mov ebx, dword [0x42af60]
test ebx, ebx
jne 0x417370
mov edx, dword [ebp + 8]
test byte [edx + 0x50], 0x80
je 0x417394
mov ecx, dword [edx + 0x10]
test ecx, ecx
jne 0x417394
mov eax, 0xffffffff
mov edx, 0xffffffff
jmp 0x417398
mov edi, dword [ebp + 8]
mov word [edi + 0x4c], 0
add esp, 0x6c
pop ebx
pop esi
pop edi
pop ebp
ret
test edx, edx
je 0x41731f
mov eax, dword [0x42afa0]
test eax, eax
je 0x41752d
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
mov dword [esp], eax
call fcn.004012f0
test eax, eax
je 0x41754d
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov dword [esp], eax
call fcn.00401510
inc dword [0x42a890]
mov esi, 1
mov edi, dword [ebp + 8]
mov word [edi + 0x4c], ax
jmp 0x41731b
mov edx, dword [ebp + 8]
mov edi, str.touch__s
mov eax, dword [edx]
mov dword [esp + 4], edi
mov dword [esp], 0
mov dword [esp + 8], eax
call fcn.00411940
jmp 0x4174f8
mov esi, 0x1b6
mov ebx, 0x102
mov dword [esp + 8], esi
lea esi, [ebp - 0x48]
mov dword [esp + 4], ebx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [esp], eax
call sub.msvcrt.dll__open
test eax, eax
mov ebx, eax
js 0x417653
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.msvcrt.dll__fstat
cmp eax, 0xffffffff
jne 0x4175b3
call sub.msvcrt.dll__errno
cmp dword [eax], 4
je 0x417579
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov dword [esp], str.touch:_fstat:
mov dword [esp + 4], eax
call fcn.00411c10
mov eax, 1
jmp 0x417516
test eax, eax
js 0x417594
mov dword [esp], ebx
mov ecx, 1
lea esi, [ebp - 0x49]
mov dword [esp + 8], ecx
mov dword [esp + 4], esi
call sub.msvcrt.dll__read
test eax, eax
js 0x417668
mov dword [esp], ebx
xor edx, edx
xor eax, eax
mov dword [esp + 8], edx
mov dword [esp + 4], eax
call sub.msvcrt.dll__lseek
test eax, eax
js 0x41767d
mov dword [esp + 4], esi
mov eax, 1
mov dword [esp + 8], eax
mov dword [esp], ebx
call sub.msvcrt.dll__write
test eax, eax
js 0x417692
mov eax, dword [ebp - 0x34]
test eax, eax
jne 0x417644
mov dword [esp], ebx
call sub.msvcrt.dll__close
mov eax, 0x1b6
mov dword [esp + 8], eax
mov eax, 0x202
mov dword [esp + 4], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [esp], eax
call sub.msvcrt.dll__open
test eax, eax
mov ebx, eax
js 0x417653
mov dword [esp], ebx
call sub.msvcrt.dll__close
xor eax, eax
jmp 0x417516
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
mov dword [esp], str.touch:_open:
mov dword [esp + 4], eax
jmp 0x4175a4
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [esp], str.touch:_read:
mov dword [esp + 4], eax
jmp 0x4175a4
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
mov dword [esp], str.touch:_lseek:
mov dword [esp + 4], eax
jmp 0x4175a4
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov dword [esp], str.touch:_write:
mov dword [esp + 4], eax
jmp 0x4175a4