Function at 0x402130
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 0x402195
push ebp
push 0x404780
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 0x4021c3
push ebp
push 0x404760
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 0x4021f1
push ebp
push 0x40473c
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 0x402304
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 0x40231c
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 0x40225b
push ebp
push 0x40471c
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 0x402334
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40234c
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 0x402364
push ebx
push edi
call fcn.00401180
mov ecx, dword [esp + 0x1c]
add esp, 8
cmp eax, ecx
push ebp
je 0x402389
push 0x4046fc
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 0x402207
push ebp
push 0x4046d8
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x4046b8
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x404698
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x404674
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x404650
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 0x404630
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