Function at 0x402810
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1024
call fcn.00421fc0
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
push esi
push edi
mov dword [ebp - 0x1020], ebx
cmp dword [ebx + 0x2c], 0
jne 0x402e28
mov ecx, dword [ebx + 0xc]
test ecx, ecx
je 0x402e28
mov eax, dword [ebx + 0x10]
test eax, eax
jns 0x40285f
push 0x8000
push ecx
call fcn.00409a24
add esp, 8
mov dword [ebx + 0x10], eax
lea eax, [eax*2 + 2]
push eax
call fcn.0041528e
mov esi, eax
add esp, 4
test esi, esi
jne 0x40288b
mov eax, 0x68
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040649c
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x10]
push eax
push dword [ebx + 0xc]
inc eax
push eax
push esi
call fcn.00415367
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 edi, eax
cmp edi, 0xffffffff
jne 0x4028da
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.00401130
add esp, 0xc
push esi
call fcn.004151ab
jmp 0x402e25
push 0
lea eax, [ebp - 0x1014]
mov dword [ebp - 0x1014], 0
push eax
push 0x1000
lea eax, [ebp - 0x1008]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402924
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.00401130
add esp, 0xc
push esi
call fcn.004151ab
jmp 0x402e25
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
push dword [ebp - 0x1014]
push str._Read__d_bytes_from__s_to_find_shebang_line_n
call fcn.00401130
add esp, 0xc
push esi
call fcn.004151ab
mov eax, dword [ebp - 0x1014]
add esp, 4
cmp eax, 2
jbe 0x402e1b
cmp byte [ebp - 0x1008], 0x23
jne 0x402e1b
cmp byte [ebp - 0x1007], 0x21
jne 0x402e1b
lea esi, [ebp - 0x1007]
dec eax
nop dword [eax + eax]
sub eax, 1
mov dword [ebp - 0x1014], eax
je 0x4029a3
movsx eax, byte [esi + 1]
inc esi
push eax
call fcn.004151d0
add esp, 4
test eax, eax
mov eax, dword [ebp - 0x1014]
jne 0x402980
mov edi, esi
mov dword [ebp - 0x1010], edi
nop dword [eax + eax]
add eax, 0xffffffff
je 0x4029c3
mov cl, byte [esi + 1]
inc esi
cmp cl, 0xd
je 0x4029c3
cmp cl, 0xa
jne 0x4029b0
xor ecx, ecx
mov dword [ebp - 0x1014], eax
test eax, eax
mov dword [ebp - 0x101c], 0xfde9
push 0
sete cl
push 0
sub ecx, edi
add ecx, esi
push ecx
push edi
push 8
push 0xfde9
mov dword [ebp - 0x1018], ecx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, dword [ebp - 0x1018]
mov dword [ebp - 0x100c], eax
test eax, eax
jne 0x402a4e
push eax
push eax
push esi
push edi
push 8
push eax
mov dword [ebp - 0x101c], eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x100c], eax
test eax, eax
jne 0x402a4e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._Failed_to_decode_shebang_line__0x_08X__n
call fcn.00401130
add esp, 8
mov eax, 0x66
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040649c
mov esp, ebp
pop ebp
ret
lea eax, [eax*2 + 6]
push eax
call fcn.0041528e
add esp, 4
test eax, eax
je 0x402875
mov ecx, dword [ebx + 0x44]
lea edi, [eax + 4]
mov dword [eax], ecx
mov dword [ebx + 0x44], eax
test edi, edi
je 0x402875
mov eax, dword [ebp - 0x100c]
inc eax
push eax
push edi
push esi
push dword [ebp - 0x1010]
push 0
push dword [ebp - 0x101c]
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, eax
test esi, esi
je 0x402a24
xor eax, eax
push edi
push str.Shebang:__s_n
mov word [edi + esi*2], ax
call fcn.00401130
push esi
mov edx, edi
mov ecx, ebx
call fcn.00401fa0
add esp, 0xc
cmp eax, 0x71
jne 0x402e2a
mov eax, dword [str._usr_bin_env_python]
mov dword [ebp - str._usr_bin_env_python], 0x42ea00
mov dword [ebp - 0x100c], eax
test eax, eax
je 0x402bc5
push 0x8000
push eax
call fcn.00409a24
mov ecx, eax
add esp, 8
mov eax, dword [ebp - 0x100c]
mov dword [ebp - 0x1018], ecx
cmp esi, ecx
jl 0x402ba6
mov edx, esi
mov ebx, ecx
mov dword [ebp - 0x1010], edx
test edi, edi
je 0x402ba6
test eax, eax
je 0x402ba6
test ecx, ecx
jns 0x402b35
push 0x8000
push eax
call fcn.00409a24
add esp, 8
mov ebx, eax
mov edx, esi
test esi, esi
jns 0x402b49
push 0x8000
push edi
call fcn.00409a24
add esp, 8
mov edx, eax
cmp edx, ebx
jl 0x402b9c
test ebx, ebx
je 0x402c35
push 0
push 0
push 0
push ebx
push dword [ebp - 0x100c]
push ebx
push edi
push 0
push 0x428e9c
call dword [sym.imp.KERNEL32.dll_CompareStringEx]
sub eax, 1
je 0x402b9c
sub eax, 1
je 0x402c35
sub eax, 1
je 0x402b9c
push dword [ebp - 0x100c]
push ebx
push edi
push ebx
push str.Error_comparing__.s_and__.s__compareArgument_
push 0
call fcn.00401200
add esp, 0x18
xor al, al
test al, al
jne 0x402c3c
mov ecx, dword [ebp - 0x101c]
add ecx, 4
mov dword [ebp - 0x101c], ecx
mov eax, dword [ecx]
mov dword [ebp - 0x100c], eax
test eax, eax
jne 0x402ae1
xor ebx, ebx
test esi, esi
jle 0x402be6
nop dword [eax + eax]
movzx eax, word [edi + ebx*2]
push eax
call fcn.004151d0
add esp, 4
test eax, eax
jne 0x402be6
inc ebx
cmp ebx, esi
jl 0x402bd0
mov ecx, dword [ebp - 0x1020]
mov edx, edi
push ebx
call fcn.00402550
mov ecx, dword [ebp - 0x1020]
add esp, 4
test al, al
je 0x402dff
push dword [ecx + 8]
lea eax, [edi + ebx*2]
sub esi, ebx
push edi
push ebx
push str._Treating_shebang_command__.s_as__s_n
mov dword [ecx + 0x1c], eax
mov dword [ecx + 0x20], esi
call fcn.00401130
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040649c
mov esp, ebp
pop ebp
ret
mov al, 1
jmp 0x402b9e
mov eax, dword [ebp - 0x1018]
mov ebx, eax
lea ecx, [edi + eax*2]
mov dword [ebp - 0x100c], ecx
cmp eax, esi
jge 0x402c73
movzx eax, word [edi + ebx*2]
push eax
call fcn.004151d0
add esp, 4
test eax, eax
jne 0x402c67
inc ebx
cmp ebx, esi
jl 0x402c51
mov eax, dword [ebp - 0x1018]
mov ecx, dword [ebp - 0x100c]
mov edi, dword [ebp - 0x1020]
sub ebx, eax
add ecx, 0xfffffff4
mov dword [ebp - 0x1010], ecx
mov edx, ecx
mov ecx, edi
lea eax, [ebx + 6]
push eax
call fcn.00402550
add esp, 4
test al, al
mov eax, dword [ebp - 0x100c]
je 0x402cd6
push dword [edi + 8]
lea eax, [eax + ebx*2]
sub esi, ebx
push dword [ebp - 0x1010]
mov dword [edi + 0x1c], eax
lea eax, [ebx + 6]
push eax
push str._Treating_shebang_command__.s_as__s_n
mov dword [edi + 0x20], esi
call fcn.00401130
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040649c
mov esp, ebp
pop ebp
ret
mov edx, dword [sym.imp.KERNEL32.dll_CompareStringOrdinal]
mov dword [edi + 0x2c], eax
mov dword [edi + 0x30], ebx
cmp ebx, 4
jle 0x402d3c
lea eax, [eax + ebx*2]
add eax, 0xfffffff8
mov dword [ebp - 0x1010], eax
je 0x402d3c
push 1
push 0xffffffffffffffff
push str..exe
push 4
push eax
call edx
sub eax, 1
je 0x402d36
sub eax, 1
je 0x402d32
sub eax, 1
je 0x402d36
push str..exe
push 0xffffffffffffffff
push dword [ebp - 0x1010]
push 4
push str.Error_comparing__.s_and__.s__comparePath_
push 0
call fcn.00401200
add esp, 0x18
jmp 0x402d36
add dword [edi + 0x30], 0xfffffffc
mov edx, dword [sym.imp.KERNEL32.dll_CompareStringOrdinal]
mov ecx, dword [edi + 0x30]
cmp ecx, 2
jle 0x402d96
mov eax, dword [edi + 0x2c]
lea eax, [eax + ecx*2]
add eax, 0xfffffffc
mov dword [ebp - 0x1010], eax
je 0x402d96
push 1
push 0xffffffffffffffff
push 0x429a8c
push 2
push eax
call edx
sub eax, 1
je 0x402d96
sub eax, 1
je 0x402d92
sub eax, 1
je 0x402d96
push 0x429a8c
push 0xffffffffffffffff
push dword [ebp - 0x1010]
push 2
push str.Error_comparing__.s_and__.s__comparePath_
push 0
call fcn.00401200
add esp, 0x18
jmp 0x402d96
add dword [edi + 0x30], 0xfffffffe
mov ecx, dword [ebp - 0x100c]
sub esi, ebx
mov edx, dword [edi + 0x2c]
mov byte [edi + 0x34], 1
mov dword [edi + 0x20], esi
lea eax, [ecx + ebx*2]
mov dword [edi + 0x1c], eax
test edx, edx
je 0x402ddd
mov eax, dword [edi + 0x30]
test eax, eax
je 0x402ddd
push edx
push eax
push ecx
push ebx
push str._Treating_shebang_command__.s_as_py___.s_n
call fcn.00401130
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040649c
mov esp, ebp
pop ebp
ret
push ecx
push ebx
push str._Treating_shebang_command__.s_as_py_n
call fcn.00401130
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040649c
mov esp, ebp
pop ebp
ret
push esi
mov edx, edi
call fcn.00402610
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040649c
mov esp, ebp
pop ebp
ret
push str._No_valid_shebang_line
call fcn.00401130
add esp, 4
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040649c
mov esp, ebp
pop ebp
ret