Function at 0x531640
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x597a4b
mov eax, dword fs:[0]
push eax
mov eax, 0x1470
call fcn.005965e0
mov eax, dword [0x601018]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
mov dword [ebp - 0x1478], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x146c], ecx
mov ecx, dword [esi + 0x578]
mov dword [ebp - 0x1474], eax
xor eax, eax
mov dword [ebp - 0x1468], esi
mov dword [ebp - 0x1470], edx
mov dword [ebp - 0x1464], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov byte [ebp - 0x18], al
cmp ecx, 1
jne 0x5316d6
mov ecx, dword [ebp + 0xc]
push ecx
push edx
lea ebx, [ebp - 0x1464]
lea edi, [ebp - 0x28]
mov dword [ebp - 0x1464], eax
call fcn.005306f0
jmp 0x531710
cmp ecx, 2
jne 0x5316f6
mov dword [ebp - 0x1464], eax
mov eax, dword [ebp + 0xc]
push eax
push edx
lea edi, [ebp - 0x1464]
lea esi, [ebp - 0x28]
call fcn.005309a0
jmp 0x53170a
mov ecx, dword [ebp + 0xc]
push ecx
lea esi, [ebp - 0x1464]
lea ebx, [ebp - 0x28]
mov ecx, edx
call fcn.00530440
mov esi, dword [ebp - 0x1468]
xor ebx, ebx
cmp eax, ebx
je 0x53171e
or eax, 0xffffffff
jmp 0x531a95
mov edi, dword [esi + 0x38]
push 0x400
lea edx, [ebp - 0xc2c]
push ebx
push edx
mov dword [ebp - 0x1468], ebx
call sub.MSVCR100.dll_memset
add esp, 0xc
push 0x400
lea eax, [ebp - 0x82c]
push ebx
push eax
call sub.MSVCR100.dll_memset
add edi, 0xffffff80
add esp, 0xc
neg edi
sbb edi, edi
and edi, 0xfffffff5
add edi, 0x10
cmp edi, ebx
jle 0x531776
push edi
lea ecx, [ebp - 0x28]
push ecx
lea edx, [ebp - 0x82c]
push edx
call sub.MSVCR100.dll_memcpy
add esp, 0xc
mov edx, dword [ebp + 0x14]
push 1
lea eax, [ebp - 0x1468]
push eax
lea ecx, [ebp - 0xc2c]
push ecx
mov ecx, dword [ebp - 0x1478]
push edx
push edi
push esi
lea edx, [ebp - 0x82c]
call fcn.00530a60
test eax, eax
jne 0x531716
push 0x400
lea eax, [ebp - 0x42c]
push ebx
push eax
mov dword [ebp - 0x1460], ebx
call sub.MSVCR100.dll_memset
add esp, 0xc
push ebx
mov ebx, dword [ebp - 0x1468]
lea ecx, [ebp - 0x1460]
push ecx
lea edx, [ebp - 0x42c]
push edx
push ebx
push edi
push esi
lea ecx, [ebp - 0xc2c]
lea edx, [ebp - 0x82c]
call fcn.00530a60
test eax, eax
jne 0x531716
mov edx, dword [ebp - 0x1474]
xor ecx, ecx
mov dword [edx], ebx
cmp ebx, ecx
jle 0x53181d
mov eax, dword [ebp - 0x146c]
lea edi, [ebp - 0xc2c]
sub edi, eax
lea ecx, [ecx]
mov bl, byte [edi + eax]
mov byte [eax], bl
inc ecx
inc eax
cmp ecx, dword [edx]
jl 0x531810
xor ecx, ecx
mov eax, dword [edx]
mov edx, dword [ebp - 0x146c]
mov byte [edx + eax], 0
cmp dword [esi + 0x174], ecx
je 0x531a93
cmp byte [esi + 0x178], 0
je 0x531a93
mov byte [ebp - 0x145c], 0
mov byte [ebp - 0x1044], 0
mov dword [ebp - 0x1054], 1
mov dword [ebp - 0x105c], ecx
mov dword [ebp - 0x1058], ecx
mov dword [ebp - 0xc44], ecx
mov dword [ebp - 0xc38], ecx
lea edi, [esi + 0x178]
lea eax, [ebp - 0x145c]
mov dword [ebp - 4], ecx
call fcn.00550d90
mov esi, dword [ebp - 0x105c]
cmp esi, 0xffffffff
je 0x531a59
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x1460]
push eax
push 0xa
push str.prekey___
push esi
call ebx
test eax, eax
je 0x5318be
mov dword [ebp - 0x1058], 0
jmp 0x5318ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1058], eax
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp - 0x1470]
lea edi, [ebp - 0x145c]
call fcn.00551180
mov esi, dword [ebp - 0x105c]
push 0
lea ecx, [ebp - 0x1460]
push ecx
push 3
push 0x5eb920
push esi
call ebx
test eax, eax
jne 0x531901
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x1470]
lea eax, [ebp - 0x42c]
call fcn.0050b3d0
mov dword [ebp - 0x1464], eax
test eax, eax
jle 0x531988
push 0
lea edx, [ebp - 0x1460]
push edx
push 0xe
push str.prekey_hex___
push esi
call ebx
test eax, eax
je 0x531942
mov dword [ebp - 0x1058], 0
jmp 0x53194e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1058], eax
mov eax, dword [ebp - 0x1464]
lea esi, [ebp - 0x42c]
lea edi, [ebp - 0x145c]
call fcn.00551180
mov esi, dword [ebp - 0x105c]
push 0
lea eax, [ebp - 0x1460]
push eax
push 3
push 0x5eb920
push esi
call ebx
test eax, eax
jne 0x531988
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
lea ecx, [ebp - 0x1460]
push ecx
push 8
push str.data___
push esi
call ebx
test eax, eax
je 0x5319ab
mov dword [ebp - 0x1058], 0
jmp 0x5319b7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1058], eax
mov eax, dword [ebp + 0x14]
mov esi, dword [ebp - 0x1478]
lea edi, [ebp - 0x145c]
call fcn.00551180
mov esi, dword [ebp - 0x105c]
push 0
lea edx, [ebp - 0x1460]
push edx
push 3
push 0x5eb920
push esi
call ebx
test eax, eax
jne 0x5319ee
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
lea eax, [ebp - 0x1460]
push eax
push 0xa
push str.output___
push esi
call ebx
test eax, eax
je 0x531a11
mov dword [ebp - 0x1058], 0
jmp 0x531a1d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1058], eax
mov ecx, dword [ebp - 0x1474]
mov eax, dword [ecx]
mov esi, dword [ebp - 0x146c]
lea edi, [ebp - 0x145c]
call fcn.00551180
mov esi, dword [ebp - 0x105c]
push 0
lea edx, [ebp - 0x1460]
push edx
push 3
push 0x5eb920
push esi
call ebx
test eax, eax
jne 0x531a59
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [ebp - 0xc44]
test edi, edi
je 0x531a6f
push edi
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
xor edi, edi
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x531a7e
push esi
call ebx
xor esi, esi
test edi, edi
je 0x531a8c
push edi
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
test esi, esi
je 0x531a93
push esi
call ebx
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00596083
mov esp, ebp
pop ebp
ret 0x14