Function at 0x4022d0
Capabilities:
Extract resource via kernel32 functions
Get common file path

Disassembly:
sub esp, 0x160
mov eax, dword [0x40d204]
mov dword [esp + 0x15c], eax
movsx eax, byte [esp + 0x164]
push ebx
xor ebx, ebx
push eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ebx
call fcn.0040431d
add esp, 4
test eax, eax
jne 0x402319
or eax, 0xffffffff
pop ebx
mov ecx, dword [esp + 0x15c]
call fcn.00403e52
add esp, 0x160
ret
push ebp
push edi
push 0x12c
lea ecx, [esp + 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea edi, [esp + 0x3c]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402330
mov edx, dword [str.diskcopy.dll]
mov eax, dword [0x40a638]
mov ecx, dword [0x40a63c]
mov dword [edi], edx
mov dx, word [0x40a640]
mov dword [edi + 4], eax
mov dword [edi + 8], ecx
lea eax, [esp + 0x3c]
mov word [edi + 0xc], dx
push eax
mov edi, 0xfffffffe
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebp, eax
cmp ebp, ebx
mov dword [esp + 0x18], ebp
je 0x402552
push esi
push str.BINFILE
push 0x40a628
push ebp
mov edi, 0xfffffffd
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
cmp esi, ebx
je 0x40254a
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push esi
push ebp
mov edi, 0xfffffffc
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov esi, eax
cmp esi, ebx
mov dword [esp + 0x18], esi
je 0x40254a
push esi
mov edi, 0xfffffffb
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebp, eax
test ebp, ebp
je 0x40253f
lea esi, [ebp + 0x2600]
mov edi, 0xe0
nop
push 0xb
push str.IO______SYS
push esi
call fcn.00409030
add esp, 0xc
test eax, eax
jne 0x4023ff
push esi
push ebp
call fcn.00402260
mov ebx, eax
jmp 0x40243f
push 0xb
push str.MSDOS___SYS
push esi
call fcn.00409030
add esp, 0xc
test eax, eax
jne 0x402420
push esi
push ebp
call fcn.00402260
mov dword [esp + 0x1c], eax
jmp 0x40243f
push 0xb
push str.COMMAND_COM
push esi
call fcn.00409030
add esp, 0xc
test eax, eax
jne 0x402442
push esi
push ebp
call fcn.00402260
mov dword [esp + 0x18], eax
add esp, 8
add esi, 0x20
dec edi
jne 0x4023e0
test ebx, ebx
mov ebp, dword [esp + 0x10]
je 0x402517
mov esi, dword [esp + 0x14]
test esi, esi
je 0x402517
test ebp, ebp
je 0x402517
mov edx, dword [str.IO.SYS]
mov cl, byte [esp + 0x174]
mov ax, word [0x40a218]
mov dword [esp + 0x23], edx
lea edx, [esp + 0x20]
mov byte [esp + 0x20], cl
mov cl, byte [0x40a21a]
push edx
push ebx
mov edi, 0xfffffffa
mov byte [esp + 0x29], 0x3a
mov byte [esp + 0x2a], 0x5c
mov word [esp + 0x2f], ax
mov byte [esp + 0x31], cl
call fcn.004021c0
add esp, 8
test eax, eax
je 0x40251c
mov eax, dword [str.MSDOS.SYS]
mov ecx, dword [0x40a5fc]
mov dx, word [0x40a600]
mov dword [esp + 0x23], eax
lea eax, [esp + 0x20]
push eax
push esi
mov dword [esp + 0x2f], ecx
mov word [esp + 0x33], dx
call fcn.004021c0
add esp, 8
test eax, eax
je 0x40251c
mov ecx, dword [str.COMMAND.COM]
mov edx, dword [0x40a20c]
mov eax, dword [0x40a210]
mov dword [esp + 0x23], ecx
lea ecx, [esp + 0x20]
push ecx
push ebp
mov dword [esp + 0x2f], edx
mov dword [esp + 0x33], eax
call fcn.004021c0
add esp, 8
test eax, eax
je 0x40251c
xor edi, edi
jmp 0x40251c
mov edi, 0xfffffffb
test ebx, ebx
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
je 0x402529
push ebx
call esi
mov eax, dword [esp + 0x14]
test eax, eax
je 0x402534
push eax
call esi
test ebp, ebp
je 0x40253b
push ebp
call esi
mov esi, dword [esp + 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov ebp, dword [esp + 0x1c]
push ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop esi
mov ecx, dword [esp + 0x168]
mov eax, edi
pop edi
pop ebp
pop ebx
call fcn.00403e52
add esp, 0x160
ret