Function at 0x40a170
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x460
mov eax, dword [0x42f060]
xor eax, ebp
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x460], ecx
mov dword [ebp - 4], 0
mov eax, dword [ebp + 0xc]
mov dword [ebp - 8], eax
cmp dword [ebp + 0xc], 0xffffffff
jne 0x40a1ae
mov ecx, dword [ebp + 8]
push ecx
mov ecx, dword [ebp - 0x460]
call fcn.00409ff0
mov dword [ebp - 8], eax
mov edx, dword [ebp - 8]
push edx
push str.KXP__04d
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push str.KCPROFKXP::SaveProfileRegValue_n
call fcn.00413880
add esp, 4
lea ecx, [ebp - 0x118]
push ecx
push str._tszProfKeyName___s_n
call fcn.00413880
add esp, 8
mov edx, dword [ebp + 0x10]
push edx
push str._tszValueName___s_n
call fcn.00413880
add esp, 8
push str.KXP_
mov eax, dword [ebp + 0x10]
push eax
call fcn.00405200
add esp, 8
test eax, eax
je 0x40a215
xor eax, eax
jmp 0x40a5d4
mov dword [ebp - 0x11c], 0
lea ecx, [ebp - 0x118]
push ecx
push 0x429e0c
mov edx, dword [ebp - 0x460]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x460]
mov edx, dword [eax + 0xc]
call edx
mov dword [ebp - 0x11c], eax
mov eax, dword [ebp - 0x11c]
push eax
push str.dwRead___ld_n
call fcn.00413880
add esp, 8
cmp dword [ebp - 0x11c], 0
jbe 0x40a429
mov eax, dword [ebp - 0x11c]
xor edx, edx
mov ecx, 0x10c
div ecx
mov dword [ebp - 0x124], eax
mov edx, dword [ebp - 0x11c]
add edx, 0x10c
push edx
call fcn.00415b79
add esp, 4
mov dword [ebp - 0x458], eax
mov eax, dword [ebp - 0x458]
mov dword [ebp - 0x128], eax
mov ecx, dword [ebp - 0x11c]
add ecx, 0x10c
push ecx
mov edx, dword [ebp - 0x128]
push edx
lea eax, [ebp - 0x118]
push eax
push 0x429e0c
mov ecx, dword [ebp - 0x460]
call fcn.00406fb0
mov ecx, dword [ebp - 0x128]
mov dword [ebp - 0x120], ecx
mov byte [ebp - 0x129], 0
mov dword [ebp - 0x130], 0
jmp 0x40a2fa
mov edx, dword [ebp - 0x130]
add edx, 1
mov dword [ebp - 0x130], edx
mov eax, dword [ebp - 0x130]
cmp eax, dword [ebp - 0x124]
jge 0x40a37a
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x130]
imul edx, edx, 0x10c
add edx, dword [ebp - 0x120]
push edx
call fcn.00418740
add esp, 8
test eax, eax
jne 0x40a375
mov byte [ebp - 0x129], 1
mov eax, dword [ebp - 0x130]
imul eax, eax, 0x10c
mov ecx, dword [ebp - 0x120]
mov edx, dword [ebp + 0x18]
mov dword [ecx + eax + 0x108], edx
push 3
mov eax, dword [ebp - 0x11c]
push eax
mov ecx, dword [ebp - 0x128]
push ecx
lea edx, [ebp - 0x118]
push edx
push 0x429e0c
mov ecx, dword [ebp - 0x460]
call fcn.004071e0
jmp 0x40a2eb
movzx eax, byte [ebp - 0x129]
test eax, eax
jne 0x40a40c
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x124]
imul edx, edx, 0x10c
add edx, dword [ebp - 0x120]
push edx
call fcn.00416a40
add esp, 8
mov eax, dword [ebp - 0x124]
imul eax, eax, 0x10c
mov ecx, dword [ebp - 0x120]
mov edx, dword [ebp + 0x1c]
mov dword [ecx + eax + 0x104], edx
mov eax, dword [ebp - 0x124]
imul eax, eax, 0x10c
mov ecx, dword [ebp - 0x120]
mov edx, dword [ebp + 0x18]
mov dword [ecx + eax + 0x108], edx
push 3
mov eax, dword [ebp - 0x11c]
add eax, 0x10c
push eax
mov ecx, dword [ebp - 0x128]
push ecx
lea edx, [ebp - 0x118]
push edx
push 0x429e0c
mov ecx, dword [ebp - 0x460]
call fcn.004071e0
mov eax, dword [ebp - 0x128]
mov dword [ebp - 0x45c], eax
mov ecx, dword [ebp - 0x45c]
push ecx
call fcn.00415ab7
add esp, 4
jmp 0x40a473
mov edx, dword [ebp + 0x10]
push edx
lea eax, [ebp - 0x240]
push eax
call fcn.00416a40
add esp, 8
mov ecx, dword [ebp + 0x1c]
mov dword [ebp - 0x13c], ecx
mov edx, dword [ebp + 0x18]
mov dword [ebp - 0x138], edx
push 3
push 0x10c
lea eax, [ebp - 0x240]
push eax
lea ecx, [ebp - 0x118]
push ecx
push 0x429e0c
mov ecx, dword [ebp - 0x460]
call fcn.004071e0
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp - 8]
push eax
push str.KXP__04d__s
lea ecx, [ebp - 0x118]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
mov edx, dword [ebp - 0x460]
movzx eax, byte [edx + 0x218]
test eax, eax
je 0x40a579
cmp dword [ebp - 8], 0
je 0x40a579
lea ecx, [ebp - 0x118]
push ecx
mov edx, dword [ebp - 0x460]
add edx, 0xa36
push edx
mov eax, dword [ebp - 0x460]
add eax, 0xf4a
push eax
push str._s_s__s
lea ecx, [ebp - 0x450]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
lea edx, [ebp - 0x450]
push edx
mov ecx, dword [ebp - 0x460]
call fcn.0040c7c0
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
lea eax, [ebp - 0x450]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x244], eax
cmp dword [ebp - 0x244], 0xffffffff
je 0x40a574
mov dword [ebp - 0x454], 0
push 0
lea ecx, [ebp - 0x454]
push ecx
mov edx, dword [ebp + 0x18]
push edx
mov eax, dword [ebp + 0x14]
push eax
mov ecx, dword [ebp - 0x244]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x454]
push edx
lea eax, [ebp - 0x450]
push eax
push str.KCPROFKXP::SaveProfileRegValue_nFile____s___ld_bytes_written_n
call fcn.00413880
add esp, 0xc
mov ecx, dword [ebp - 0x244]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 4]
jmp 0x40a5d4
mov edx, dword [ebp + 0x1c]
push edx
mov eax, dword [ebp + 0x18]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
lea edx, [ebp - 0x118]
push edx
push 0x429e0c
mov ecx, dword [ebp - 0x460]
call fcn.004071e0
movzx eax, al
test eax, eax
je 0x40a5bd
mov ecx, dword [ebp + 0x18]
push ecx
lea edx, [ebp - 0x118]
push edx
push str.Success__s___ld_n
call fcn.00413880
add esp, 0xc
jmp 0x40a5d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__ld_n
call fcn.00413880
add esp, 8
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0xc]
xor ecx, ebp
call fcn.00415aa8
mov esp, ebp
pop ebp
ret 0x18