Function at 0x4021b0
Capabilities:
Delete file
Extract resource via kernel32 functions
Get file size
Read file on windows
Set file attributes
Write file on windows

Disassembly:
sub esp, 0xc
push ebx
push ebp
mov ebp, dword [esp + 0x18]
push esi
push edi
push 0x80
push ebp
mov dword [esp + 0x18], 0
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push ebp
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
and ecx, 0xffff
push eax
push ecx
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
test esi, esi
jne 0x402215
push ebp
push 0x4047ec
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push esi
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
test edi, edi
mov dword [esp + 0x28], edi
jne 0x402243
push ebp
push 0x4047cc
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push esi
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x18], ebx
jne 0x402271
push ebp
push 0x4047a8
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebx
push edi
call fcn.00401180
add esp, 8
mov dword [esp + 0x14], eax
mov dword [esp + 0x20], 0
cmp dword [esp + 0x20], 0xa
jae 0x402384
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 7
push 2
push 0
push 0
push 0x40000000
push ebp
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x40239c
mov eax, dword [esp + 0x28]
lea edx, [esp + 0x10]
push 0
push edx
push ebx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4022db
push ebp
push 0x404788
call fcn.00401000
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push ebp
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x4023b4
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4023cc
push ebx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
lea ecx, [esp + 0x24]
mov edi, eax
mov dword [esp + 0x24], 0
push 0
push ecx
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4023e4
push ebx
push edi
call fcn.00401180
mov ecx, dword [esp + 0x1c]
add esp, 8
cmp eax, ecx
push ebp
je 0x402409
push 0x404768
call fcn.00401000
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x20]
mov ebx, dword [esp + 0x18]
inc eax
mov dword [esp + 0x20], eax
jmp 0x402287
push ebp
push 0x404744
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x404724
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x404704
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x4046e0
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x4046bc
call fcn.00401000
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xc
ret
push 0x40469c
call fcn.00401000
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xc
ret