Function at 0x10151304
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x13c
mov eax, dword [0x101dc354]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov eax, edx
push edi
mov edi, ecx
mov dword [ebp - 0x134], eax
xor ecx, ecx
mov esi, ecx
mov dword [ebp - 0x130], ecx
mov ebx, ecx
mov dword [ebp - 0x124], esi
mov dword [ebp - 0x114], ecx
cmp dword [eax + 0xc], ecx
je 0x1015159e
push 0x100623cc
push ecx
push ecx
push 0x4000000
call fcn.100ab973
mov ecx, dword [edi + 0x268]
lea edx, [ebp - 0x114]
add esp, 0x10
call fcn.101ce59a
mov ebx, eax
mov dword [ebp - 0x138], ebx
test ebx, ebx
jns 0x10151392
push 0x1005f1a8
push 1
push ebx
push 0x4000000
call fcn.100ab973
add esp, 0x10
jmp 0x1015159e
xor edi, edi
push edi
push 0x80
push 4
push edi
push 1
push 0x40000000
push dword [ebp - 0x114]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileW]
push eax
lea ecx, [ebp - 0x124]
call fcn.100e899b
mov esi, dword [ebp - 0x124]
mov ecx, esi
call fcn.10094ff1
test al, al
je 0x101513f2
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jle 0x101513e4
movzx ebx, bx
or ebx, 0x80070000
test ebx, ebx
js 0x101513eb
mov ebx, 0x80004005
push 0x1006244c
jmp 0x1015137d
push 2
push edi
push edi
push esi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
mov eax, dword [ebp - 0x134]
mov ecx, edi
mov dword [ebp - 0x12c], ecx
cmp dword [eax + 0xc], edi
jbe 0x1015159e
xor edx, edx
push ecx
mov ecx, eax
mov dword [ebp - 0x118], edx
call fcn.100f58ce
mov eax, dword [eax]
mov edx, dword [eax + 0x48]
mov dword [ebp - 0x120], edx
test edx, edx
jne 0x1015143e
mov edx, 0x100082e8
mov dword [ebp - 0x120], edx
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x11c], eax
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x130]
jne 0x10151449
sub ecx, dword [ebp - 0x11c]
mov eax, dword [ebp - 0x12c]
push edx
sar ecx, 1
inc eax
push eax
mov dword [ebp - 0x12c], eax
xor eax, eax
push 0x1006243c
push eax
push eax
push 0x4000000
mov dword [ebp - 0x11c], ecx
call fcn.100ab973
mov ecx, dword [ebp - 0x120]
add esp, 0x18
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x130]
jne 0x10151494
sub ecx, edx
sar ecx, 1
cmp ecx, 0x104
jb 0x101514da
mov eax, dword [ebp - 0x11c]
add eax, 2
push eax
call fcn.100b84fe
mov edi, eax
mov dword [ebp - 0x128], edi
pop ecx
test edi, edi
jne 0x101514e6
mov ebx, 0x8007000e
push 0x1005135c
jmp 0x1015137d
lea eax, [ebp - 0x110]
mov dword [ebp - 0x128], eax
mov ecx, dword [ebp - 0x11c]
xor eax, eax
mov edx, eax
test ecx, ecx
je 0x10151519
mov esi, dword [ebp - 0x128]
mov ebx, dword [ebp - 0x120]
mov al, byte [ebx + edx*2]
mov byte [edx + esi], al
inc edx
cmp edx, ecx
jb 0x10151500
mov esi, dword [ebp - 0x124]
xor eax, eax
mov ebx, dword [ebp - 0x138]
mov edx, dword [ebp - 0x128]
push eax
lea eax, [ebp - 0x118]
push eax
lea eax, [ecx + 2]
mov word [ecx + edx], 0xa0d
push eax
push edx
push esi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
test eax, eax
je 0x10151560
test edi, edi
je 0x10151548
push edi
call fcn.100b84f9
pop ecx
mov eax, dword [ebp - 0x134]
mov ecx, dword [ebp - 0x12c]
cmp ecx, dword [eax + 0xc]
jae 0x1015159e
xor edi, edi
jmp 0x10151414
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jle 0x10151577
movzx ebx, bx
or ebx, 0x80070000
test ebx, ebx
js 0x1015157e
mov ebx, 0x80004005
push 0x1006248c
push 1
push ebx
push 0x4000000
call fcn.100ab973
add esp, 0x10
test edi, edi
je 0x1015159e
push edi
call fcn.100b84f9
pop ecx
lea ecx, [ebp - 0x114]
call fcn.100b61be
mov ecx, esi
call fcn.10094ff1
test al, al
jne 0x101515c4
push esi
call dword [sym.imp.ntdll.dll_NtClose]
test eax, eax
jns 0x101515c4
push 7
pop ecx
int 0x29
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100b88c0
leave
ret