Function at 0x402390
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 0x4023f5
push ebp
push 0x404884
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 0x402423
push ebp
push 0x404864
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 0x402451
push ebp
push 0x404840
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 0x402564
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 0x40257c
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 0x4024bb
push ebp
push 0x404820
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 0x402594
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4025ac
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 0x4025c4
push ebx
push edi
call fcn.00401180
mov ecx, dword [esp + 0x1c]
add esp, 8
cmp eax, ecx
push ebp
je 0x4025e9
push 0x404800
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 0x402467
push ebp
push 0x4047dc
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x4047bc
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x40479c
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x404778
call fcn.00401000
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push ebp
push 0x404754
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 0x404734
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