Function at 0x406870
Capabilities:
Check os version
Extract resource via kernel32 functions
Get file size
Read file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41d7bd
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x208
mov eax, dword [0x429040]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x20], ecx
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x3c], 0
push eax
call dword [sym.imp.KERNEL32.dll_Wow64DisableWow64FsRedirection]
lea ecx, [ebp - 0x54]
mov dword [ebp - 4], 0
call fcn.00403320
mov byte [ebp - 4], 1
call fcn.0040a1e0
test eax, eax
je 0x406927
push pe_nt_image_headers32
movzx eax, ax
push eax
push 0x400000
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
je 0x406927
push esi
push 0x400000
call dword [sym.imp.KERNEL32.dll_LoadResource]
push esi
push 0x400000
mov edi, eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x68], eax
test edi, edi
je 0x406927
push edi
call dword [sym.imp.KERNEL32.dll_LockResource]
mov esi, eax
jmp 0x40692c
xor esi, esi
mov dword [ebp - 0x68], esi
xor eax, eax
mov dword [ebp - 0x2c], 0
xorps xmm0, xmm0
mov dword [ebp - 0x64], eax
movq qword [ebp - 0x34], xmm0
xor edi, edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x2c], eax
mov byte [ebp - 4], 2
lea eax, [ebp - 0x54]
cmp dword [ebp - 0x40], 7
cmova eax, dword [ebp - 0x54]
xor ecx, ecx
push ecx
push 0x80
push 4
push ecx
push 7
push 1
push eax
mov dword [ebp - 0x60], ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1c], eax
cmp eax, 0xffffffff
je 0x406a0c
lea ecx, [ebp - 0x28]
xorps xmm0, xmm0
push ecx
push eax
movlpd qword [ebp - 0x28], xmm0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x4069f5
cmp dword [ebp - 0x24], edi
jg 0x4069f5
mov eax, dword [ebp - 0x28]
jl 0x4069aa
cmp eax, 0x8000000
ja 0x4069f5
test eax, eax
je 0x4069ca
push ecx
push eax
lea ecx, [ebp - 0x34]
call fcn.0040b090
mov eax, dword [ebp - 0x2c]
mov edi, dword [ebp - 0x34]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x28]
push 0
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x38], 0
push ecx
push eax
push edi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4069f5
mov eax, dword [ebp - 0x38]
xor ecx, ecx
cmp eax, dword [ebp - 0x28]
jne 0x4069f5
cmp ecx, dword [ebp - 0x24]
je 0x4069fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x60], eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x60]
jmp 0x406a15
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x60], eax
test eax, eax
je 0x406a24
mov eax, dword [ebp - 0x64]
cmp edi, eax
cmovne eax, edi
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp - 0x64]
add eax, esi
sub ecx, edi
sub eax, esi
cmp ecx, eax
je 0x406a3a
mov byte [ebp - 0x55], 0
jmp 0x406a8e
mov edx, edi
sub ecx, 4
jb 0x406a52
mov eax, dword [edx]
cmp eax, dword [esi]
jne 0x406a57
add edx, 4
add esi, 4
sub ecx, 4
jae 0x406a41
cmp ecx, 0xfffffffc
je 0x406a8a
mov al, byte [edx]
cmp al, byte [esi]
jne 0x406a84
cmp ecx, 0xfffffffd
je 0x406a8a
mov al, byte [edx + 1]
cmp al, byte [esi + 1]
jne 0x406a84
cmp ecx, 0xfffffffe
je 0x406a8a
mov al, byte [edx + 2]
cmp al, byte [esi + 2]
jne 0x406a84
cmp ecx, 0xffffffff
je 0x406a8a
mov al, byte [edx + 3]
cmp al, byte [esi + 3]
je 0x406a8a
mov byte [ebp - 0x55], 0
jmp 0x406a8e
mov byte [ebp - 0x55], 1
mov byte [ebp - 4], 1
test edi, edi
je 0x406ac3
mov ecx, dword [ebp - 0x18]
mov eax, edi
sub ecx, edi
cmp ecx, 0x1000
jb 0x406ab9
mov edi, dword [eax - 4]
add ecx, 0x23
sub eax, edi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406dd4
push ecx
push edi
call fcn.0040b482
add esp, 8
mov esi, dword [sym.imp.USER32.dll_CharLowerW]
push 0x41
call esi
movzx edx, ax
mov ecx, 0x4259a4
lea eax, [ebp - 0xb8]
push eax
call fcn.00403e70
add esp, 4
lea ecx, [ebp - 0x88]
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x88], xmm0
movq xmm0, qword [eax + 0x10]
movzx eax, word [eax + 0x18]
movq qword [ebp - 0x78], xmm0
mov word [ebp - 0x70], ax
call fcn.00403aa0
push 0x41
mov byte [ebp - 0x57], al
call esi
movzx edx, ax
mov ecx, 0x425988
lea eax, [ebp - 0xb8]
push eax
call fcn.00403e70
add esp, 4
lea ecx, [ebp - 0x88]
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x88], xmm0
movq xmm0, qword [eax + 0x10]
movzx eax, word [eax + 0x18]
movq qword [ebp - 0x78], xmm0
mov word [ebp - 0x70], ax
call fcn.00403aa0
push 0x41
mov byte [ebp - 0x59], al
call esi
movzx edx, ax
mov ecx, 0x425960
lea eax, [ebp - 0xc8]
push eax
call fcn.004050f0
add esp, 4
movups xmm0, xmmword [eax]
mov ecx, dword [eax + 0x20]
mov dword [ebp - 0x74], ecx
lea ecx, [ebp - 0x94]
movups xmmword [ebp - 0x94], xmm0
movups xmm0, xmmword [eax + 0x10]
movzx eax, word [eax + 0x24]
mov word [ebp - 0x70], ax
movups xmmword [ebp - 0x84], xmm0
call fcn.00403aa0
push 0x41
mov byte [ebp - 0x5a], al
call esi
movzx edx, ax
mov ecx, 0x425948
lea eax, [ebp - 0x88]
push eax
call fcn.00402d40
add esp, 4
lea ecx, [ebp - 0xb8]
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0xb8], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0xa8], xmm0
call fcn.00403aa0
push 0x41
mov byte [ebp - 0x58], al
call esi
movzx edx, ax
mov ecx, 0x426608
lea eax, [ebp - 0xc8]
push eax
call fcn.00403260
add esp, 4
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x98], xmm0
movups xmm0, xmmword [eax + 0x10]
movups xmmword [ebp - 0x88], xmm0
movq xmm0, qword [eax + 0x20]
movq qword [ebp - 0x78], xmm0
movzx eax, word [eax + 0x28]
mov word [ebp - 0x70], ax
lea eax, [ebp - 0x98]
push eax
push 0
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenEventW]
test eax, eax
jne 0x406c48
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
sete byte [ebp - 0x56]
jmp 0x406c53
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 0x56], 1
push 0x41
call esi
movzx edx, ax
mov ecx, 0x4258a0
lea eax, [ebp - 0x218]
push eax
call fcn.00406610
mov esi, eax
lea edi, [ebp - 0x170]
movzx eax, byte [ebp - 0x56]
mov ecx, 0x29
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0x60]
add esp, 4
movsw word es:[edi], word [esi]
mov esi, dword [ebp - 0x34]
mov edi, dword [ebp - 0x20]
push eax
movzx eax, byte [ebp - 0x55]
push ecx
push eax
xor eax, eax
cmp esi, dword [ebp - 0x64]
setne al
push eax
lea eax, [ebp - 0x170]
push eax
push edi
call fcn.00403670
add esp, 0x18
cmp esi, dword [ebp - 0x64]
je 0x406cc7
cmp byte [ebp - 0x57], 0
je 0x406cc7
movzx eax, byte [ebp - 0x55]
xor eax, 1
lea eax, [eax*2 + 1]
jmp 0x406cc9
xor eax, eax
cmp byte [ebp - 0x56], 0
mov dword [edi + 0x68], eax
je 0x406cd9
mov eax, 1
jmp 0x406d1a
cmp eax, 3
je 0x406d15
lea eax, [ebp - 0x20]
mov dword [ebp - 0x18], 0
push eax
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
push eax
lea eax, [ebp - 0x18]
mov dword [ebp - 0x20], 0
push eax
call dword [sym.imp.ntdll.dll_RtlGetNtVersionNumbers]
cmp dword [ebp - 0x18], 0xa
je 0x406d11
cmp dword [edi + 0x68], 1
je 0x406d15
xor eax, eax
jmp 0x406d1a
mov eax, 2
mov dword [edi + 0x6c], eax
mov esi, str.hLlPxTpHt_
movzx eax, byte [ebp - 0x58]
mov dword [edi + 0x78], eax
movzx eax, byte [ebp - 0x59]
mov dword [edi + 0x70], eax
movzx eax, byte [ebp - 0x5a]
mov dword [edi + 0x74], eax
nop word [eax + eax]
mov eax, dword [esi]
mov eax, dword [edi + eax]
push dword [eax*4 + 0x426674]
mov eax, dword [esi + 4]
push dword [eax + edi]
call dword [sym.imp.USER32.dll_SetWindowTextW]
add esi, 8
cmp esi, 0x42589c
jne 0x406d40
mov ecx, dword [ebp - 0x40]
cmp ecx, 7
jbe 0x406d99
mov edx, dword [ebp - 0x54]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x406d8f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406dd4
push ecx
push edx
call fcn.0040b482
add esp, 8
push dword [ebp - 0x3c]
xor eax, eax
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 7
mov word [ebp - 0x54], ax
call dword [sym.imp.KERNEL32.dll_Wow64RevertWow64FsRedirection]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0040b474
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.0040ecac
int3