Function at 0x401000
Capabilities:
Extract resource via kernel32 functions
Print debug messages
Write file on windows

Disassembly:
sub esp, 0x108
push ebx
push ebp
push esi
push edi
push 0x408088
push 0x66
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
test esi, esi
jne 0x401038
push 0x408078
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x108
ret
push esi
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
test edi, edi
jne 0x401060
push 0x408068
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x108
ret
push esi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ebx, eax
test ebx, ebx
jne 0x401088
push 0x40805c
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x108
ret
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push edi
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ecx, ebx
mov esi, eax
mov eax, ecx
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
test ebp, ebp
rep movsb byte es:[edi], byte [esi]
jne 0x4010cb
push 0x40804c
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x108
ret
mov ecx, dword [esp + 0x120]
push 0
push 0
push 4
push 0
push 2
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
lea edx, [esp + 0x10]
push 0
push edx
mov esi, eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push ebp
push esi
call ebx
test eax, eax
jne 0x401139
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x19]
mov byte [esp + 0x18], 0
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [esp + 0x1c]
push 0x408040
push eax
call fcn.00401370
add esp, 0xc
lea ecx, [esp + 0x18]
push ecx
jmp 0x4011fd
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 2
push 0
push 0
push esi
call ebp
mov edx, dword [esp + 0x11c]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push eax
lea eax, [esp + 0x14]
dec ecx
push eax
push ecx
push edx
push esi
mov dword [esp + 0x28], ecx
call ebx
test eax, eax
jne 0x4011ab
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x19]
mov byte [esp + 0x18], 0
push edx
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x1c]
push 0x408040
push ecx
stosw word es:[edi], ax
call fcn.00401370
add esp, 0xc
lea edx, [esp + 0x18]
push edx
jmp 0x4011fd
push 2
push 0
push 0
push esi
call ebp
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x1c]
push 4
push ecx
push esi
call ebx
test eax, eax
jne 0x40121a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x19]
mov byte [esp + 0x18], 0
push edx
rep stosd dword es:[edi], eax
lea edx, [esp + 0x1c]
push 0x408040
push edx
stosw word es:[edi], ax
call fcn.00401370
add esp, 0xc
lea eax, [esp + 0x18]
push eax
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call esi
push 0x408030
call esi
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x108
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x108
ret