Function at 0x421430
Capabilities:
Set environment variable

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0xcc
mov eax, dword [esp + 0xe0]
mov edi, dword [esp + 0xe4]
mov ebx, dword [esp + 0xe8]
mov dword [esp + 0x10], eax
mov eax, dword [0x4c30e8]
test eax, eax
je 0x421682
mov dword [esp + 4], str.environ
mov dword [esp], eax
call dword [sym.imp.python311.dll_PyObject_GetAttrString]
mov dword [esp], edi
mov dword [esp + 0x14], eax
call dword [sym.imp.python311.dll_PyUnicode_FromString]
mov dword [esp + 0x18], eax
test ebx, ebx
je 0x4215bc
xor edx, edx
xor esi, esi
lea ebp, [esp + 0x20]
mov word [esp + 0x20], dx
movzx edx, byte [edi]
test dl, dl
je 0x42151b
mov dword [esp + 0x10], edi
mov edi, esi
mov dword [esp + 0x1c], ebx
mov ebx, edx
lea esi, [esi]
mov eax, 0x28
lea esi, [ebp + edi*2]
sub eax, edi
cmp word [ebp + edi*2], 0
je 0x4214d4
lea esi, [esi]
nop
add esi, 2
sub eax, 1
cmp word [esi], 0
jne 0x4214c8
test eax, eax
je 0x4965e7
mov dword [esp], esi
add edi, 1
call sub.msvcrt.dll_wcslen
lea ecx, [esp + 0x70]
mov byte [esp + 0x70], bl
lea eax, [esi + eax*2]
mov dword [esp + 8], 2
mov dword [esp + 4], ecx
mov dword [esp], eax
mov byte [esp + 0x71], 0
call sub.msvcrt.dll_mbstowcs
mov eax, dword [esp + 0x10]
movzx ebx, byte [eax + edi]
test bl, bl
jne 0x4214b0
mov ebx, dword [esp + 0x1c]
mov dword [esp + 4], ebx
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
sub esp, 8
mov dword [esp], ebx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.python311.dll_PyUnicode_FromWideChar]
mov dword [esp + 8], eax
mov ebx, eax
mov eax, dword [esp + 0x18]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x14]
mov dword [esp], eax
call dword [sym.imp.python311.dll_PyObject_SetItem]
test eax, eax
jne 0x4216a8
sub dword [ebx], 1
jne 0x42156d
mov eax, dword [ebx + 4]
mov dword [esp], ebx
call dword [eax + 0x18]
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx]
mov dword [esp + 0x10], eax
sub eax, 1
mov dword [ecx], eax
jne 0x421587
mov eax, dword [ecx + 4]
mov dword [esp], ecx
call dword [eax + 0x18]
mov edx, dword [esp + 0x14]
mov eax, dword [edx]
mov dword [esp + 0x10], eax
sub eax, 1
mov dword [edx], eax
jne 0x4215b1
mov eax, dword [edx + 4]
mov dword [esp + 0xe0], edx
mov eax, dword [eax + 0x18]
add esp, 0xcc
pop ebx
pop esi
pop edi
pop ebp
jmp eax
add esp, 0xcc
pop ebx
pop esi
pop edi
pop ebp
ret
movzx ebp, byte [edi]
xor eax, eax
xor esi, esi
lea edx, [esp + 0x70]
mov word [esp + 0x70], ax
mov eax, ebp
test al, al
je 0x421643
lea esi, [esi]
mov eax, 0x28
lea ebx, [edx + esi*2]
sub eax, esi
cmp word [edx + esi*2], 0
je 0x4215fc
lea esi, [esi]
add ebx, 2
sub eax, 1
cmp word [ebx], 0
jne 0x4215f0
test eax, eax
je 0x4965e7
mov dword [esp], ebx
add esi, 1
call sub.msvcrt.dll_wcslen
lea edx, [esp + 0x20]
mov ecx, ebp
mov byte [esp + 0x21], 0
lea eax, [ebx + eax*2]
mov dword [esp + 4], edx
mov dword [esp + 8], 2
mov dword [esp], eax
mov byte [esp + 0x20], cl
call sub.msvcrt.dll_mbstowcs
movzx ebp, byte [edi + esi]
lea edx, [esp + 0x70]
mov eax, ebp
test al, al
jne 0x4215d8
mov dword [esp + 4], 0
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
sub esp, 8
mov eax, dword [esp + 0x18]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x14]
mov dword [esp], eax
call dword [sym.imp.python311.dll_PyObject_DelItem]
test eax, eax
je 0x42156d
mov eax, dword [esp + 0x10]
call fcn.0040b1d0
jmp 0x42156d
mov dword [esp], 0x49e50f
call dword [sym.imp.python311.dll_PyImport_ImportModule]
mov dword [0x4c30e8], eax
test eax, eax
jne 0x421460
jmp 0x4965e7
mov dword [esp], 1
call dword [sym.imp.python311.dll_PyErr_PrintEx]
mov dword [esp], 1
call dword [sym.imp.python311.dll_Py_Exit]
lea esi, [esi]
lea esi, [esi]
sub esp, 0x1c
mov dword [esp + 8], 0x100
mov dword [esp + 4], 0x4c2ec0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
sub esp, 0xc
test eax, eax
je 0x4965ec
mov eax, 0x4c2ec0
add esp, 0x1c
ret