Function at 0x405960
Capabilities:
Extract resource via kernel32 functions
Set current directory

Disassembly:
sub esp, 8
push ebx
xor ebx, ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x20]
mov eax, dword [edi]
mov dword [edi + 8], ebx
mov byte [eax + 1], bl
mov ecx, dword [edi]
mov eax, dword [esp + 0x24]
mov byte [ecx], bl
mov edx, dword [eax]
mov dword [eax + 8], ebx
mov byte [edx + 1], bl
mov eax, dword [eax]
mov byte [eax], bl
mov eax, dword [esp + 0x28]
mov ecx, dword [eax]
mov dword [eax + 8], ebx
mov byte [ecx + 1], bl
mov edx, dword [eax]
mov eax, dword [esp + 0x2c]
mov byte [edx], bl
mov ecx, dword [eax]
mov dword [eax + 8], ebx
mov byte [ecx + 1], bl
mov edx, dword [eax]
push ebx
mov byte [esp + 0x17], bl
mov byte [edx], bl
call dword [sym.imp.KERNEL32.dll_SetLastError]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [esp + 0x1c]
push 0xa
push str.WORKINGFOLDER
push esi
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov ebp, eax
cmp ebp, ebx
je 0x405a19
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
je 0x405a19
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
cmp eax, ebx
mov dword [esp + 0x20], eax
je 0x405a19
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ebp, dword [esp + 0x20]
push eax
push ebp
call fcn.0040b80b
add esp, 8
push eax
push ebp
mov ecx, edi
call fcn.00404730
test al, al
je 0x405a19
mov byte [esp + 0x13], 1
mov edi, dword [edi]
push edi
mov dword [0x42bc2c], edi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push 0xa
push str.SCRIPT
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
cmp edi, ebx
je 0x405a7b
push edi
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
je 0x405a7b
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebp, eax
cmp ebp, ebx
je 0x405a7b
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push eax
push ebp
call fcn.0040b80b
mov ecx, dword [esp + 0x2c]
add esp, 8
push eax
push ebp
call fcn.00404730
test al, al
je 0x405a7b
and byte [esp + 0x13], 1
push 0xa
push str.CCONRESOURCES
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov ebp, eax
cmp ebp, ebx
je 0x405ace
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
je 0x405ace
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edi, eax
cmp edi, ebx
je 0x405ace
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push eax
push edi
call fcn.0040b80b
mov ecx, dword [esp + 0x30]
add esp, 8
push eax
push edi
call fcn.00404730
test al, al
je 0x405ace
and byte [esp + 0x13], 1
push 0xa
push str.SVRNAME
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov ebp, eax
cmp ebp, ebx
je 0x405b21
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
je 0x405b21
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edi, eax
cmp edi, ebx
je 0x405b21
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push eax
push edi
call fcn.0040b80b
mov ecx, dword [esp + 0x34]
add esp, 8
push eax
push edi
call fcn.00404730
test al, al
je 0x405b21
and byte [esp + 0x13], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov cl, byte [esp + 0x13]
cmp cl, bl
jne 0x405b68
cmp eax, dword [esp + 0x14]
je 0x405b68
push ebx
push ebx
lea ecx, [esp + 0x2c]
push ecx
push ebx
push eax
push ebx
push 0x1100
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov edx, dword [esp + 0x24]
push edx
push str.Error_reading_resources__t_LoadFileResourceToBuffer___s
call fcn.00409f90
mov al, byte [esp + 0x1b]
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
pop edi
pop esi
pop ebp
mov al, cl
pop ebx
add esp, 8
ret