Function at 0x1022eee0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
push ebx
push esi
push edi
push 0
push 0
push 0
mov edx, 8
mov dword [esp + 0x24], 0
mov ecx, 0x10367680
mov dword [esp + 0x20], 0xffffffff
call fcn.101599e0
mov esi, eax
add esp, 0xc
test esi, esi
je 0x1022f270
push esi
call sym.python310.dll_PyImport_AddModuleObject
add esp, 4
mov ebx, eax
add dword [esi], 0xffffffff
jne 0x1022ef3a
mov eax, dword [esi + 4]
push esi
mov eax, dword [eax + 0x18]
call eax
add esp, 4
mov esi, ebx
test ebx, ebx
je 0x1022f270
inc dword [ebx]
push ebx
call sym.python310.dll_PyModule_GetDict
add esp, 4
mov edx, 8
mov ecx, str.__file__
mov edi, eax
push 0
push 0
push 0
call fcn.101599e0
add esp, 0xc
mov dword [esp + 0x10], eax
test eax, eax
je 0x1022ef9c
push eax
push edi
call sym.python310.dll_PyDict_GetItemWithError
mov ecx, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x1c], eax
add dword [ecx], 0xffffffff
jne 0x1022ef98
mov eax, dword [ecx + 4]
push ecx
mov eax, dword [eax + 0x18]
call eax
mov eax, dword [esp + 0x20]
add esp, 4
test eax, eax
jne 0x1022efe7
mov eax, dword [0x103fb118]
cmp dword [eax + 0x34], 0
jne 0x1022f254
push dword [ebp + 0xc]
push str.__file__
push edi
call sym.python310.dll_PyDict_SetItemString
add esp, 0xc
test eax, eax
js 0x1022f254
push sym.python310.dll__Py_NoneStruct
push str.__cached__
push edi
call sym.python310.dll_PyDict_SetItemString
add esp, 0xc
test eax, eax
js 0x1022f254
mov dword [esp + 0x18], 1
push 0
push 0
push 0
mov edx, 4
mov ecx, str..pyc
call fcn.101599e0
add esp, 0xc
mov dword [esp + 0x1c], eax
test eax, eax
je 0x1022f209
push 1
push 0x7fffffff
push 0
push eax
push dword [ebp + 0xc]
call sym.python310.dll_PyUnicode_Tailmatch
mov ecx, dword [esp + 0x30]
add esp, 0x14
mov dword [esp + 0x20], eax
add dword [ecx], 0xffffffff
jne 0x1022f03d
mov eax, dword [ecx + 4]
push ecx
mov eax, dword [eax + 0x18]
call eax
mov eax, dword [esp + 0x24]
add esp, 4
test eax, eax
jne 0x1022f123
cmp dword [ebp + 0x10], eax
je 0x1022f0b3
call sym.python310.dll_PyImport_GetMagicNumber
push dword [ebp + 8]
movzx eax, ax
mov dword [esp + 0x24], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
add esp, 4
test eax, eax
jne 0x1022f0b3
push dword [ebp + 8]
lea eax, [esp + 0x14]
push 2
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
cmp eax, 2
jne 0x1022f0a7
mov ax, word [esp + 0x10]
movzx ecx, ah
shl ecx, 8
movzx eax, al
or ecx, eax
cmp ecx, dword [esp + 0x20]
jne 0x1022f0a7
push dword [ebp + 8]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_rewind]
add esp, 4
jmp 0x1022f129
push dword [ebp + 8]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_rewind]
add esp, 4
push str._stdin_
push dword [ebp + 0xc]
call sym.python310.dll_PyUnicode_CompareWithASCIIString
add esp, 8
test eax, eax
je 0x1022f103
mov edx, dword [ebp + 0xc]
mov ecx, edi
push str.SourceFileLoader
call fcn.1022edd0
add esp, 4
test eax, eax
jns 0x1022f103
push str.python:_failed_to_set___main__.__loader___n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.10073c50
add esp, 8
mov dword [esp + 0x14], 0xffffffff
jmp 0x1022f209
push dword [ebp + 0x14]
mov edx, dword [ebp + 0xc]
push dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
push edi
push edi
push 0x101
call fcn.10230d70
add esp, 0x14
jmp 0x1022f1c0
cmp dword [ebp + 0x10], 0
je 0x1022f135
push dword [ebp + 8]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push 0x1036e950
push dword [ebp + 0xc]
call sym.python310.dll__Py_fopen_obj
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x1022f16b
push str.python:_Cant_reopen_.pyc_file_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.10073c50
add esp, 8
jmp 0x1022f209
mov edx, dword [ebp + 0xc]
mov ecx, edi
push str.SourcelessFileLoader
call fcn.1022edd0
add esp, 4
test eax, eax
jns 0x1022f1ae
push str.python:_failed_to_set___main__.__loader___n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.10073c50
push dword [esp + 0x18]
mov dword [esp + 0x20], 0xffffffff
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0xc
jmp 0x1022f209
push dword [ebp + 0x14]
mov ecx, dword [esp + 0x14]
mov edx, edi
push edi
call fcn.10231130
add esp, 8
mov esi, eax
call fcn.10230e80
test esi, esi
jne 0x1022f1ee
add dword [ebx], 0xffffffff
jne 0x1022f1dc
mov eax, dword [ebx + 4]
push ebx
mov eax, dword [eax + 0x18]
call eax
add esp, 4
mov ecx, dword [0x103fb118]
mov edx, 1
call fcn.1022fc40
jmp 0x1022f209
add dword [esi], 0xffffffff
jne 0x1022f1ff
mov eax, dword [esi + 4]
push esi
mov eax, dword [eax + 0x18]
call eax
add esp, 4
mov dword [esp + 0x14], 0
mov esi, ebx
cmp dword [esp + 0x18], 0
je 0x1022f250
push str.__file__
push edi
call sym.python310.dll_PyDict_DelItemString
add esp, 8
test eax, eax
je 0x1022f230
mov eax, dword [0x103fb118]
push eax
call sym.python310.dll__PyErr_Clear
add esp, 4
push str.__cached__
push edi
call sym.python310.dll_PyDict_DelItemString
add esp, 8
test eax, eax
je 0x1022f250
mov eax, dword [0x103fb118]
push eax
call sym.python310.dll__PyErr_Clear
add esp, 4
test esi, esi
je 0x1022f265
add dword [esi], 0xffffffff
jne 0x1022f265
mov ecx, dword [esi + 4]
push esi
mov ecx, dword [ecx + 0x18]
call ecx
add esp, 4
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret