Function at 0x40151f
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [ebp + 8]
mov edx, dword [0x405390]
push ebx
push esi
xor esi, esi
push edi
mov edi, dword [0x40538c]
mov bl, byte [edi]
xor ecx, ecx
cmp dword [eax], esi
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x28], esi
mov dword [ebp - 8], esi
mov dword [ebp - 0x10], esi
mov dword [ebp - 4], esi
mov dword [ebp - 0x18], ecx
je 0x40155c
inc ecx
cmp dword [eax + ecx*4], esi
jne 0x401553
mov dword [ebp - 0x18], ecx
push 0xd
pop esi
cmp edx, esi
jb 0x4016f6
mov eax, dword [edi + 5]
shl ecx, 2
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x1c], ecx
je 0x4016f6
cmp eax, ecx
jb 0x4016f6
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
mov dword [ebp - 8], eax
jne 0x4015a2
push 0xe
jmp 0x4016f7
cmp bl, 0xe1
jae 0x4016f6
and dword [ebp - 0x24], 0
cmp bl, 0x2d
jb 0x4015c8
xor ah, ah
mov al, bl
mov cl, 0x2d
div cl
movzx eax, al
mov dword [ebp - 0x24], eax
add bl, 0xd3
dec eax
jne 0x4015c2
and dword [ebp - 0x14], 0
cmp bl, 9
jb 0x4015e5
xor ah, ah
mov al, bl
mov cl, 9
div cl
movzx eax, al
mov dword [ebp - 0x14], eax
add bl, 0xf7
dec eax
jne 0x4015df
mov eax, dword [ebp - 0x14]
movzx esi, bl
lea ecx, [esi + eax]
mov ebx, 0x300
shl ebx, cl
lea ebx, [ebx + ebx + 0xe6c]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
mov dword [ebp - 0x10], eax
je 0x40159b
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0xc]
mov eax, dword [ebp - 0x2c]
push dword [ebp - 8]
add eax, 0xfffffff3
push eax
push dword [ebp - 0x24]
lea eax, [edi + 0xd]
push esi
push ebx
push dword [ebp - 0x10]
call fcn.00402037
add esp, 0x20
test eax, eax
jne 0x4016f2
mov eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0xc]
jne 0x4016f2
and dword [ebp - 0x14], 0
cmp dword [ebp - 0x18], 0
jbe 0x4016e1
mov ecx, dword [ebp + 8]
mov esi, dword [ebp - 8]
sub ecx, esi
mov dword [ebp + 8], ecx
jmp 0x40166c
mov ecx, dword [ebp + 8]
mov edi, dword [esi]
mov ebx, dword [ebp - 0x1c]
lea eax, [edi + ebx]
cmp eax, dword [ebp - 0xc]
mov dword [ebp - 0x2c], eax
ja 0x4016f2
push 0
push 0x8000080
push 2
push 0
push 1
push 0x40000000
push dword [ecx + esi]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
je 0x4016fd
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 8]
push edi
add ebx, eax
push ebx
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4016fd
mov eax, dword [ebp - 0x20]
cmp eax, dword [esi]
jne 0x4016fd
mov eax, dword [ebp - 0x2c]
push dword [ebp - 4]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp - 4], 0
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
add esi, 4
cmp eax, dword [ebp - 0x18]
jb 0x401669
mov eax, dword [ebp - 0xc]
cmp dword [ebp - 0x1c], eax
jne 0x4016f2
mov dword [ebp - 0x28], 1
jmp 0x4016fd
push 0xd
jmp 0x4016f7
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 8], 0
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebp - 0x20], eax
je 0x401720
push dword [ebp - 8]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
xor edi, edi
cmp dword [ebp - 0x10], edi
je 0x401734
push dword [ebp - 0x10]
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
cmp dword [ebp - 4], edi
pop edi
pop esi
pop ebx
je 0x40174b
cmp dword [ebp - 4], 0xffffffff
je 0x40174b
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 0x28]
leave
ret