Function at 0x408e70
Capabilities:
Extract resource via kernel32 functions
Get common file path
Write file on windows

Disassembly:
push edi
lea edi, [esp + 8]
and esp, 0xfffffff8
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
mov esi, ecx
mov ecx, 9
push ebx
mov ebx, eax
sub esp, 0x2c8
mov eax, dword [edi]
mov dword [ebp - 0x274], 0x28
mov dword [ebp - 0x2a0], eax
mov eax, dword [edi + 4]
mov dword [ebp - 0x2b0], eax
mov eax, dword [edi + 8]
lea edi, [ebp - 0x270]
mov dword [ebp - 0x294], eax
xor eax, eax
rep stosd dword es:[edi], eax
mov eax, dword [edx]
lea ecx, [ebp - 0x290]
mov dword [esp], edx
mov dword [esp + 8], ecx
mov dword [esp + 4], 0x41c27c
call dword [eax]
sub esp, 0xc
mov edi, eax
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
xor eax, eax
test edi, edi
sete al
mov dword [esp + 8], edi
lea edi, [ebp - 0x274]
mov dword [esp], eax
mov dword [esp + 4], str.Unexpected_hr__lx._n
call fcn.00401f80
mov eax, dword [ebp - 0x290]
lea ecx, [ebp - 0x280]
mov edx, dword [eax]
mov dword [esp + 0x10], ecx
lea ecx, [ebp - 0x28c]
mov dword [esp + 0xc], ecx
lea ecx, [ebp - 0x288]
mov dword [esp + 8], ecx
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [edx + 0x30]
sub esp, 0x14
mov edx, eax
cmp eax, 0xc00d36b2
je 0x409898
mov dword [ebp - 0x298], edx
call fcn.00414420
mov edx, dword [ebp - 0x298]
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
xor eax, eax
test edx, edx
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.Unexpected_hr__lx._n
call fcn.00401f80
mov eax, dword [ebp - 0x290]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
mov eax, dword [ebp - 0x274]
mov dword [esp + 4], str.Unexpected_biSize__lx_n
mov dword [esp + 8], eax
cmp dword [esi], eax
sete al
xor edi, edi
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
mov eax, dword [ebp - 0x294]
test eax, eax
je 0x408fdc
mov edi, dword [0x43a030]
xor eax, eax
test edi, edi
setne al
mov edi, eax
call fcn.00414420
mov edx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
add edx, edx
or edx, edi
mov dword [eax + 0x10], edx
jmp 0x409031
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
mov eax, dword [ebp - 0x270]
mov dword [esp + 4], str.Unexpected_biWidth__lx_n
mov dword [esp + 8], eax
cmp dword [esi + 4], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
shr dword [eax + 0x10], 1
call fcn.00414420
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x408ff8
mov ecx, dword [ebp - 0x294]
xor edi, edi
test ecx, ecx
je 0x40905f
mov edx, dword [0x43a030]
xor eax, eax
test edx, edx
setne al
mov edi, eax
call fcn.00414420
mov edx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
add edx, edx
or edx, edi
mov dword [eax + 0x10], edx
jmp 0x4090b9
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
mov eax, dword [ebp - 0x26c]
mov dword [esp + 4], str.Unexpected_biHeight__lx_n
mov dword [esp + 8], eax
cmp dword [esi + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
shr dword [eax + 0x10], 1
call fcn.00414420
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x409080
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
movzx edx, word [ebp - 0x268]
mov dword [esp + 4], str.Unexpected_biPlanes__x_n
mov dword [esp + 8], edx
cmp word [esi + 0xc], dx
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
movzx edx, word [ebp - 0x266]
mov dword [esp + 4], str.Unexpected_biBitCount__x_n
mov dword [esp + 8], edx
cmp word [esi + 0xe], dx
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
mov eax, dword [ebp - 0x264]
mov dword [esp + 4], str.Unexpected_biCompression__lx_n
mov dword [esp + 8], eax
cmp dword [esi + 0x10], eax
sete al
xor edi, edi
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
mov eax, dword [ebp - 0x294]
test eax, eax
je 0x40917e
mov ecx, dword [0x43a030]
xor eax, eax
test ecx, ecx
setne al
mov edi, eax
call fcn.00414420
mov edx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
add edx, edx
or edx, edi
mov dword [eax + 0x10], edx
jmp 0x4091d9
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], ebx
mov eax, dword [ebp - 0x260]
mov dword [esp + 4], str.Unexpected_biSizeImage__lx_n
mov dword [esp + 8], eax
cmp dword [esi + 0x14], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
shr dword [eax + 0x10], 1
call fcn.00414420
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x4091a0
call fcn.00414420
mov dword [eax + 4], ebx
mov dword [eax], 0x41806d
mov eax, dword [ebp - 0x25c]
mov dword [esp + 4], str.Unexpected_biXPelsPerMeter__lx_n
mov dword [esp + 8], eax
cmp dword [esi + 0x18], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
mov dword [eax + 4], ebx
mov dword [eax], 0x41806d
mov eax, dword [ebp - 0x258]
mov dword [esp + 4], str.Unexpected_biYPelsPerMeter__lx_n
mov dword [esp + 8], eax
cmp dword [esi + 0x1c], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
mov dword [eax + 4], ebx
mov dword [eax], 0x41806d
mov eax, dword [ebp - 0x254]
mov dword [esp + 4], str.Unexpected_biClrUsed__lx_n
mov dword [esp + 8], eax
cmp dword [esi + 0x20], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
mov dword [eax + 4], ebx
mov dword [eax], 0x41806d
mov eax, dword [ebp - 0x250]
mov dword [esp + 4], str.Unexpected_biClrImportant__lx_n
mov dword [esp + 8], eax
cmp dword [esi + 0x24], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
mov eax, dword [ebp - 0x260]
mov esi, dword [ebp - 0x288]
mov dword [ebp - 0x298], eax
mov eax, dword [ebp - 0x2b0]
mov dword [ebp - 0x2a8], esi
mov ebx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x2a4], eax
lea eax, [ebp - 0x218]
mov dword [ebp - 0x294], ebx
mov dword [esp + 4], eax
mov dword [esp], 0x104
call dword [sym.imp.kernel32.dll_GetTempPathW]
lea edx, [ebp - 0x218]
sub esp, 8
cmp word [ebp - 0x218], 0
je 0x40931f
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x409310
mov dword [ebp - 0x2a8], esi
mov esi, dword [ebp - 0x2a8]
mov ebx, dword [ebp - 0x2a0]
xor eax, eax
lea esi, [esi]
movzx ecx, word [ebx + eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x409330
lea eax, [ebp - 0x218]
mov dword [ebp - 0x2a8], esi
lea edi, [ebp - 0x248]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xc0000000
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], 0x7a
mov ebx, dword fs:[0x18]
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.CreateFileW_failed__error__lu_n
mov dword [esp + 8], eax
xor eax, eax
cmp esi, 0xffffffff
setne al
mov dword [esp], eax
call fcn.00401f80
xor eax, eax
mov ecx, 0xc
mov edx, dword [ebp - 0x2a4]
rep stosd dword es:[edi], eax
mov ecx, dword [ebp - 0x294]
mov eax, dword [ebp - 0x298]
mov dword [ebp - 0x244], 0x36
mov dword [ebp - 0x2ac], edx
mov dword [ebp - 0x23c], ecx
imul ecx, edx
add eax, 0x36
mov dword [ebp - 0x24c], eax
mov dword [ebp - 0x238], edx
mov edx, dword [sym.imp.kernel32.dll_WriteFile]
mov dword [ebp - 0x240], 0x28
mov eax, ecx
lea ecx, [ebp - 0x284]
mov dword [ebp - 0x234], 0x200001
shl eax, 2
mov dword [ebp - 0x22c], eax
mov dword [esp + 0xc], ecx
mov dword [esp], esi
mov dword [esp + 0x10], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0x419128
mov dword [ebp - 0x2b4], edx
call edx
sub esp, 0x14
mov edi, eax
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], 0x5f
mov eax, dword [ebx + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.WriteFile_failed__error__lu_n
call fcn.00401f80
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], 0x60
mov eax, dword [ebp - 0x284]
mov dword [esp + 4], str.written__lu_bytes_n
cmp eax, 2
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
lea ecx, [ebp - 0x284]
lea eax, [ebp - 0x24c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 0x34
mov dword [esp + 4], eax
mov dword [ebp - 0x29c], esi
mov dword [esp], esi
mov edx, dword [ebp - 0x2b4]
call edx
sub esp, 0x14
mov edi, eax
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], 0x62
mov eax, dword [ebx + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.WriteFile_failed__error__lu_n
call fcn.00401f80
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], 0x63
mov eax, dword [ebp - 0x284]
mov dword [esp + 4], str.written__lu_bytes_n
cmp eax, 0x34
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
lea ecx, [ebp - 0x284]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ecx
mov esi, dword [ebp - 0x298]
mov dword [esp + 8], esi
mov eax, dword [ebp - 0x2a8]
mov dword [esp + 4], eax
mov edi, dword [ebp - 0x29c]
mov dword [esp], edi
mov edx, dword [ebp - 0x2b4]
call edx
sub esp, 0x14
mov edi, eax
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], 0x65
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.WriteFile_failed__error__lu_n
mov dword [esp + 8], eax
mov dword [esp], edi
call fcn.00401f80
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], 0x66
mov eax, dword [ebp - 0x284]
mov dword [esp + 4], str.written__lu_bytes_n
cmp esi, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401f80
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], 0x7c
lea eax, [ebp - 0x218]
shr eax, 0x10
je 0x409870
lea eax, [ebp - 0x218]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x409642
lea eax, [ebp - 0x218]
call fcn.00401410
mov dword [esp + 4], eax
mov dword [esp], str.created__s_n
call fcn.00401a20
mov eax, dword [ebp - 0x29c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 8], 0xa
mov eax, dword [ebp - 0x2a0]
mov dword [esp], 0
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_FindResourceW]
sub esp, 0xc
mov ebx, eax
call fcn.00414420
mov dword [eax], 0x41806d
mov dword [eax + 4], pe_nt_image_headers32
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 4], str.FindResourceW_failed__error__lu_n
mov dword [esp + 8], eax
xor eax, eax
test ebx, ebx
setne al
mov dword [esp], eax
call fcn.00401f80
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
sub esp, 4
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LoadResource]
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
mov edx, dword [ebp - 0x2a4]
add eax, dword [eax + 0xa]
sub esp, 4
mov ebx, eax
test edx, edx
je 0x40984a
mov eax, dword [ebp - 0x2b0]
mov edx, dword [ebp - 0x294]
mov dword [ebp - 0x29c], 0
mov ecx, dword [eax + 4]
mov edi, dword [eax + 0xc]
shl edx, 2
mov esi, dword [eax]
mov eax, dword [eax + 8]
mov dword [ebp - 0x2a0], eax
xor eax, eax
mov dword [ebp - 0x298], esi
mov esi, dword [ebp - 0x2a8]
mov dword [ebp - 0x2a8], edi
mov edi, ecx
mov ecx, eax
jmp 0x40975d
mov eax, dword [ebp - 0x2a4]
add ecx, 1
add esi, edx
add ebx, edx
cmp ecx, eax
je 0x409818
cmp ecx, edi
jb 0x409748
mov eax, dword [ebp - 0x2a8]
cmp ecx, eax
jae 0x409748
mov eax, dword [ebp - 0x294]
test eax, eax
je 0x409748
mov dword [ebp - 0x2ac], ecx
xor eax, eax
mov dword [ebp - 0x2b0], edi
mov dword [ebp - 0x2b4], edx
lea esi, [esi]
mov edi, dword [ebp - 0x298]
cmp eax, edi
jb 0x4097ee
mov ecx, dword [ebp - 0x2a0]
cmp eax, ecx
jae 0x4097ee
movzx edx, byte [esi + eax*4]
movzx ecx, byte [ebx + eax*4]
movzx edi, byte [esi + eax*4 + 1]
sub ecx, edx
mov edx, ecx
neg edx
cmovs edx, ecx
movzx ecx, byte [ebx + eax*4 + 1]
sub ecx, edi
mov edi, ecx
neg edi
cmovs edi, ecx
mov ecx, dword [ebp - 0x29c]
add edx, edi
movzx edi, byte [esi + eax*4 + 2]
add edx, ecx
movzx ecx, byte [ebx + eax*4 + 2]
sub ecx, edi
mov edi, ecx
neg edi
cmovs edi, ecx
lea ecx, [edi + edx]
mov dword [ebp - 0x29c], ecx
mov edi, dword [ebp - 0x294]
add eax, 1
cmp eax, edi
jne 0x409790
mov ecx, dword [ebp - 0x2ac]
mov edi, dword [ebp - 0x2b0]
mov edx, dword [ebp - 0x2b4]
jmp 0x409748
mov ecx, edi
mov edx, dword [ebp - 0x2a0]
mov edi, dword [ebp - 0x2a8]
mov esi, dword [ebp - 0x298]
imul eax, dword [ebp - 0x29c], 0x64
sub edi, ecx
sub edx, esi
imul edi, edx
shr eax, 8
xor edx, edx
lea ecx, [edi + edi*2]
div ecx
mov dword [ebp - 0x2ac], eax
mov eax, dword [ebp - 0x288]
mov dword [esp], eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
mov eax, dword [ebp - 0x2ac]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
lea eax, [ebp - 0x218]
mov dword [ebp - 0x298], eax
movzx eax, word [ebp - 0x298]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00401260
jmp 0x409642
mov dword [esp], 0x1f4
call dword [sym.imp.kernel32.dll_Sleep]
mov eax, dword [ebp - 0x290]
lea ecx, [ebp - 0x280]
sub esp, 4
mov edx, dword [eax]
mov dword [esp + 0x10], ecx
lea ecx, [ebp - 0x28c]
mov dword [esp + 0xc], ecx
lea ecx, [ebp - 0x288]
mov dword [esp + 8], ecx
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [edx + 0x30]
sub esp, 0x14
mov edx, eax
jmp 0x408f4b