Function at 0x402610
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x101c
call fcn.0041bfa0
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x1008], edi
cmp dword [edi + 0x2c], 0
jne 0x402cbc
mov ecx, dword [edi + 0xc]
test ecx, ecx
je 0x402cbc
mov eax, dword [edi + 0x10]
test eax, eax
jns 0x40265f
push 0x8000
push ecx
call fcn.00409554
add esp, 8
mov dword [edi + 0x10], eax
lea eax, [eax*2 + 2]
push eax
call fcn.0040f4ae
mov esi, eax
add esp, 4
test esi, esi
jne 0x40268b
pop edi
pop esi
mov eax, 0x68
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x10]
push eax
push dword [edi + 0xc]
inc eax
push eax
push esi
call fcn.0040f587
add esp, 0x10
push 0
push 0
push 3
push 0
push 7
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4026e8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str._Failed_to_open__s_for_shebang_parsing__0x_08X__n
call fcn.004010f0
push esi
call fcn.0040f3ca
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
push 0
lea eax, [ebp - 0x1010]
mov dword [ebp - 0x1010], 0
push eax
push 0x1000
lea eax, [ebp - 0x1004]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402740
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str._Failed_to_read__s_for_shebang_parsing__0x_08X__n
call fcn.004010f0
push esi
call fcn.0040f3ca
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
push dword [ebp - 0x1010]
push str._Read__d_bytes_from__s_to_find_shebang_line_n
call fcn.004010f0
push esi
call fcn.0040f3ca
mov eax, dword [ebp - 0x1010]
add esp, 0x10
cmp eax, 2
jbe 0x402caf
cmp byte [ebp - 0x1004], 0x23
jne 0x402caf
cmp byte [ebp - 0x1003], 0x21
jne 0x402caf
lea esi, [ebp - 0x1003]
dec eax
sub eax, 1
mov dword [ebp - 0x1010], eax
je 0x4027b4
movsx eax, byte [esi + 1]
inc esi
push eax
call fcn.0040f3f0
add esp, 4
test eax, eax
mov eax, dword [ebp - 0x1010]
jne 0x402791
mov edx, esi
mov dword [ebp - 0x100c], edx
nop dword [eax]
add eax, 0xffffffff
je 0x4027d3
mov cl, byte [esi + 1]
inc esi
cmp cl, 0xd
je 0x4027d3
cmp cl, 0xa
jne 0x4027c0
xor ebx, ebx
mov dword [ebp - 0x1010], eax
test eax, eax
mov dword [ebp - 0x1014], 0xfde9
push 0
sete bl
push 0
sub ebx, edx
add ebx, esi
push ebx
push edx
push 8
push 0xfde9
mov dword [ebp - 0x101c], ebx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, eax
test esi, esi
jne 0x402855
push eax
push eax
push ebx
push dword [ebp - 0x100c]
mov dword [ebp - 0x1014], eax
push 8
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, eax
test esi, esi
jne 0x402855
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._Failed_to_decode_shebang_line__0x_08X__n
call fcn.004010f0
add esp, 8
mov eax, 0x66
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
lea eax, [esi*2 + 6]
push eax
call fcn.0040f4ae
add esp, 4
test eax, eax
je 0x402675
mov ecx, dword [edi + 0x40]
lea ebx, [eax + 4]
mov dword [eax], ecx
mov dword [edi + 0x40], eax
test ebx, ebx
je 0x402675
lea eax, [esi + 1]
push eax
push ebx
push dword [ebp - 0x101c]
push dword [ebp - 0x100c]
push 0
push dword [ebp - 0x1014]
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov edi, eax
mov dword [ebp - 0x100c], edi
test edi, edi
je 0x40282b
xor eax, eax
push ebx
push str.Shebang:__s_n
mov word [ebx + edi*2], ax
call fcn.004010f0
mov ecx, dword [ebp - 0x1008]
mov edx, ebx
push edi
call fcn.00401fb0
add esp, 0xc
cmp eax, 0x71
jne 0x402cbe
mov edi, dword [str._usr_bin_env]
mov dword [ebp - str._usr_bin_env], 0x4279c0
test edi, edi
je 0x402cbc
push 0x8000
push edi
call fcn.00409554
mov esi, eax
add esp, 8
mov eax, dword [ebp - 0x100c]
cmp eax, esi
jl 0x4029ae
lea ecx, [ebx + esi*2]
mov dword [ebp - 0x1018], ecx
mov ecx, eax
mov dword [ebp - 0x101c], ecx
test ebx, ebx
je 0x4029ae
test edi, edi
je 0x4029ae
test esi, esi
jns 0x40294d
push 0x8000
push edi
call fcn.00409554
mov ecx, dword [ebp - 0x101c]
mov esi, eax
mov eax, dword [ebp - 0x100c]
add esp, 8
test eax, eax
jns 0x402967
push 0x8000
push ebx
call fcn.00409554
mov ecx, eax
add esp, 8
mov eax, dword [ebp - 0x100c]
cmp ecx, esi
jl 0x4029a8
test esi, esi
je 0x4029da
push 0
push 0
push 0
push esi
push edi
push esi
push ebx
push 0
push 0x422a6c
call dword [sym.imp.KERNEL32.dll_CompareStringEx]
sub eax, 1
je 0x4029a8
sub eax, 1
je 0x4029e0
sub eax, 1
je 0x4029a8
push edi
push esi
push ebx
push esi
push str.Error_comparing__.s_and__.s__compareArgument_
push 0
call fcn.004011c0
add esp, 0x18
xor al, al
test al, al
jne 0x4029e4
mov eax, dword [ebp - 0x1014]
add eax, 4
mov dword [ebp - 0x1014], eax
mov edi, dword [eax]
test edi, edi
jne 0x4028ee
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x100c], eax
mov al, 1
jmp 0x4029aa
mov ebx, dword [ebp - 0x1018]
xor esi, esi
movzx eax, word [ebx]
mov ecx, eax
test ax, ax
je 0x402cbc
nop word [eax + eax]
movzx eax, cx
push eax
call fcn.0040f3f0
add esp, 4
test eax, eax
jne 0x402a1d
movzx eax, word [ebx + esi*2 + 2]
inc esi
mov ecx, eax
test ax, ax
jne 0x402a00
test esi, esi
je 0x402cbc
mov ecx, dword [ebp - 0x1008]
mov edx, ebx
push esi
call fcn.00402550
add esp, 4
test al, al
je 0x402a76
mov ecx, dword [ebp - 0x1008]
lea eax, [ebx + esi*2]
mov edi, dword [ebp - 0x100c]
sub edi, esi
push dword [ecx + 8]
mov dword [ecx + 0x1c], eax
push ebx
push esi
push str._Treating_shebang_command__.s_as__s_n
mov dword [ecx + 0x20], edi
call fcn.004010f0
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
push 0x8000
push str.python
call fcn.00409554
mov edi, eax
add esp, 8
cmp esi, edi
jl 0x402c8d
mov eax, esi
test ebx, ebx
je 0x402c8d
test edi, edi
jns 0x402ab6
push 0x8000
push str.python
call fcn.00409554
mov edi, eax
add esp, 8
mov eax, esi
test esi, esi
jns 0x402ac8
push 0x8000
push ebx
call fcn.00409554
add esp, 8
cmp eax, edi
jl 0x402b19
test edi, edi
je 0x402c49
push 0
push 0
push 0
push edi
push str.python
push edi
push ebx
push 0
push 0x422a6c
call dword [sym.imp.KERNEL32.dll_CompareStringEx]
sub eax, 1
je 0x402b19
sub eax, 1
je 0x402c49
sub eax, 1
je 0x402b19
push str.python
push edi
push ebx
push edi
push str.Error_comparing__.s_and__.s__compareArgument_
push 0
call fcn.004011c0
add esp, 0x18
xor al, al
mov edi, dword [ebp - 0x100c]
test al, al
je 0x402c8d
mov ecx, dword [ebp - 0x1008]
lea eax, [esi - 6]
lea edx, [ebx + 0xc]
mov dword [ebp - 0x1018], edx
mov dword [ecx + 0x2c], edx
mov dword [ecx + 0x30], eax
cmp eax, 4
jle 0x402ba0
add eax, 0xfffffffc
lea eax, [edx + eax*2]
test eax, eax
je 0x402ba0
push 1
push 0xffffffffffffffff
push str..exe
push 4
push eax
call dword [sym.imp.KERNEL32.dll_CompareStringOrdinal]
sub eax, 1
je 0x402b9a
sub eax, 1
je 0x402c50
sub eax, 1
je 0x402b9a
mov ecx, dword [ebp - 0x1018]
push str..exe
add ecx, 0xffffffec
push 0xffffffffffffffff
lea eax, [ecx + esi*2]
push eax
push 4
push str.Error_comparing__.s_and__.s__comparePath_
push 0
call fcn.004011c0
add esp, 0x18
mov ecx, dword [ebp - 0x1008]
mov edx, dword [ecx + 0x30]
cmp edx, 2
jle 0x402c02
mov eax, dword [ecx + 0x2c]
lea eax, [eax + edx*2]
add eax, 0xfffffffc
mov dword [ebp - 0x1018], eax
je 0x402c02
push 1
push 0xffffffffffffffff
push 0x4235dc
push 2
push eax
call dword [sym.imp.KERNEL32.dll_CompareStringOrdinal]
sub eax, 1
je 0x402bfc
sub eax, 1
je 0x402c5f
sub eax, 1
je 0x402bfc
push 0x4235dc
push 0xffffffffffffffff
push dword [ebp - 0x1018]
push 2
push str.Error_comparing__.s_and__.s__comparePath_
push 0
call fcn.004011c0
add esp, 0x18
mov ecx, dword [ebp - 0x1008]
lea eax, [ebx + esi*2]
mov byte [ecx + 0x34], 1
mov dword [ecx + 0x1c], eax
sub edi, esi
mov eax, dword [ebp - 0x1008]
mov ecx, dword [eax + 0x2c]
mov dword [eax + 0x20], edi
test ecx, ecx
je 0x402c6b
mov eax, dword [eax + 0x30]
test eax, eax
je 0x402c6b
push ecx
push eax
push ebx
push esi
push str._Treating_shebang_command__.s_as_py___.s_n
call fcn.004010f0
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
mov al, 1
jmp 0x402b1b
mov ecx, dword [ebp - 0x1008]
add dword [ecx + 0x30], 0xfffffffc
jmp 0x402ba0
mov ecx, dword [ebp - 0x1008]
add dword [ecx + 0x30], 0xfffffffe
jmp 0x402c02
push ebx
push esi
push str._Treating_shebang_command__.s_as_py_n
call fcn.004010f0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
push ebx
push esi
push str._Found_shebang_command_but_could_not_execute_it:__.s_n
call fcn.004010f0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405fcc
mov esp, ebp
pop ebp
ret
push str._No_valid_shebang_line
call fcn.004010f0
add esp, 4
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00405fcc
mov esp, ebp
pop ebp
ret