Function at 0x101222d0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push ecx
push ebx
push esi
mov esi, dword [0x103fb118]
xor ebx, ebx
mov eax, dword [0x103fa66c]
mov ecx, 1
test eax, eax
push edi
mov edi, dword [esi + 8]
cmove eax, ecx
mov dword [0x103fa66c], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x103fb038]
jne 0x1012231c
cmp edi, dword [0x103fb020]
jne 0x1012231c
push esi
call sym.python310.dll__PyErr_CheckSignalsTstate
add esp, 4
test eax, eax
jne 0x10122344
call sym.python310.dll_PyOS_CheckStack
test eax, eax
je 0x1012234e
mov esi, dword [sym.python310.dll_PyExc_MemoryError]
mov ecx, sym.python310.dll__PyRuntime
call fcn.101e5360
push str.stack_overflow
push esi
push eax
call sym.python310.dll__PyErr_SetString
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0xc]
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_clearerr]
mov esi, dword [ebp + 8]
add esp, 4
test esi, esi
jne 0x1012239f
call sym.python310.dll_PyEval_SaveThread
push str._nil_
push edi
mov esi, eax
call fcn.10073c50
add esp, 8
test esi, esi
je 0x101224c2
mov ecx, esi
call fcn.101c8d20
mov eax, dword [esi + 8]
mov ecx, dword [eax + 8]
mov eax, dword [ecx + 0x118]
add ecx, 0x118
xchg dword [ecx], esi
jmp 0x10122471
cmp dword [esi], ebx
jg 0x101223cb
call sym.python310.dll_PyEval_SaveThread
push esi
push dword [esi]
mov dword [esp + 0x14], eax
push str._refcnt__ld_at__p_
push edi
call fcn.10073c50
mov esi, dword [esp + 0x1c]
add esp, 0x10
test esi, esi
je 0x101224c2
jmp 0x1012237f
test byte [ebp + 0x10], 1
push esi
je 0x101223d9
call sym.python310.dll_PyObject_Str
jmp 0x101223de
call sym.python310.dll_PyObject_Repr
mov esi, eax
add esp, 4
test esi, esi
je 0x1012249b
mov ecx, dword [esi + 4]
mov eax, dword [ecx + 0x54]
test eax, 0x8000000
je 0x1012240d
push edi
push dword [esi + 8]
lea eax, [esi + 0x10]
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
jmp 0x1012245c
test eax, 0x10000000
je 0x101224a7
push 0x1037acc4
push 0x103677dc
push esi
call sym.python310.dll_PyUnicode_AsEncodedString
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x10122436
or ebx, 0xffffffff
jmp 0x1012245c
push edi
push dword [ebx + 8]
lea eax, [ebx + 0x10]
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
add dword [ebx], 0xffffffff
jne 0x1012245a
mov eax, dword [ebx + 4]
push ebx
mov eax, dword [eax + 0x18]
call eax
add esp, 4
xor ebx, ebx
add dword [esi], 0xffffffff
jne 0x1012246d
mov eax, dword [esi + 4]
push esi
mov eax, dword [eax + 0x18]
call eax
add esp, 4
test ebx, ebx
jne 0x1012249e
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ferror]
add esp, 4
test eax, eax
je 0x1012249e
push 0
push 0
push dword [sym.python310.dll_PyExc_OSError]
call sym.python310.dll_PyErr_SetFromErrnoWithFilenameObjects
add esp, 0xc
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_clearerr]
add esp, 4
or ebx, 0xffffffff
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret
push dword [ecx + 0xc]
push str.str___or_repr___returned__.100s
push dword [sym.python310.dll_PyExc_TypeError]
call sym.python310.dll_PyErr_Format
add esp, 0xc
or ebx, 0xffffffff
jmp 0x1012245c
push 0x10389b34
call sym.python310.dll__Py_FatalError_TstateNULL
int3