Function at 0x140002120
Capabilities:
Extract resource via kernel32 functions

Disassembly:
mov qword [rsp + 0x20], rdi
push r14
sub rsp, 0x40
lea r14, [0x14000cc80]
mov r8d, 0x608
mov rdx, r14
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor edi, edi
test eax, eax
jne 0x14000215f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
lea rdx, str.Retrieving_module_name
call fcn.140001f20
jmp 0x1400021d5
mov rax, 0xffffffffffffffff
inc rax
cmp word [r14 + rax*2], di
jne 0x140002166
cmp rax, 4
jbe 0x140002195
mov r8d, 4
lea rdx, str.__
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncmp]
test eax, eax
mov eax, 1
je 0x140002197
mov eax, edi
test eax, eax
lea rcx, [0x14000cc88]
lea rdx, [0x14000c440]
cmove rcx, r14
sub rdx, rcx
nop
movzx eax, word [rcx]
mov word [rdx + rcx], ax
lea rcx, [rcx + 2]
test ax, ax
jne 0x1400021b0
mov edx, 0x5c
lea rcx, [0x14000c440]
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
mov word [rax], di
lea r8, str.PYTHONSCRIPT
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_FindResourceA]
test rax, rax
jne 0x1400021ff
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea rdx, str.Could_not_locate_script_resource:
jmp 0x140002273
mov rdx, rax
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_LoadResource]
test rax, rax
jne 0x140002220
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea rdx, str.Could_not_load_script_resource:
jmp 0x140002273
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_LockResource]
mov qword [0x14000c430], rax
mov rdx, rax
mov qword [0x14000d288], rax
test rax, rax
jne 0x140002250
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea rdx, str.Could_not_lock_script_resource:
jmp 0x140002273
cmp dword [rdx], 0x78563412
lea rcx, [rdx + 0x10]
mov eax, dword [rax + 0xc]
mov qword [0x14000c430], rcx
mov dword [0x14000c42c], eax
je 0x14000229c
lea rdx, str.Bug:_Invalid_script_resource
mov ecx, edi
call fcn.140001f20
lea rdx, str.FATAL_ERROR:_Could_not_locate_script
mov ecx, 0xffffffff
call fcn.140001f20
mov eax, 0xffffffff
mov rdi, qword [rsp + 0x68]
add rsp, 0x40
pop r14
ret
mov qword [rsp + 0x50], rbx
mov rax, 0xffffffffffffffff
mov qword [rsp + 0x58], rbp
mov qword [rsp + 0x60], rsi
inc rax
cmp byte [rcx + rax], dil
jne 0x1400022b2
add rax, 0x11
add rax, rdx
mov qword [0x14000c430], rax
cmp byte [rcx], dil
je 0x1400022f4
mov qword [rsp + 0x20], rcx
lea r9, [0x14000c440]
lea rcx, [0x14000c660]
mov edx, 0x608
lea r8, str._s_S
call fcn.140001070
jmp 0x140002309
mov r8d, 0x608
lea rdx, [0x14000c660]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor edx, edx
lea rcx, [0x14000c660]
lea r8d, [rdx + 2]
call qword [sym.imp.KERNEL32.dll_LoadLibraryExW]
lea r8, str.python39.dll
mov edx, 1
mov rcx, rax
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_FindResourceA]
mov rbp, rax
test rax, rax
je 0x1400023f0
mov rdx, rax
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LoadResource]
mov rdx, rbp
mov rcx, rsi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SizeofResource]
mov rcx, rbx
mov ebp, eax
call qword [sym.imp.KERNEL32.dll_LockResource]
test rax, rax
je 0x1400023e7
mov edx, ebp
mov qword [rsp + 0x38], rdi
mov rcx, rax
call fcn.140003430
mov rbp, rax
test rax, rax
je 0x1400023e7
mov ecx, 0x28
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
lea rcx, [0x14000b2c0]
mov rbx, rax
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__strdup]
mov rcx, qword [0x14000c248]
lea rdx, [0x14000b2c0]
mov qword [rbx + 0x10], rcx
mov r9, rbx
lea rcx, str._AddMemoryModule__s___p______p__d__n
mov qword [rbx + 8], rax
mov r8, rbp
mov qword [rbx], rbp
mov qword [rbx + 0x18], rdi
mov dword [rbx + 0x20], 1
mov qword [0x14000c248], rbx
mov dword [rsp + 0x20], 1
call fcn.1400048e0
mov rbx, qword [rbx]
jmp 0x140002400
lea rcx, [0x14000b2c0]
jmp 0x1400023f7
lea rcx, [0x14000b2b0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rbx, rax
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rsi, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x58]
test rbx, rbx
jne 0x14000243b
lea rdx, str.FATAL_ERROR:_Could_not_load_python_library
lea ecx, [rbx - 1]
call fcn.140001f20
lea eax, [rbx - 1]
mov rbx, qword [rsp + 0x50]
mov rdi, qword [rsp + 0x68]
add rsp, 0x40
pop r14
ret
mov rcx, rbx
call fcn.1400075b0
test eax, eax
jns 0x14000246e
lea rdx, str.FATAL_ERROR:_Failed_to_load_some_Python_symbols
mov ecx, 0xffffffff
call fcn.140001f20
mov rbx, qword [rsp + 0x50]
mov eax, 0xffffffff
mov rdi, qword [rsp + 0x68]
add rsp, 0x40
pop r14
ret
mov rcx, rbx
call fcn.140002630
lea rdx, [0x140004f40]
lea rcx, str._memimporter
call sym.run_w_py3.9_win_amd64.exe_PyImport_AppendInittab
mov rcx, r14
call sym.run_w_py3.9_win_amd64.exe_Py_SetProgramName
lea rcx, [0x14000c660]
call sym.run_w_py3.9_win_amd64.exe_Py_SetPath
call sym.run_w_py3.9_win_amd64.exe_Py_Initialize
lea rcx, str.windows_exe
call sym.run_w_py3.9_win_amd64.exe_PyUnicode_FromString
mov rbx, rax
test rax, rax
je 0x1400024d5
mov rdx, rax
lea rcx, [0x14000b20c]
call sym.run_w_py3.9_win_amd64.exe_PySys_SetObject
sub qword [rbx], 1
jne 0x1400024d5
mov rdx, qword [rbx + 8]
mov rcx, rbx
call qword [rdx + 0x30]
mov rbx, qword [rsp + 0x50]
xor eax, eax
mov rdi, qword [rsp + 0x68]
add rsp, 0x40
pop r14
ret