Function at 0x409684
Capabilities:
Extract resource via kernel32 functions
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd4
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov ebx, dword [ebp + 8]
mov eax, dword [ebp - 4]
call fcn.00404208
mov eax, dword [ebp - 8]
call fcn.00404208
xor eax, eax
push ebp
push 0x409887
push dword fs:[eax]
mov dword fs:[eax], esp
call fcn.00409678
test al, al
je 0x4096f2
lea eax, [ebp - 0x20]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 4]
call fcn.00404064
mov eax, dword [ebp - 0x20]
call fcn.00404218
mov edx, eax
mov eax, ebx
call fcn.00403f88
jmp 0x40985f
push 0xa
push 0x409898
mov eax, dword [0x413654]
push eax
call sub.kernel32.dll_FindResourceA
mov esi, eax
push esi
mov eax, dword [0x413654]
push eax
call sub.kernel32.dll_LoadResource
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_LockResource
mov edi, eax
push esi
mov eax, dword [0x413654]
push eax
call sub.kernel32.dll_SizeofResource
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
call fcn.00402518
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x18]
mov eax, edi
mov ecx, dword [ebp - 0x14]
call fcn.00402648
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_FreeResource
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x3c]
add eax, dword [ebp - 0x18]
mov edx, eax
add edx, 0xf8
mov dword [ebp - 0x1c], edx
mov edx, dword [ebp - 0xc]
mov dword [eax + 0x34], edx
mov edx, dword [eax + 0x50]
cmp edx, dword [ebp + 0xc]
jae 0x40978a
mov ecx, dword [ebp + 0xc]
sub ecx, edx
mov edx, ecx
add dword [eax + 0x50], edx
movzx eax, word [eax + 6]
lea eax, [eax + eax*4]
mov ecx, dword [ebp - 0x1c]
add dword [ecx + eax*8 - 0x20], edx
mov edx, ebx
xor eax, eax
call fcn.00402774
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebx]
call fcn.00404018
mov ecx, eax
sub ecx, 4
mov eax, dword [ebx]
mov edx, 1
call fcn.00404278
mov edx, dword [ebp - 0x24]
mov eax, ebx
mov ecx, 0x4098a8
call fcn.00404064
xor esi, esi
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
mov eax, dword [ebx]
call fcn.00404218
push eax
call sub.kernel32.dll_CreateFileA_1
mov edi, eax
test edi, edi
jge 0x409828
lea eax, [ebp - 0x28]
push eax
mov eax, dword [ebx]
call fcn.00404018
mov ecx, eax
sub ecx, 3
mov eax, dword [ebx]
mov edx, 1
call fcn.00404278
push dword [ebp - 0x28]
push 0x4098b8
lea eax, [ebp - 0x2c]
mov edx, esi
add dl, 0x30
call fcn.00403f78
push dword [ebp - 0x2c]
mov eax, ebx
mov edx, 3
call fcn.004040d8
inc esi
jmp 0x409844
push 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x18]
push eax
push edi
call sub.kernel32.dll_WriteFile_1
push edi
call sub.kernel32.dll_CloseHandle_1
jmp 0x40984d
cmp esi, 0xa
jb 0x4097c0
mov eax, ebx
mov edx, dword [ebp - 8]
call fcn.00404020
mov eax, dword [ebp - 0x18]
call fcn.00402538
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40988e
lea eax, [ebp - 0x2c]
mov edx, 4
call fcn.00403db4
lea eax, [ebp - 8]
mov edx, 2
call fcn.00403db4
ret