Function at 0x499690
Capabilities:
Check if file exists
Check os version
Copy file
Create directory
Get common file path
Get file attributes
Get startup folder
Write file to startup folder

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b035b
mov eax, dword fs:[0]
push eax
sub esp, 0x250
mov eax, dword [0x4df798]
xor eax, ebp
mov dword [ebp - 0x14], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x258], ecx
mov ecx, dword [ebp - 0x258]
call fcn.0042cc77
mov eax, dword [ebp - 0x258]
mov ecx, dword [eax + 0x20]
push ecx
call fcn.004ac7a0
add esp, 4
mov edx, dword [ebp - 0x258]
mov eax, dword [edx + 0x20]
push eax
mov ecx, dword [sym.imp.MPOsd.dll_struct_OsdShared_sg_Shared]
call dword [sym.imp.MPOsd.dll_public:_bool___thiscall_OsdShared::InitMasterWnd_struct_HWND____]
mov ecx, dword [sym.imp.MPOsd.dll_struct_OsdShared_sg_Shared]
mov dl, byte [0x52fb96]
mov byte [ecx + 0xa894], dl
mov ecx, 0x52e1e4
call fcn.004010a0
mov ecx, dword [sym.imp.MPOsd.dll_struct_OsdShared_sg_Shared]
mov byte [ecx + 0xa895], al
push 0
mov ecx, 0x53550c
call fcn.00481790
push eax
mov ecx, dword [ebp - 0x258]
call fcn.00433bd4
push 0
push 0x44c
push 0x20
mov ecx, dword [ebp - 0x258]
call fcn.00401110
push 0
push 0xc80
push 0x2d
mov ecx, dword [ebp - 0x258]
call fcn.00401110
push 0
push 0x514
push 0x4e
mov ecx, dword [ebp - 0x258]
call fcn.00401110
push 0
mov ecx, dword [ebp - 0x258]
call fcn.004071f0
mov dword [ebp - 0x130], eax
cmp dword [ebp - 0x130], 0
je 0x4997fe
lea ecx, [ebp - 0x14c]
call fcn.00401780
mov dword [ebp - 4], 0
push 0x65
lea ecx, [ebp - 0x14c]
call fcn.00404510
lea ecx, [ebp - 0x14c]
call fcn.004071d0
movzx edx, al
test edx, edx
jne 0x4997ec
push 0
push 0
push 0x800
mov ecx, dword [ebp - 0x130]
call fcn.004071a0
lea ecx, [ebp - 0x14c]
call fcn.0040b6f0
push eax
push 0x10
push 0
mov ecx, dword [ebp - 0x130]
call fcn.004071a0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14c]
call fcn.00401620
push 1
mov eax, dword [ebp - 0x258]
mov ecx, dword [eax + 0x74]
push ecx
mov ecx, dword [ebp - 0x258]
call fcn.00407170
push 0
mov edx, dword [ebp - 0x258]
mov eax, dword [edx + 0x74]
push eax
mov ecx, dword [ebp - 0x258]
call fcn.00407170
lea ecx, [ebp - 0x140]
push ecx
mov ecx, dword [ebp - 0x258]
call fcn.004011e0
mov edx, dword [ebp - 0x140]
add edx, 0x22a
mov dword [ebp - 0x138], edx
push 1
lea eax, [ebp - 0x140]
push eax
mov ecx, dword [ebp - 0x258]
call fcn.004011a0
mov dword [0x4e68d4], 1
push 0x81
mov ecx, dword [ebp - 0x258]
call fcn.00490270
mov ecx, dword [ebp - 0x258]
call fcn.00494ff0
mov ecx, dword [0x52fb80]
mov dword [ebp - 0x25c], ecx
cmp dword [ebp - 0x25c], 3
je 0x4998a9
cmp dword [ebp - 0x25c], 4
je 0x4998b8
jmp 0x4998ec
push 6
mov ecx, dword [ebp - 0x258]
call fcn.00433c9f
jmp 0x4998ec
push 0
push 0
push 0x201
mov ecx, dword [ebp - 0x258]
add ecx, 0x1c48
call fcn.00403b10
push 0
push 0
push 0x202
mov ecx, dword [ebp - 0x258]
add ecx, 0x1c48
call fcn.00403b10
push 0
push 0x64
push 0x42
mov ecx, dword [ebp - 0x258]
call fcn.00401110
mov dword [ebp - 0x148], 0x52e1e4
mov dword [ebp - 0x150], 0
jmp 0x499922
mov edx, dword [ebp - 0x150]
add edx, 1
mov dword [ebp - 0x150], edx
mov ecx, dword [ebp - 0x148]
call fcn.004010a0
movzx eax, al
cmp dword [ebp - 0x150], eax
jge 0x4999a4
push 0x10
push 0
movzx ecx, byte [ebp - 0x150]
push ecx
mov ecx, dword [ebp - 0x148]
call fcn.00403ef0
push eax
call fcn.004523a9
add esp, 0xc
mov dword [ebp - 0x154], eax
mov byte [ebp - 0x155], 0
cmp dword [ebp - 0x154], 0x1081
je 0x49997d
cmp dword [ebp - 0x154], 0x1080
jne 0x499984
mov byte [ebp - 0x155], 1
movzx edx, byte [ebp - 0x155]
push edx
movzx eax, byte [ebp - 0x150]
push eax
mov ecx, dword [ebp - 0x148]
call fcn.00477e90
jmp 0x499913
lea ecx, [ebp - 0x144]
call fcn.00401780
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x10]
call fcn.00401780
mov byte [ebp - 4], 2
mov dword [ebp - 0x12c], 0x114
lea ecx, [ebp - 0x12c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
jne 0x4999ed
push str.Not_able_to_get_OS_information
lea ecx, [ebp - 0x144]
call fcn.004047d0
cmp dword [ebp - 0x128], 5
jne 0x499a32
cmp dword [ebp - 0x124], 1
jne 0x499a32
push str.Service_Pack_2
lea ecx, [ebp - 0x10]
call fcn.004047d0
lea ecx, [ebp - 0x10]
call fcn.0040b6f0
push eax
lea edx, [ebp - 0x118]
push edx
call fcn.00452dac
add esp, 8
test eax, eax
jne 0x499a32
mov dword [0x4e7640], 1
cmp dword [ebp - 0x128], 6
jne 0x499a44
cmp dword [ebp - 0x124], 1
je 0x499a51
cmp dword [ebp - 0x128], 7
jne 0x499df8
mov byte [ebp - 0x175], 0
xor eax, eax
mov word [ebp - 0x24c], ax
push 0xc6
push 0
lea ecx, [ebp - 0x24a]
push ecx
call fcn.00451f70
add esp, 0xc
push 0
push 0x28
lea edx, [ebp - 0x24c]
push edx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea ecx, [ebp - 0x168]
call fcn.00401780
mov byte [ebp - 4], 3
lea eax, [ebp - 0x24c]
push eax
lea ecx, [ebp - 0x168]
call fcn.004047d0
push str.AppDataLocalMicrosoftWindows_SidebarGadgetsGALAXY.cab.gadget
lea ecx, [ebp - 0x168]
call fcn.00407150
lea ecx, [ebp - 0x168]
call fcn.0040b6f0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x250], eax
cmp dword [ebp - 0x250], 0xffffffff
jne 0x499af2
push 0
lea ecx, [ebp - 0x168]
call fcn.0040b6f0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jmp 0x499af9
mov byte [ebp - 0x175], 1
lea ecx, [ebp - 0x168]
push ecx
lea ecx, [ebp - 0x16c]
call fcn.00407400
mov byte [ebp - 4], 4
lea edx, [ebp - 0x168]
push edx
lea ecx, [ebp - 0x184]
call fcn.00407400
mov byte [ebp - 4], 5
lea eax, [ebp - 0x168]
push eax
lea ecx, [ebp - 0x174]
call fcn.00407400
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x168]
push ecx
lea ecx, [ebp - 0x164]
call fcn.00407400
mov byte [ebp - 4], 7
lea edx, [ebp - 0x168]
push edx
lea ecx, [ebp - 0x160]
call fcn.00407400
mov byte [ebp - 4], 8
lea eax, [ebp - 0x168]
push eax
lea ecx, [ebp - 0x180]
call fcn.00407400
mov byte [ebp - 4], 9
lea ecx, [ebp - 0x168]
push ecx
lea ecx, [ebp - 0x170]
call fcn.00407400
mov byte [ebp - 4], 0xa
lea edx, [ebp - 0x168]
push edx
lea ecx, [ebp - 0x17c]
call fcn.00407400
mov byte [ebp - 4], 0xb
lea ecx, [ebp - 0x15c]
call fcn.00401780
mov byte [ebp - 4], 0xc
push str.cpu.png
lea ecx, [ebp - 0x16c]
call fcn.00407150
push str.gadget.css
lea ecx, [ebp - 0x184]
call fcn.00407150
push str.gadget.html
lea ecx, [ebp - 0x174]
call fcn.00407150
push str.gadget.js
lea ecx, [ebp - 0x164]
call fcn.00407150
push str.gadget.xml
lea ecx, [ebp - 0x160]
call fcn.00407150
push str._settings.html
lea ecx, [ebp - 0x170]
call fcn.00407150
push str._settings.js
lea ecx, [ebp - 0x17c]
call fcn.00407150
push 0xc8
push 0
lea eax, [ebp - 0x24c]
push eax
call fcn.00451f70
add esp, 0xc
push 0
push 0x24
lea ecx, [ebp - 0x24c]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea edx, [ebp - 0x24c]
push edx
lea ecx, [ebp - 0x15c]
call fcn.004047d0
push 0x4c9cdc
lea ecx, [ebp - 0x15c]
call fcn.00407150
mov byte [0x4e763a], 1
lea eax, [ebp - 0x15c]
push eax
mov ecx, 0x535538
call fcn.00404190
movzx ecx, byte [ebp - 0x175]
test ecx, ecx
jne 0x499d62
push 0
lea ecx, [ebp - 0x16c]
call fcn.0040b6f0
push eax
push str.GALAXY.cab.gadgetcpu.png
call dword [sym.imp.KERNEL32.dll_CopyFileW]
push 0
lea ecx, [ebp - 0x184]
call fcn.0040b6f0
push eax
push str.GALAXY.cab.gadgetgadget.css
call dword [sym.imp.KERNEL32.dll_CopyFileW]
push 0
lea ecx, [ebp - 0x174]
call fcn.0040b6f0
push eax
push str.GALAXY.cab.gadgetgadget.html
call dword [sym.imp.KERNEL32.dll_CopyFileW]
push 0
lea ecx, [ebp - 0x164]
call fcn.0040b6f0
push eax
push str.GALAXY.cab.gadgetgadget.js
call dword [sym.imp.KERNEL32.dll_CopyFileW]
push 0
lea ecx, [ebp - 0x160]
call fcn.0040b6f0
push eax
push str.GALAXY.cab.gadgetgadget.xml
call dword [sym.imp.KERNEL32.dll_CopyFileW]
push 0
lea ecx, [ebp - 0x170]
call fcn.0040b6f0
push eax
push str.GALAXY.cab.gadget_settings.html
call dword [sym.imp.KERNEL32.dll_CopyFileW]
push 0
lea ecx, [ebp - 0x17c]
call fcn.0040b6f0
push eax
push str.GALAXY.cab.gadget_settings.js
call dword [sym.imp.KERNEL32.dll_CopyFileW]
push 0
lea ecx, [ebp - 0x15c]
call fcn.0040b6f0
push eax
push str.CurrInfo.xml
call dword [sym.imp.KERNEL32.dll_CopyFileW]
mov byte [ebp - 4], 0xb
lea ecx, [ebp - 0x15c]
call fcn.00401620
mov byte [ebp - 4], 0xa
lea ecx, [ebp - 0x17c]
call fcn.00401620
mov byte [ebp - 4], 9
lea ecx, [ebp - 0x170]
call fcn.00401620
mov byte [ebp - 4], 8
lea ecx, [ebp - 0x180]
call fcn.00401620
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x160]
call fcn.00401620
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x164]
call fcn.00401620
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x174]
call fcn.00401620
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x184]
call fcn.00401620
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x16c]
call fcn.00401620
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x168]
call fcn.00401620
mov edx, dword [ebp - 0x258]
mov dword [edx + 0x87b0], 0x2bc
mov eax, dword [ebp - 0x258]
mov dword [eax + 0x87b8], 0x316
mov ecx, dword [ebp - 0x258]
mov dword [ecx + 0x87b4], 0x68
mov edx, dword [ebp - 0x258]
mov dword [edx + 0x87bc], 0xc8
mov eax, dword [ebp - 0x258]
mov dword [eax + 0x87c0], 0x2bc
mov ecx, dword [ebp - 0x258]
mov dword [ecx + 0x87c8], 0x316
mov edx, dword [ebp - 0x258]
mov dword [edx + 0x87c4], 0xf8
mov eax, dword [ebp - 0x258]
mov dword [eax + 0x87cc], 0x118
mov dword [ebp - 0x254], 1
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x10]
call fcn.00401620
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x144]
call fcn.00401620
mov eax, dword [ebp - 0x254]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00451600
mov esp, ebp
pop ebp
ret