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

Disassembly:
cmp dword [0x4050b8], 2
je 0x402006
call fcn.00402d31
jb 0x401ffa
mov edx, dword [0x41707c]
add edx, dword [0x417078]
je 0x401747
mov edi, 0x415e24
mov esi, 0x416ee4
mov ebx, dword [0x4050c0]
movzx eax, byte [esi]
mov al, byte [ebx + eax]
cmp al, byte [edi]
jne 0x401793
or al, al
je 0x401747
add esi, 1
add edi, 1
jmp 0x40177d
inc dword [0x41740a]
push 0x416ee4
push 0
push 0xc
push dword [0x405034]
call sub.user32.dll_SendMessageA
push 1
push dword [0x41740a]
push 0xfa1
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
mov esi, 0x416ee4
mov edi, 0x417202
mov byte [0x417306], 0
movzx eax, byte [esi]
inc esi
mov al, byte [eax + ebx]
cmp al, 0
je 0x4017ff
cmp al, 0x5c
jne 0x4017ee
mov edi, 0x417202
jmp 0x4017d6
cmp al, 0x2e
je 0x4017f5
stosb byte es:[edi], al
jmp 0x4017d6
mov byte [edi], 0
mov edi, 0x417306
jmp 0x4017d6
stosb byte es:[edi], al
cmp dword [0x4050b8], 2
je 0x402006
mov ecx, dword [0x4171b6]
mov dword [0x416e40], ecx
mov esi, dword [0x4050e0]
mov dword [0x4171ce], 0
mov edi, 0x417202
mov edx, dword [esi]
mov dword [0x416e3c], edx
add esi, 4
mov al, byte [esi]
inc esi
mov ah, byte [edi]
inc edi
cmp al, 0x2a
je 0x401876
cmp al, 0x3f
jne 0x40184d
or ah, ah
je 0x401876
jmp 0x401839
cmp al, ah
jne 0x401857
or al, al
je 0x401876
jmp 0x401839
dec dword [0x416e40]
je 0x401747
mov esi, dword [0x416e3c]
cmp dword [0x4171ce], 0
jne 0x40181f
mov esi, dword [esi]
jmp 0x40181f
cmp dword [0x4171ce], 0
jne 0x401896
mov dword [0x4171ce], 1
mov esi, dword [0x416e3c]
mov edi, 0x417306
jmp 0x40182e
inc dword [0x41740e]
push 0
push dword [0x41740e]
push 0xfa2
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
mov dword [0x417432], 0
mov dword [0x417436], 0
mov dword [0x417442], 0
mov dword [0x417446], 0
mov dword [0x41744a], 0
mov dword [0x41743a], 1
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push 0x416ee4
call sub.kernel32.dll_CreateFileA
cmp eax, 0xffffffff
jne 0x40191c
inc dword [0x417416]
jmp 0x401747
mov dword [0x4171d2], eax
call fcn.00401940
cmp dword [0x41742e], 0
je 0x401f6d
jmp 0x401a33
cmp dword [0x4050b8], 2
jne 0x40194f
pop eax
jmp 0x401f6d
cmp dword [0x417446], 1
jne 0x401959
ret
pushal
push 0
push 0x41742e
push 0x80000
push dword [0x405414]
push dword [0x4171d2]
call sub.kernel32.dll_ReadFile
or eax, eax
jne 0x401982
popal
pop eax
jmp 0x401f48
cmp dword [0x41742e], 0
jne 0x401997
mov dword [0x417446], 1
popal
ret
cmp dword [0x41742e], 0x80000
jae 0x4019c7
mov dword [0x417446], 1
mov eax, dword [0x405414]
add eax, dword [0x41742e]
cmp byte [eax - 1], 0xa
je 0x4019c7
mov byte [eax], 0xa
inc dword [0x41742e]
push dword [0x417432]
pop dword [0x417436]
mov eax, dword [0x41742e]
add dword [0x417432], eax
jb 0x401f6d
add eax, dword [0x405414]
mov byte [eax], 0xa
cmp dword [0x41741e], 1
je 0x401a31
mov esi, dword [0x405414]
lea esp, [esp]
mov edi, dword [0x40541c]
mov ecx, dword [0x41742e]
and ecx, 0xfffffffc
mov ebx, dword [0x405e20]
nop
nop
nop
movzx edx, word [ecx + esi + 2]
movzx eax, word [ecx + esi]
mov edx, dword [ebx + edx*2 - 2]
mov dx, word [ebx + eax*2]
mov dword [ecx + edi], edx
sub ecx, 4
jae 0x401a18
popal
ret
mov dword [0x41744e], 0
mov dword [0x41745a], 0
push dword [0x4171be]
pop dword [0x417456]
mov esi, dword [0x41742a]
mov ecx, dword [0x41742e]
cmp ecx, dword [0x4171ea]
jb 0x401f6d
mov dword [0x41743e], 0
mov edx, dword [0x4050c4]
push dword [0x4171e6]
pop dword [0x41745e]
cmp ecx, dword [0x4171e6]
jae 0x401a9b
push dword [0x4171ea]
pop dword [0x41745e]
sub ecx, dword [0x41745e]
add ecx, 1
lea esp, [esp]
add eax, 0
movzx eax, byte [esi]
cmp al, 0xa
je 0x401c45
mov edi, dword [edx + eax*4]
or edi, edi
jne 0x401aef
cmp dword [0x417456], 0
je 0x401ae1
cmp edx, dword [0x4050c4]
jne 0x401adb
mov edx, dword [0x4050c8]
jmp 0x401ab0
mov edx, dword [0x4050c4]
inc esi
dec ecx
jne 0x401ab0
push 0x401ab0
jmp 0x401b7c
mov ebx, 0
inc ebx
mov al, byte [ebx + edi]
or al, al
je 0x401b11
cmp al, byte [ebx + esi]
je 0x401af4
ja 0x401ac2
add edi, dword [0x4171e2]
mov al, byte [edi]
cmp al, byte [esi]
je 0x401aef
jmp 0x401ac2
cmp edx, dword [0x4050c8]
je 0x401c10
mov dword [0x41744e], 1
mov eax, esi
sub eax, dword [0x41742a]
add eax, dword [0x417436]
mov dword [0x41745a], eax
sub eax, dword [0x41743e]
cmp eax, 0x400
jbe 0x401b50
sub dword [0x41745a], 0x14
jmp 0x401b5a
mov eax, dword [0x41743e]
mov dword [0x41745a], eax
cmp dword [0x4171be], 0
je 0x401c24
mov edx, dword [0x4050c8]
mov dword [0x417456], 0
jmp 0x401ab0
cmp dword [0x417446], 2
je 0x401c0a
cmp dword [0x417446], 1
jne 0x401bc4
mov dword [0x417446], 2
mov eax, dword [0x41745e]
cmp eax, dword [0x4171e6]
jne 0x401bc1
add ecx, eax
sub ecx, dword [0x4171ea]
je 0x401c0a
push dword [0x4171ea]
pop dword [0x41745e]
jmp 0x401bc3
jmp 0x401c0a
ret
push esi
add ecx, dword [0x4171e6]
dec ecx
mov edi, dword [0x41742a]
sub edi, ecx
mov dword [0x417452], edi
rep movsb byte es:[edi], byte [esi]
pop esi
cmp esi, dword [0x40541c]
jb 0x401bf5
mov ecx, dword [0x4171ea]
mov edi, dword [0x405414]
sub edi, ecx
rep movsb byte es:[edi], byte [esi]
pop ebp
call fcn.00401940
push ebp
mov esi, dword [0x417452]
mov ecx, dword [0x41742e]
inc ecx
ret
pop eax
jmp 0x401f0b
mov dword [0x41744e], 0
mov dword [0x41745a], 0
cmp byte [esi], 0xa
je 0x401c45
inc esi
dec ecx
jne 0x401c24
cmp dword [0x417446], 1
jne 0x401c3e
add ecx, dword [0x41745e]
jmp 0x401c24
call 0x401b7c
jmp 0x401c24
cmp dword [0x41744e], 0
je 0x401ed0
mov dword [0x41746a], esi
mov dword [0x41746e], ecx
inc dword [0x417422]
push 0
push dword [0x417422]
push 0xfa4
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
mov eax, dword [0x41745a]
cmp eax, dword [0x417436]
jae 0x401d6c
inc dword [0x417426]
mov dword [0x41747a], 0
push 1
push 0x41747a
push 0
push dword [0x4171d2]
call sub.kernel32.dll_SetFilePointer
mov dword [0x417476], eax
cmp eax, 0xffffffff
je 0x401f48
mov eax, dword [0x41746a]
sub eax, dword [0x41742a]
add eax, dword [0x417436]
sub eax, dword [0x41745a]
mov dword [0x416e40], eax
cmp eax, 0x400
jbe 0x401cec
mov dword [0x416e40], 0x400
push 0
push 0x41747a
push dword [0x41745a]
push dword [0x4171d2]
call sub.kernel32.dll_SetFilePointer
cmp eax, 0xffffffff
je 0x401f48
mov eax, dword [0x416e40]
push 0
push 0x416e40
push eax
push dword [0x405410]
push dword [0x4171d2]
call sub.kernel32.dll_ReadFile
cmp eax, 0
je 0x401f48
push 0
push 0x41747a
push dword [0x417476]
push dword [0x4171d2]
call sub.kernel32.dll_SetFilePointer
cmp eax, 0xffffffff
je 0x401f48
mov eax, dword [0x405410]
mov dword [0x417462], eax
add eax, dword [0x416e40]
mov dword [0x417466], eax
jmp 0x401dbc
sub eax, dword [0x417436]
add eax, dword [0x405414]
mov dword [0x417462], eax
mov eax, esi
sub eax, dword [0x41742a]
add eax, dword [0x417436]
sub eax, dword [0x41745a]
cmp eax, 0x400
jbe 0x401da9
mov eax, dword [0x417462]
add eax, 0x400
mov dword [0x417466], eax
jmp 0x401db7
mov eax, esi
sub eax, dword [0x41742a]
add eax, dword [0x405414]
mov dword [0x417466], eax
mov eax, dword [0x41745a]
sub eax, dword [0x41743e]
mov dword [0x417472], eax
mov eax, 0x415e24
sub eax, dword [0x4050cc]
cmp eax, 0x520
jae 0x401de3
call fcn.00401f0d
cmp dword [0x41744a], 1
je 0x401e53
cmp dword [0x4171ee], 0
je 0x401e2a
mov edi, dword [0x4050cc]
cmp dword [0x4171fe], 1
jne 0x401e0c
mov word [edi], 0xa0d
add edi, 2
mov al, 0x22
stosb byte es:[edi], al
mov esi, 0x416ee4
lodsb al, byte [esi]
stosb byte es:[edi], al
or al, al
jne 0x401e14
mov dword [edi - 1], 0xa0d22
add edi, 2
mov dword [0x4050cc], edi
mov dword [0x41744a], 1
add dword [0x417412], 1
push 0
push dword [0x417412]
push 0xfa3
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
mov esi, dword [0x417466]
mov eax, dword [0x417462]
sub esi, eax
mov edi, dword [0x4050cc]
cmp dword [0x4171f2], 0
je 0x401e93
mov eax, dword [0x41743a]
call fcn.00402f04
mov al, 0x3a
stosb byte es:[edi], al
mov eax, dword [0x417472]
or eax, eax
je 0x401e8a
call fcn.00402f04
mov al, 0x20
stosb byte es:[edi], al
mov dword [0x4050cc], edi
mov esi, dword [0x417462]
mov eax, dword [0x417466]
movsb byte es:[edi], byte [esi]
cmp esi, eax
jne 0x401e9e
mov al, byte [edi - 1]
cmp al, 0xa
je 0x401eb4
cmp al, 0xd
je 0x401eb1
mov al, 0xd
stosb byte es:[edi], al
mov al, 0xa
stosb byte es:[edi], al
mov dword [0x4050cc], edi
mov dword [0x4171fe], 1
mov ecx, dword [0x41746e]
mov esi, dword [0x41746a]
inc dword [0x41743a]
inc esi
mov eax, esi
sub eax, dword [0x41742a]
add eax, dword [0x417436]
mov dword [0x41743e], eax
mov edx, dword [0x4050c4]
mov dword [0x41744e], 0
push dword [0x4171be]
pop dword [0x417456]
jmp 0x401ae2
jmp 0x401f6d
push str.error_reading_file
call fcn.00401180
pushal
push 0
push str.Find_All
push 0x416ee4
push 0
call sub.user32.dll_MessageBoxA
popal
inc dword [0x41741a]
push dword [0x4171d2]
call sub.kernel32.dll_CloseHandle
mov dword [0x4171d2], 0
mov eax, dword [0x41744a]
cmp eax, 0
jbe 0x401fec
push 0
push dword [0x417412]
push 0xfa3
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
push 0
push dword [0x417416]
push 0xfa6
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
push 0
push dword [0x41741a]
push 0xfa7
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
push 0
push dword [0x417426]
push 0xfa8
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
cmp dword [0x4050b8], 2
je 0x402006
jmp 0x401747
jmp 0x402006
call fcn.00402925
push 0
push dword [0x417422]
push 0xfa4
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
push 0
push dword [0x417412]
push 0xfa3
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
push 0
push dword [0x417416]
push 0xfa6
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
push 0
push dword [0x41741a]
push 0xfa7
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
push 0
push dword [0x417426]
push 0xfa8
push dword [0x416a24]
call sub.user32.dll_SetDlgItemInt
push 0x4050dc
call fcn.00401202
push 0x4050e0
call fcn.00401202
push 0x4050d8
call fcn.00401202
cmp dword [0x4171d6], 0
je 0x4020ee
call fcn.00401f0d
mov eax, dword [0x4050cc]
sub eax, 0x405e24
push 0
push 0x416e48
push eax
push 0x405e24
push dword [0x4171d6]
call sub.kernel32.dll_WriteFile
or eax, eax
je 0x4020e4
push dword [0x4171d6]
call sub.kernel32.dll_CloseHandle
or eax, eax
jne 0x4020ee
push 0x4051c1
call fcn.00401180
mov dword [0x4171d6], 0
cmp dword [0x4171d2], 0
je 0x40211a
push dword [0x4171d2]
call sub.kernel32.dll_CloseHandle
or eax, eax
jne 0x4020ee
push 0x4051c1
call fcn.00401180
push 0x4051c1
push 0
push 0xc
push dword [0x40502c]
call sub.user32.dll_SendMessageA
mov ebx, section..data
jmp 0x402142
mov eax, dword [ebx]
push 1
push eax
call sub.user32.dll_EnableWindow
add ebx, 4
cmp ebx, 0x405034
jb 0x402135
mov dword [0x4050b8], 0
push dword [0x405030]
call sub.user32.dll_SetFocus
mov esp, dword [0x4171fa]
popal
ret