Function at 0x401480
Capabilities:
Compiled with py2exe
Extract resource via kernel32 functions
Query environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x548
mov eax, dword [0x408004]
xor eax, esp
mov dword [esp + 0x544], eax
mov eax, dword [ebp + 8]
push esi
push edi
push 0x608
push 0x408dc0
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0xc]
push 0
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
test eax, eax
jne 0x401554
call esi
push str.Retrieving_module_name
push 2
mov dword [esp + 0x1c], eax
call edi
add esp, 4
push eax
call fcn.00401010
mov eax, dword [esp + 0x1c]
add esp, 8
test eax, eax
je 0x4015d5
push 0
push 0
lea ecx, [esp + 0x18]
push ecx
push 0x400
push eax
push 0
push 0x1100
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x400
push dword [esp + 0x14]
lea eax, [esp + 0x150]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
add esp, 0xc
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea eax, [esp + 0x148]
push eax
push 2
call edi
add esp, 4
push eax
call fcn.00401010
add esp, 8
jmp 0x4015d5
mov ecx, 0x408dc0
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x401560
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jbe 0x401594
push 4
push 0x4051ec
push 0x408dc0
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncmp]
add esp, 0xc
test eax, eax
jne 0x401594
mov eax, 1
jmp 0x401596
xor eax, eax
test eax, eax
mov edx, 0x408dc8
mov ecx, 0x408dc0
cmovne ecx, edx
mov edx, 0x408580
sub edx, ecx
nop dword [eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x4015b0
push 0x5c
push 0x408580
call dword [sym.imp.VCRUNTIME140.dll_wcsrchr]
add esp, 8
xor ecx, ecx
mov word [eax], cx
push str.PYTHONSCRIPT
push 1
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
test eax, eax
jne 0x401653
call esi
push str.Could_not_locate_script_resource:
push 2
mov esi, eax
call edi
add esp, 4
push eax
call fcn.00401010
add esp, 8
test esi, esi
je 0x4016c7
push 0
push 0
lea eax, [esp + 0x18]
push eax
push 0x400
push esi
push 0
push 0x1100
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x400
push dword [esp + 0x14]
lea eax, [esp + 0x150]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
add esp, 0xc
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea eax, [esp + 0x148]
push eax
jmp 0x4016b7
push eax
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
jne 0x401670
call esi
mov edx, str.Could_not_load_script_resource:
mov ecx, eax
call fcn.00401040
jmp 0x4016c7
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edx, eax
mov dword [0x408574], edx
mov dword [0x4093c8], edx
test edx, edx
jne 0x401699
call esi
mov edx, str.Could_not_lock_script_resource:
mov ecx, eax
call fcn.00401040
jmp 0x4016c7
cmp dword [edx], 0x78563412
lea esi, [edx + 0x10]
mov eax, dword [edx + 0xc]
mov dword [0x408570], eax
mov dword [0x408574], esi
je 0x40171c
push str.Bug:_Invalid_script_resource
push 2
call edi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str.FATAL_ERROR:_Could_not_locate_script
push 2
call edi
add esp, 4
push eax
call fcn.00401010
add esp, 8
lea eax, [esp + 0x10]
push 0
push 0
push eax
push 0x400
push 0xffffffffffffffff
push 0
push 0x1100
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x400
push dword [esp + 0x14]
lea eax, [esp + 0x150]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
add esp, 0xc
push dword [esp + 0x10]
jmp 0x401cf0
mov ecx, esi
lea eax, [ecx + 1]
mov dword [esp + 0x14], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401725
sub ecx, dword [esp + 0x14]
lea eax, [edx + 0x11]
add eax, ecx
cmp byte [esi], 0
mov dword [0x408574], eax
je 0x40175e
push esi
push 0x408580
push str._s_S
push 0x608
push 0x4087a0
call fcn.00401290
add esp, 0x14
jmp 0x401770
push 0x608
push 0x4087a0
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 2
push 0
push 0x4087a0
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
push str.python38.dll
mov esi, eax
push 1
push esi
mov dword [esp + 0x20], esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov dword [esp + 0x10], eax
test eax, eax
je 0x401800
push eax
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
push dword [esp + 0x10]
mov esi, eax
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push esi
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_LockResource]
test eax, eax
je 0x4017ed
mov edx, dword [esp + 0x10]
mov ecx, eax
push 0
sub esp, 0x14
call fcn.004020e0
add esp, 0x18
test eax, eax
je 0x4017ed
mov edx, eax
mov ecx, str.python38.dll
call fcn.004026f0
mov esi, dword [eax]
mov dword [esp + 0x10], esi
jmp 0x401811
push str.python38.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
mov dword [esp + 0x10], esi
jmp 0x401811
push str.python38.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
mov dword [esp + 0x10], eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
jne 0x401829
push str.FATAL_ERROR:_Could_not_load_python_library
jmp 0x401ca5
mov edx, 0x405c1c
mov dword [0x4084dc], esi
mov ecx, esi
call fcn.00402ac0
mov eax, dword [eax]
mov dword [sym.run_py3.8_win32.exe_PyExc_SystemError], eax
test eax, eax
je 0x401ca0
mov edx, 0x405c30
mov ecx, esi
call fcn.00402ac0
mov eax, dword [eax]
mov dword [sym.run_py3.8_win32.exe_PyExc_ImportError], eax
test eax, eax
je 0x401ca0
mov edx, 0x405c44
mov ecx, esi
call fcn.00402ac0
mov eax, dword [eax]
mov dword [sym.run_py3.8_win32.exe_PyExc_RuntimeError], eax
test eax, eax
je 0x401ca0
mov eax, dword [0x4093c8]
cmp dword [eax + 8], 0
je 0x40192e
push 0x8000
push 0
call edi
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
add esp, 4
push eax
call edi
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
add esp, 4
push eax
call esi
add esp, 8
push 0x8000
push 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call edi
add esp, 4
push eax
call esi
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 8
push 0
push 4
push 0
push 0
call edi
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_setvbuf]
add esp, 4
push eax
call esi
add esp, 0x10
push 0
push 4
push 0
push 1
call edi
add esp, 4
push eax
call esi
add esp, 0x10
push 0
push 4
push 0
push 2
call edi
add esp, 4
push eax
call esi
mov esi, dword [esp + 0x20]
add esp, 0x10
mov edx, str.Py_UnbufferedStdioFlag
mov ecx, esi
call fcn.00402ac0
test eax, eax
je 0x40192e
mov dword [eax], 1
mov edx, str.Py_IsolatedFlag
mov ecx, esi
call fcn.00402ac0
test eax, eax
je 0x401944
mov dword [eax], 1
mov edx, str.Py_NoSiteFlag
mov ecx, esi
call fcn.00402ac0
test eax, eax
je 0x40195a
mov dword [eax], 1
mov edx, str.Py_IgnoreEnvironmentFlag
mov ecx, esi
call fcn.00402ac0
test eax, eax
je 0x401970
mov dword [eax], 1
mov edx, str.Py_NoUserSiteDirectory
mov ecx, esi
call fcn.00402ac0
test eax, eax
je 0x401986
mov dword [eax], 1
mov edx, str.Py_OptimizeFlag
mov ecx, esi
call fcn.00402ac0
test eax, eax
je 0x4019a1
mov ecx, dword [0x4093c8]
mov ecx, dword [ecx + 4]
mov dword [eax], ecx
mov edx, str.Py_VerboseFlag
mov ecx, esi
call fcn.00402ac0
mov esi, dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
mov edi, eax
test edi, edi
je 0x4019e5
push str.PY2EXE_VERBOSE
call esi
add esp, 4
test eax, eax
je 0x4019df
push str.PY2EXE_VERBOSE
call esi
add esp, 4
push eax
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
add esp, 4
mov dword [edi], eax
jmp 0x4019e5
mov dword [edi], 0
mov eax, dword [0x408484]
test eax, eax
jne 0x401a03
mov ecx, dword [0x4084dc]
mov edx, 0x4058fc
call fcn.00402ac0
mov dword [0x408484], eax
push 0x403200
push str._memimporter
call eax
mov eax, dword [0x4084fc]
add esp, 8
test eax, eax
jne 0x401a30
mov ecx, dword [0x4084dc]
mov edx, 0x405b00
call fcn.00402ac0
mov dword [0x4084fc], eax
lea ecx, [esp + 0x58]
push ecx
call eax
mov eax, dword [0x4093c8]
add esp, 4
mov dword [esp + 0xbc], 0
mov dword [esp + 0x9c], 0
mov dword [esp + 0x108], 1
mov dword [esp + 0xe8], 0
mov dword [esp + 0x5c], 1
mov dword [esp + 0x60], 0
mov dword [esp + 0xe0], 0
mov eax, dword [eax + 4]
push str.PY2EXE_VERBOSE
mov dword [esp + 0xd0], eax
call esi
add esp, 4
test eax, eax
je 0x401abb
push str.PY2EXE_VERBOSE
call esi
add esp, 4
push eax
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
add esp, 4
mov dword [esp + 0xd8], eax
jmp 0x401ac6
mov dword [esp + 0xd8], 0
mov eax, dword [0x408538]
test eax, eax
jne 0x401ae4
mov ecx, dword [0x4084dc]
mov edx, 0x405b1c
call fcn.00402ac0
mov dword [0x408538], eax
push dword [esp + 0x18]
lea ecx, [esp + 0x5c]
push dword [esp + 0x20]
push ecx
lea ecx, [esp + 0x54]
push ecx
call eax
add esp, 0x10
movups xmm0, xmmword [eax]
mov eax, dword [0x40851c]
movaps xmmword [esp + 0x20], xmm0
movaps xmmword [esp + 0x30], xmm0
test eax, eax
jne 0x401b2b
mov ecx, dword [0x4084dc]
mov edx, 0x405b5c
call fcn.00402ac0
movaps xmm0, xmmword [esp + 0x20]
mov dword [0x40851c], eax
sub esp, 0x10
mov ecx, esp
movups xmmword [ecx], xmm0
call eax
add esp, 0x10
test eax, eax
jne 0x401c46
push 0x408dc0
lea eax, [esp + 0xac]
push eax
lea eax, [esp + 0x60]
push eax
lea eax, [esp + 0x54]
push eax
call sym.run_py3.8_win32.exe_PyConfig_SetString
mov ecx, esp
movups xmm0, xmmword [eax]
movaps xmmword [esp + 0x30], xmm0
movaps xmmword [esp + 0x40], xmm0
movups xmm0, xmmword [eax]
movups xmmword [ecx], xmm0
call sym.run_py3.8_win32.exe_PyStatus_Exception
add esp, 0x10
test eax, eax
jne 0x401c46
push 0x4087a0
lea eax, [esp + 0x110]
push eax
lea eax, [esp + 0x50]
push eax
call sym.run_py3.8_win32.exe_PyWideStringList_Append
push ecx
mov ecx, esp
movups xmm0, xmmword [eax]
movaps xmmword [esp + 0x30], xmm0
movaps xmmword [esp + 0x40], xmm0
movups xmm0, xmmword [eax]
movups xmmword [ecx], xmm0
call sym.run_py3.8_win32.exe_PyStatus_Exception
add esp, 0x10
test eax, eax
jne 0x401c46
lea eax, [esp + 0x58]
push eax
lea eax, [esp + 0x4c]
push eax
call sym.run_py3.8_win32.exe_Py_InitializeFromConfig
sub esp, 8
mov ecx, esp
movups xmm0, xmmword [eax]
movaps xmmword [esp + 0x30], xmm0
movaps xmmword [esp + 0x40], xmm0
movups xmm0, xmmword [eax]
movups xmmword [ecx], xmm0
call sym.run_py3.8_win32.exe_PyStatus_Exception
add esp, 0x10
test eax, eax
jne 0x401c46
lea eax, [esp + 0x58]
push eax
call sym.run_py3.8_win32.exe_PyConfig_Clear
add esp, 4
push str.console_exe
call sym.run_py3.8_win32.exe_PyUnicode_FromString
mov esi, eax
add esp, 4
test esi, esi
je 0x401c30
push esi
push 0x4053fc
call sym.run_py3.8_win32.exe_PySys_SetObject
add esp, 8
add dword [esi], 0xffffffff
jne 0x401c30
mov eax, dword [esi + 4]
push esi
mov eax, dword [eax + 0x18]
call eax
add esp, 4
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x544]
xor ecx, esp
call fcn.00403b30
mov esp, ebp
pop ebp
ret
mov eax, dword [0x4084e0]
test eax, eax
jne 0x401c64
mov ecx, dword [0x4084dc]
mov edx, 0x405b80
call fcn.00402ac0
mov dword [0x4084e0], eax
lea ecx, [esp + 0x58]
push ecx
call eax
movaps xmm0, xmmword [esp + 0x24]
sub esp, 0xc
mov eax, esp
movups xmmword [eax], xmm0
call sym.run_py3.8_win32.exe_PyStatus_IsExit
add esp, 0x10
test eax, eax
je 0x401d25
mov eax, dword [esp + 0x3c]
pop edi
pop esi
mov ecx, dword [esp + 0x544]
xor ecx, esp
call fcn.00403b30
mov esp, ebp
pop ebp
ret
push str.FATAL_ERROR:_Failed_to_load_some_Python_symbols
push 2
call edi
add esp, 4
push eax
call fcn.00401010
add esp, 8
lea eax, [esp + 0x14]
push 0
push 0
push eax
push 0x400
push 0xffffffffffffffff
push 0
push 0x1100
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x400
push dword [esp + 0x18]
lea eax, [esp + 0x150]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
add esp, 0xc
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea eax, [esp + 0x148]
push eax
push 2
call edi
add esp, 4
push eax
call fcn.00401010
mov ecx, dword [esp + 0x554]
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
xor ecx, esp
call fcn.00403b30
mov esp, ebp
pop ebp
ret
movaps xmm0, xmmword [esp + 0x20]
sub esp, 0x10
mov eax, esp
movups xmmword [eax], xmm0
call sym.run_py3.8_win32.exe_Py_ExitStatusException
int3