Function at 0x407120
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x114
mov eax, dword [ebp + 0xc]
mov edx, dword [eax]
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp + 0xc]
mov edi, dword [eax + 4]
push edi
call dword [edx + 0xc]
mov dword [ebp - 0x100], eax
mov eax, dword [ebp + 0xc]
pop ebx
pop esi
mov edx, dword [eax]
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
push ecx
call dword [edx + 0x10]
mov edx, dword [ebp - 0x100]
add esp, 0x10
mov dword [ebp - 0xfc], eax
test edx, edx
je 0x407731
test eax, eax
je 0x407731
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x40775a
mov ecx, 0x10
mov dword [ebp - 0xf4], 0x41d76d
mov edx, dword [ebp - 0x14]
dec edx
lea ebx, [edx + ecx]
mov edx, ebx
mov eax, ebx
sar edx, 0x1f
idiv ecx
sub ebx, edx
mov dword [ebp - 0xf0], ebx
push ecx
push ecx
push 1
push ebx
call fcn.004094f0
add esp, 0xc
mov edx, dword [ebp - 0xf0]
mov dword [ebp - 0xf8], eax
push edx
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 0xfc]
push eax
mov eax, dword [ebp - 0xf8]
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x28]
push eax
mov eax, dword [ebp - 0x14]
push eax
mov edi, dword [ebp - 0xfc]
push edi
call fcn.00417660
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0xf0]
sub edx, eax
add esp, 0x10
cmp edx, 0x13
jg 0x4077e2
mov ebx, dword [ebp - 0xf8]
push ecx
add eax, ebx
push edx
lea edx, [ebp - 0x28]
push edx
push eax
call sub.msvcrt.dll_memcpy
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
pop edi
mov esi, dword [eax + 0x30]
push esi
call sub.msvcrt.dll_strlen
pop ebx
mov ecx, dword [ebp - 0xf4]
mov dword [ebp - 0x108], eax
push ecx
call sub.msvcrt.dll_strlen
pop edx
mov dword [ebp - 0x10c], eax
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 8]
push eax
call sub.msvcrt.dll_strlen
cld
pop esi
mov ecx, 7
pop edi
mov esi, str.putty_private_key_file_mac_key
lea edi, [ebp - 0x5b]
mov dword [ebp - 0x110], eax
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x41d888]
mov dword [ebp - 0x114], ecx
mov word [edi], ax
mov ebx, dword [ebp - 0x10]
mov al, byte [0x41d88a]
mov byte [edi + 2], al
mov eax, dword [ebp - 0x10c]
mov edx, dword [ebp - 0x108]
add eax, ebx
mov ecx, dword [ebp - 0x110]
lea eax, [eax + edx + 0x14]
mov edx, dword [ebp - 0xf0]
add eax, ecx
push 1
lea edi, [eax + edx]
push edi
call fcn.004094f0
mov esi, eax
mov eax, dword [ebp - 0x108]
sar eax, 0x18
add esp, 0xc
mov byte [esi], al
lea ebx, [esi + 4]
mov eax, dword [ebp - 0x108]
sar eax, 0x10
mov byte [esi + 1], al
mov eax, dword [ebp - 0x108]
sar eax, 8
mov byte [esi + 2], al
mov al, byte [ebp - 0x108]
mov byte [esi + 3], al
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
mov edx, dword [ebp - 0x108]
push edx
mov eax, dword [eax + 0x30]
push eax
push ebx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x108]
add ebx, eax
mov eax, dword [ebp - 0x10c]
sar eax, 0x18
add esp, 0xc
mov byte [ebx], al
mov eax, dword [ebp - 0x10c]
sar eax, 0x10
mov byte [ebx + 1], al
mov eax, dword [ebp - 0x10c]
sar eax, 8
mov byte [ebx + 2], al
mov al, byte [ebp - 0x10c]
mov byte [ebx + 3], al
add ebx, 4
mov eax, dword [ebp - 0x10c]
push eax
mov eax, dword [ebp - 0xf4]
push eax
push ebx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x10c]
add ebx, eax
mov eax, dword [ebp - 0x110]
sar eax, 0x18
add esp, 0xc
mov byte [ebx], al
mov eax, dword [ebp - 0x110]
sar eax, 0x10
mov byte [ebx + 1], al
mov eax, dword [ebp - 0x110]
sar eax, 8
mov byte [ebx + 2], al
mov dl, byte [ebp - 0x110]
mov byte [ebx + 3], dl
add ebx, 4
mov eax, dword [ebp - 0x110]
push eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 8]
push ecx
push ebx
call sub.msvcrt.dll_memcpy
mov edx, dword [ebp - 0x110]
mov eax, dword [ebp - 0x10]
add ebx, edx
sar eax, 0x18
add esp, 0xc
mov byte [ebx], al
mov eax, dword [ebp - 0x10]
sar eax, 0x10
mov byte [ebx + 1], al
mov eax, dword [ebp - 0x10]
sar eax, 8
mov byte [ebx + 2], al
mov eax, dword [ebp - 0x10]
mov byte [ebx + 3], al
add ebx, 4
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x100]
push eax
push ebx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x10]
add ebx, eax
mov eax, dword [ebp - 0xf0]
sar eax, 0x18
add esp, 0xc
mov byte [ebx], al
mov eax, dword [ebp - 0xf0]
sar eax, 0x10
mov byte [ebx + 1], al
mov eax, dword [ebp - 0xf0]
sar eax, 8
mov byte [ebx + 2], al
mov dl, byte [ebp - 0xf0]
mov byte [ebx + 3], dl
add ebx, 4
mov eax, dword [ebp - 0xf0]
push eax
mov eax, dword [ebp - 0xf8]
push eax
push ebx
call sub.msvcrt.dll_memcpy
lea eax, [ebp - 0xe4]
mov dword [esp], eax
call fcn.00416f70
add esp, 0xc
lea eax, [ebp - 0x5b]
lea edx, [ebp - 0xe4]
push 0x1e
push eax
push edx
call fcn.00416fd0
mov eax, dword [ebp + 0x10]
add esp, 0x10
test eax, eax
je 0x40776e
sub esp, 0xc
mov ebx, dword [ebp + 0x10]
push ebx
call sub.msvcrt.dll_strlen
add esp, 0xc
lea ebx, [ebp - 0x3c]
push eax
lea eax, [ebp - 0xe4]
mov ecx, dword [ebp + 0x10]
push ecx
push eax
call fcn.00416fd0
pop eax
pop edx
lea edx, [ebp - 0xe4]
push ebx
push edx
call fcn.00417260
lea eax, [ebp - 0x28]
mov dword [esp], eax
push edi
push esi
push 0x14
push ebx
call fcn.00417380
add esp, 0x1c
push edi
push 0
push esi
call sub.msvcrt.dll_memset
mov dword [esp], esi
call fcn.004093f0
add esp, 0xc
lea edx, [ebp - 0xe4]
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
push 0x60
push 0
push edx
call sub.msvcrt.dll_memset
pop eax
mov eax, dword [ebp + 0x10]
push eax
call sub.msvcrt.dll_strlen
mov ebx, eax
lea eax, [ebp - 0xe4]
mov dword [esp], eax
call fcn.00416f70
add esp, 0xc
lea edx, [ebp - 0xe4]
push 4
push 0x41d7f0
push edx
call fcn.00416fd0
add esp, 0xc
push ebx
mov eax, dword [ebp + 0x10]
push eax
lea eax, [ebp - 0xe4]
push eax
call fcn.00416fd0
lea edx, [ebp - 0xe4]
pop esi
pop edi
lea edi, [ebp - 0x83]
push edi
push edx
call fcn.00417260
lea eax, [ebp - 0xe4]
mov dword [esp], eax
call fcn.00416f70
add esp, 0xc
lea edx, [ebp - 0xe4]
push 4
push 0x41d7f5
push edx
call fcn.00416fd0
add esp, 0xc
push ebx
lea eax, [ebp - 0xe4]
mov ecx, dword [ebp + 0x10]
push ecx
push eax
call fcn.00416fd0
pop eax
lea eax, [ebp - 0x6f]
pop edx
lea edx, [ebp - 0xe4]
push eax
push edx
call fcn.00417260
add esp, 0xc
mov eax, dword [ebp - 0xf0]
push eax
mov esi, dword [ebp - 0xf8]
push esi
push edi
call fcn.00410260
mov eax, dword [ebp - 0x114]
cld
mov ecx, 0xa
add esp, 0xc
rep stosd dword es:[edi], eax
lea edx, [ebp - 0xe4]
push 0x60
push 0
push edx
call sub.msvcrt.dll_memset
add esp, 0x10
push ecx
push ecx
push 0x41d7fa
mov edx, dword [ebp + 8]
push edx
call sub.msvcrt.dll_fopen
mov esi, eax
add esp, 0x10
xor eax, eax
test esi, esi
je 0x407729
push eax
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
mov eax, dword [eax + 0x30]
push eax
push str.PuTTY_User_Key_File_2:__s_n
push esi
call sub.msvcrt.dll_fprintf
add esp, 0xc
mov eax, dword [ebp - 0xf4]
push eax
push str.Encryption:__s_n
push esi
call sub.msvcrt.dll_fprintf
mov eax, dword [ebp + 0xc]
add esp, 0xc
mov eax, dword [eax + 8]
push eax
push str.Comment:__s_n
push esi
call sub.msvcrt.dll_fprintf
add esp, 0xc
mov eax, dword [ebp - 0x10]
push eax
call fcn.00406ee0
mov dword [esp], eax
push str.Public_Lines:__d_n
push esi
call sub.msvcrt.dll_fprintf
add esp, 0x10
push 0x40
mov eax, dword [ebp - 0x10]
push eax
mov edi, dword [ebp - 0x100]
push edi
push esi
call fcn.00407080
add esp, 0xc
mov ebx, dword [ebp - 0xf0]
push ebx
call fcn.00406ee0
mov dword [esp], eax
push str.Private_Lines:__d_n
push esi
call sub.msvcrt.dll_fprintf
add esp, 0x10
mov ebx, 2
push 0x40
mov ecx, dword [ebp - 0xf0]
push ecx
mov edx, dword [ebp - 0xf8]
push edx
push esi
call fcn.00407080
add esp, 0x10
push esi
push 0xd
push 1
push str.Private_MAC:
call sub.msvcrt.dll_fwrite
add esp, 0xc
xor eax, eax
mov al, byte [ebp - 0x28]
push eax
push str._02x
push esi
call sub.msvcrt.dll_fprintf
add esp, 0x10
push eax
xor eax, eax
mov al, byte [ebx + ebp - 0x29]
inc ebx
push eax
push str._02x
push esi
call sub.msvcrt.dll_fprintf
add esp, 0x10
cmp ebx, 0x15
jne 0x4076b7
push eax
push eax
push esi
push 0xa
call sub.msvcrt.dll_fputc
mov dword [esp], esi
call sub.msvcrt.dll_fclose
pop eax
mov eax, dword [ebp - 0x100]
push eax
call fcn.004093f0
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
push 0
mov eax, dword [ebp - 0xfc]
push eax
call sub.msvcrt.dll_memset
pop edi
mov esi, dword [ebp - 0xfc]
push esi
call fcn.004093f0
pop ebx
mov ecx, dword [ebp - 0xf8]
push ecx
call fcn.004093f0
mov eax, 1
add esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
sub esp, 0xc
mov eax, dword [ebp - 0x100]
push eax
call fcn.004093f0
pop edi
mov esi, dword [ebp - 0xfc]
push esi
call fcn.004093f0
xor eax, eax
add esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, 1
mov dword [ebp - 0xf4], str.none
jmp 0x407193
lea eax, [ebp - 0xe4]
push ebx
push ebx
lea ebx, [ebp - 0x3c]
push ebx
push eax
call fcn.00417260
lea edx, [ebp - 0x28]
mov dword [esp], edx
push edi
push esi
push 0x14
push ebx
call fcn.00417380
add esp, 0x1c
push edi
push 0
push esi
call sub.msvcrt.dll_memset
mov dword [esp], esi
call fcn.004093f0
add esp, 0xc
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
lea eax, [ebp - 0xe4]
push 0x60
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0x10
jmp 0x4075c5
push esi
push 0x43b
push str._home_nightlybuild_buildroot_packages_FileZilla3_src_putty_sshpubk.c
push str.priv_encrypted_len___priv_blob_len___20
call sub.msvcrt.dll__assert
mov esi, esi
lea edi, [edi]