Function at 0x4047f0
Capabilities:
Extract resource via kernel32 functions
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x13c
mov eax, dword [0x41b004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
push edi
mov esi, edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push edi
push 0x41cdfc
mov dword [ebp - 0x13c], eax
lea eax, [ebp - 0x128]
xor ebx, ebx
push 0x417c5c
push eax
mov dword [esi + 8], ebx
mov dword [esi + 0xc], ebx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
lea ecx, [ebp - 0x128]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40488c
mov esi, dword [0x41cd90]
push edi
push str._0x0001000A__n_s
push 0x30
mov edi, str.file_open_error
call fcn.0040aa70
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push 0
lea edx, [ebp - 0x134]
push edx
push 4
lea eax, [ebp - 0x138]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4048de
push edi
push str._0x00010001__n_s
mov esi, dword [0x41cd90]
push 0x30
mov edi, str.read_error
call fcn.0040aa70
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x138]
cmp eax, 0x20434150
jne 0x40493e
push 2
push 0
push 0xfffffffffffffff8
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 0x134]
push ecx
push 4
lea edx, [esi + 4]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40491a
push edi
push str._0x00010002_
jmp 0x4048af
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov dword [esi + 8], 8
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
mov ecx, 0x5a4d
cmp ax, cx
jne 0x404ac1
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x41cdfc
lea edx, [ebp - 0x128]
push str._sdllRESOURCE.dll
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x128]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
jne 0x4049ae
mov esi, dword [0x41cd90]
push edi
push str._0x00010003__n_s
push 0x30
mov edi, str.read_error
call fcn.0040aa70
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push 0xa
push edi
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameA]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov dword [ebp - 0x12c], eax
test eax, eax
jne 0x404a05
push edi
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameA]
push eax
push str._0x00010004__n_s
mov esi, dword [0x41cd90]
push 0x30
mov edi, str.read_error
call fcn.0040aa70
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x130], eax
test eax, eax
jne 0x404a26
push edi
push str._0x00010005__n_s
jmp 0x4049d6
mov ecx, dword [ebp - 0x12c]
xor eax, eax
push ecx
push ebx
mov byte [ebp - 0x24], 0
mov dword [ebp - 0x23], eax
mov dword [ebp - 0x1f], eax
mov dword [ebp - 0x1b], eax
mov dword [ebp - 0x17], eax
mov dword [ebp - 0x13], eax
mov dword [ebp - 0xf], eax
mov dword [ebp - 0xb], eax
mov word [ebp - 7], ax
mov byte [ebp - 5], al
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edx, dword [ebp - 0x130]
push eax
push edx
lea eax, [ebp - 0x24]
push eax
call fcn.00410720
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [ebp - 0x24], 0x2f2a2a2f
jne 0x404a9c
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
pop edi
mov dword [esi + 0xc], ecx
mov dword [esi + 4], edx
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x24]
mov byte [ebp - 0x1c], 0
call fcn.0040a330
pop edi
mov dword [esi + 4], eax
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
cmp dword [esi], 0
mov dword [ebp - 0x12c], 0
jle 0x4048c4
lea eax, [esi + 0x10]
mov dword [ebp - 0x130], eax
lea ecx, [ecx]
mov ecx, dword [ebp - 0x13c]
mov edx, dword [ebp - 0x130]
push ecx
push edx
push edi
call fcn.0040aaca
add esp, 0xc
test eax, eax
mov eax, dword [ebp - 0x12c]
je 0x404b1b
add dword [ebp - 0x130], 0x108
inc eax
mov dword [ebp - 0x12c], eax
cmp eax, dword [esi]
jl 0x404ae0
jmp 0x4048c4
imul eax, eax, 0x108
mov eax, dword [eax + esi + 0x114]
push ebx
mov dword [esi + 4], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.0040aabb
mov esp, ebp
pop ebp
ret