Function at 0x406648
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffa8
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x20], ebx
mov byte [ebp - 5], cl
mov ebx, edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x406e1c
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 6], 0
mov eax, dword [ebp - 4]
mov dword [0x409838], eax
mov eax, dword [0x40824c]
mov eax, dword [eax]
mov dword [0x40983c], eax
call fcn.00404cd0
mov dword [0x409840], eax
xor eax, eax
mov dword [0x409844], eax
mov dword [0x409804], 0x4034b51
dec dword [0x409804]
mov byte [ebp - 0xd], 0
mov eax, dword [0x40824c]
mov eax, dword [eax]
xor edx, edx
call fcn.0040756c
cmp eax, 0xffffffff
jne 0x4066e9
push 0x10
push 0x406e30
push 0x406e48
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
jmp 0x406df4
push ebx
mov eax, dword [ebp - 4]
push eax
call sub.user32.dll_GetDlgItem
mov dword [ebp - 0x24], eax
mov eax, 0x102
call fcn.00402458
mov dword [ebp - 0xc], eax
xor eax, eax
push ebp
push 0x406ded
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x408230]
mov dword [eax], 0xffffffff
mov eax, dword [0x408220]
mov byte [eax], 0
cmp byte [ebp - 5], 0
je 0x406c63
push 0
push 0
push 0x184
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
jmp 0x406c63
mov eax, dword [0x40822c]
mov eax, dword [eax]
mov dword [ebp - 0x28], eax
push 0
lea eax, [ebp - 0x2c]
push eax
movzx eax, word [0x40982e]
push eax
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [0x40980c]
push eax
call sub.kernel32.dll_ReadFile
lea ecx, [ebp - 0x1c]
mov dx, word [0x40982e]
mov eax, dword [ebp - 0xc]
call fcn.00407838
cmp dword [ebp - 0x1c], 0
jne 0x4067a7
push 0x10
push 0x406e30
push 0x406e90
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
call fcn.00402ca8
jmp 0x406df4
mov eax, dword [0x408220]
cmp byte [eax], 0
jne 0x4067db
mov edx, dword [ebp - 0x1c]
mov eax, 0x406ee0
call fcn.00403574
test eax, eax
jg 0x4067d3
mov edx, dword [ebp - 0x1c]
mov eax, 0x406eec
call fcn.00403574
test eax, eax
jle 0x4067db
mov eax, dword [0x408220]
mov byte [eax], 1
cmp byte [ebp - 5], 0
je 0x4067ff
mov eax, dword [ebp - 0x1c]
call fcn.0040348c
push eax
push 0
push 0x180
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
jmp 0x406c42
mov byte [ebp - 0xd], 0
mov ax, word [0x40981a]
and ax, 1
cmp ax, 1
jne 0x406954
sub dword [0x409808], 0xc
xor eax, eax
push ebp
push 0x406948
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, 0x18
call fcn.00402458
mov dword [ebp - 0x14], eax
push 0
lea eax, [ebp - 0x2c]
push eax
push 0xc
mov ebx, dword [ebp - 0x14]
push ebx
mov eax, dword [0x40980c]
push eax
call sub.kernel32.dll_ReadFile
mov eax, dword [ebp - 0x14]
lea edx, [eax + 0xc]
mov eax, ebx
mov ecx, 0xc
call fcn.004025b4
xor eax, eax
push ebp
push 0x406937
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x408238]
cmp dword [eax], 0
je 0x4068a2
mov eax, dword [0x409822]
push eax
mov eax, dword [0x40981e]
push eax
mov eax, dword [0x408238]
mov eax, dword [eax]
push eax
mov cx, word [0x40981a]
mov dl, 0xc
mov eax, dword [ebp - 0x14]
call fcn.00407200
mov byte [ebp - 0xd], al
cmp byte [ebp - 0xd], 0
jne 0x406921
xor ebx, ebx
push 0x405a68
mov edx, 0x406ef0
xor ecx, ecx
mov eax, dword [0x409650]
call fcn.00403bac
lea ecx, [ebp - 0x50]
mov edx, dword [0x408264]
mov dx, word [edx]
mov eax, dword [0x408228]
call fcn.00407838
mov edx, dword [ebp - 0x50]
mov eax, dword [0x408238]
call fcn.004031a4
mov eax, dword [0x409822]
push eax
mov eax, dword [0x40981e]
push eax
mov eax, dword [0x408238]
mov eax, dword [eax]
push eax
mov cx, word [0x40981a]
mov dl, 0xc
mov eax, dword [ebp - 0x14]
call fcn.00407200
mov byte [ebp - 0xd], al
cmp byte [ebp - 0xd], 0
jne 0x406921
mov eax, dword [0x408228]
cmp byte [eax], 1
je 0x406921
inc ebx
cmp bl, 3
jne 0x4068aa
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40693e
mov eax, dword [ebp - 0x14]
call fcn.00402478
ret
mov byte [ebp - 0xd], 1
cmp byte [ebp - 0xd], 0
je 0x406c70
mov eax, dword [0x408258]
call fcn.00407990
call fcn.00407554
push eax
mov eax, dword [0x408258]
call fcn.004079c8
lea ecx, [ebp - 0x54]
pop edx
call fcn.00407838
push dword [ebp - 0x54]
push 0x406ee0
push dword [ebp - 0x1c]
lea eax, [ebp - 0x20]
mov edx, 3
call fcn.0040334c
mov eax, dword [ebp - 0x20]
call fcn.0040348c
mov ebx, eax
mov eax, ebx
call fcn.004076fc
test al, al
je 0x406a3c
mov eax, dword [0x408254]
mov al, byte [eax]
dec al
je 0x4069ca
dec al
je 0x4069e7
jmp 0x406a7e
mov eax, dword [0x408230]
mov eax, dword [eax]
push eax
push 0
push 0x185
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
jmp 0x406c42
lea edx, [ebp - 0x58]
mov eax, dword [ebp - 0x20]
call fcn.00407658
mov edx, dword [ebp - 0x58]
mov eax, dword [0x40823c]
call fcn.004031a4
push 0x4058a4
mov edx, 0x406ef8
xor ecx, ecx
mov eax, dword [0x409650]
call fcn.00403bac
mov eax, dword [0x408250]
cmp byte [eax], 0
jne 0x406a7e
mov eax, dword [0x408230]
mov eax, dword [eax]
push eax
push 0
push 0x185
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
jmp 0x406c42
lea edx, [ebp - 0x18]
mov eax, dword [ebp - 0x20]
call fcn.00407594
mov eax, dword [ebp - 0x18]
call fcn.004078e0
mov eax, dword [ebp - 0x18]
call fcn.0040348c
mov esi, eax
mov eax, esi
call fcn.004076fc
test al, al
jne 0x406a7e
push 0x10
push 0x406f04
push esi
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
jmp 0x406c70
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
push ebx
call sub.kernel32.dll_CreateFileA
mov dword [0x409810], eax
cmp dword [0x409810], 0xffffffff
je 0x406bfe
xor eax, eax
push ebp
push 0x406bf7
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
push ebp
push 0x406ba3
push dword fs:[eax]
mov dword fs:[eax], esp
push 1
push 0
push 0
push 0
lea eax, [ebp - 0x49]
push eax
call sub.user32.dll_PeekMessageA
lea eax, [ebp - 0x49]
push eax
call sub.user32.dll_TranslateMessage
lea eax, [ebp - 0x49]
push eax
call sub.user32.dll_DispatchMessageA
mov dword [0x4097f4], 0xffffffff
mov eax, dword [0x409826]
mov dword [0x409808], eax
cmp dword [0x40982a], 0
jle 0x406b99
mov ax, word [0x40981a]
and ax, 1
cmp ax, 1
jne 0x406b1f
sub dword [0x409808], 0xc
mov ax, word [0x40981c]
sub ax, 1
jb 0x406b33
sub ax, 7
je 0x406b3a
jmp 0x406b41
call fcn.00407448
jmp 0x406b71
call fcn.00404ce8
jmp 0x406b71
push 0x10
push 0x406e30
push 0x406f4c
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
call fcn.00402ca8
call fcn.00402ca8
jmp 0x406df4
mov eax, dword [0x4097f4]
xor eax, 0xffffffff
cmp eax, dword [0x409822]
jne 0x406b99
mov eax, dword [0x408230]
mov eax, dword [eax]
push eax
push 0
push 0x185
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x406bad
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x406c42
mov edx, dword [0x40981e]
mov eax, dword [0x409810]
call fcn.00407314
mov eax, dword [0x409810]
push eax
call sub.kernel32.dll_CloseHandle
test eax, eax
jne 0x406bf6
push 0x10
push 0x406f94
mov eax, dword [ebp - 0x20]
call fcn.0040348c
push eax
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
ret
push ebx
call sub.kernel32.dll_GetFileAttributesA
mov esi, eax
push ebx
call sub.kernel32.dll_GetFileAttributesA
and eax, 0xffffffef
cmp esi, eax
jne 0x406c2a
push 0x10
push 0x406fdc
push ebx
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
jmp 0x406c42
mov eax, dword [0x408230]
mov eax, dword [eax]
push eax
push 0
push 0x185
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
mov eax, dword [ebp - 0x28]
add eax, 0x1e
movzx edx, word [0x40982e]
add eax, edx
add eax, dword [0x409826]
xor edx, edx
call fcn.0040756c
call fcn.00406570
call fcn.004064cc
test al, al
jne 0x406745
push 0x407024
mov eax, dword [ebp - 4]
push eax
call sub.user32.dll_SetWindowTextA
cmp byte [ebp - 0xd], 0
je 0x406d7a
cmp byte [ebp - 5], 0
jne 0x406d7a
push 0
push 0
push 0x190
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
test eax, eax
jne 0x406cde
mov eax, dword [0x408240]
cmp byte [eax], 0
jne 0x406cd5
mov eax, dword [0x408234]
cmp byte [eax], 0
je 0x406cd5
push 0x40
push 0x407034
push 0x40703c
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
mov byte [ebp - 6], 1
jmp 0x406dd7
xor esi, esi
push 0
push 0
push 0x18b
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
mov edi, eax
mov eax, edi
dec eax
test al, al
jb 0x406d21
inc eax
mov byte [ebp - 0x2d], al
mov bl, 0
push 0
xor eax, eax
mov al, bl
push eax
push 0x187
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
test eax, eax
je 0x406d1b
inc esi
inc ebx
dec byte [ebp - 0x2d]
jne 0x406d01
test esi, esi
jle 0x406d47
push 0x10
push 0x406e30
push 0x407084
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
mov byte [ebp - 6], 0
jmp 0x406dd7
mov eax, dword [0x408240]
cmp byte [eax], 0
jne 0x406d74
mov eax, dword [0x408234]
cmp byte [eax], 0
je 0x406d74
push 0x40
push 0x407034
push 0x40703c
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
mov byte [ebp - 6], 1
jmp 0x406dd7
cmp byte [ebp - 5], 0
je 0x406dd7
push 0
push 0
push 0x402
mov eax, dword [0x408218]
push eax
call sub.user32.dll_SendMessageA
push 0
mov eax, dword [0x408218]
push eax
call sub.user32.dll_ShowWindow
mov byte [0x40821c], 0
push 0
push 0
push 0x18b
mov eax, dword [ebp - 0x24]
push eax
call sub.user32.dll_SendMessageA
test eax, eax
jne 0x406dd7
push 0x10
push 0x406e30
push 0x406e48
mov eax, dword [0x40825c]
mov eax, dword [eax]
push eax
call sub.user32.dll_MessageBoxA_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x406df4
mov eax, dword [ebp - 0xc]
call fcn.00402478
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x406e23
lea eax, [ebp - 0x58]
mov edx, 3
call fcn.00403174
lea eax, [ebp - 0x20]
mov edx, 3
call fcn.00403174
ret