Function at 0x129955f
Capabilities:
Allocate or change rwx memory
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x338
call fcn.01299bc2
mov dword [ebp - 0x24], eax
mov eax, dword [0x129eeb8]
mov dword [ebp - 0x28], eax
mov eax, dword [0x129eebc]
mov dword [ebp - 0x18], eax
push 0x40
push 0x3000
push dword [ebp - 0x18]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0xc], eax
cmp dword [0x129eeac], 1
jne 0x1299603
push 0x208
push 0
lea eax, [ebp - 0x338]
push eax
call fcn.01292142
add esp, 0xc
push 0x208
lea eax, [ebp - 0x338]
push eax
call fcn.01299c40
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x129121c
lea eax, [ebp - 0x338]
push eax
call fcn.01292170
pop ecx
pop ecx
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x338]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x129ee58], eax
cmp dword [0x129eeac], 1
jne 0x1299669
push 0x104
push 0
lea eax, [ebp - 0x130]
push eax
call fcn.01292142
add esp, 0xc
lea eax, [ebp - 0x130]
push eax
call fcn.01299c74
pop ecx
push 0x129122c
lea eax, [ebp - 0x130]
push eax
call fcn.01292170
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x130]
push eax
call fcn.01292197
pop ecx
push eax
lea eax, [ebp - 0x130]
push eax
push dword [0x129ee58]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x28]
push dword [ebp - 0x24]
push dword [ebp - 0x18]
push dword [ebp - 0xc]
call fcn.0129ab62
add esp, 0x10
mov dword [ebp - 0x18], eax
push dword [ebp - 0x24]
call fcn.01299b95
pop ecx
cmp dword [0x129eeac], 1
jne 0x12996ef
push 0x104
push 0
lea eax, [ebp - 0x130]
push eax
call fcn.01292142
add esp, 0xc
lea eax, [ebp - 0x130]
push eax
call fcn.01299c74
pop ecx
push 0x1291244
lea eax, [ebp - 0x130]
push eax
call fcn.01292170
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x130]
push eax
call fcn.01292197
pop ecx
push eax
lea eax, [ebp - 0x130]
push eax
push dword [0x129ee58]
call dword [sym.imp.KERNEL32.dll_WriteFile]
and dword [ebp - 4], 0
jmp 0x12996fc
mov eax, dword [ebp - 4]
inc eax
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp eax, dword [0x129eec0]
je 0x129976f
imul eax, dword [ebp - 4], 0xc
mov eax, dword [eax + 0x129eec4]
add eax, 0x129ee60
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x20]
push eax
push 0x40
imul eax, dword [ebp - 4], 0xc
push dword [eax + 0x129eec8]
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
imul eax, dword [ebp - 4], 0xc
push dword [eax + 0x129eec8]
imul eax, dword [ebp - 4], 0xc
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax + 0x129eecc]
push ecx
push dword [ebp - 0x1c]
call fcn.012920f6
add esp, 0xc
push 0
push dword [ebp - 0x20]
imul eax, dword [ebp - 4], 0xc
push dword [eax + 0x129eec8]
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
jmp 0x12996f5
push dword [0x129ee84]
mov eax, dword [0x129ee80]
add eax, 0x129ee60
push eax
mov eax, dword [0x129ee70]
add eax, 0x129ee60
push eax
call fcn.012999c7
add esp, 0xc
cmp dword [0x129eeac], 1
jne 0x12997f9
push 0x104
push 0
lea eax, [ebp - 0x130]
push eax
call fcn.01292142
add esp, 0xc
lea eax, [ebp - 0x130]
push eax
call fcn.01299c74
pop ecx
push 0x129125c
lea eax, [ebp - 0x130]
push eax
call fcn.01292170
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x130]
push eax
call fcn.01292197
pop ecx
push eax
lea eax, [ebp - 0x130]
push eax
push dword [0x129ee58]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, 0x129ee60
sub eax, dword [0x129ee68]
push eax
push dword [0x129ee7c]
mov eax, dword [ebp - 0xc]
add eax, dword [0x129ee78]
push eax
mov eax, dword [0x129ee70]
add eax, 0x129ee60
push eax
call fcn.01299ccc
add esp, 0x10
cmp dword [0x129eeac], 1
jne 0x129988e
push 0x104
push 0
lea eax, [ebp - 0x130]
push eax
call fcn.01292142
add esp, 0xc
lea eax, [ebp - 0x130]
push eax
call fcn.01299c74
pop ecx
push 0x129126c
lea eax, [ebp - 0x130]
push eax
call fcn.01292170
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x130]
push eax
call fcn.01292197
pop ecx
push eax
lea eax, [ebp - 0x130]
push eax
push dword [0x129ee58]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0x8000
push 0
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
cmp dword [0x129eeac], 1
jne 0x1299910
push 0x104
push 0
lea eax, [ebp - 0x130]
push eax
call fcn.01292142
add esp, 0xc
lea eax, [ebp - 0x130]
push eax
call fcn.01299c74
pop ecx
push 0x1291280
lea eax, [ebp - 0x130]
push eax
call fcn.01292170
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x130]
push eax
call fcn.01292197
pop ecx
push eax
lea eax, [ebp - 0x130]
push eax
push dword [0x129ee58]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [0x129ee58]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x129ee8c], 0
je 0x12999c1
cmp dword [0x129ee90], 0
je 0x12999c1
and dword [ebp - 8], 0
and dword [ebp - 0x2c], 0
mov eax, dword [0x129ee88]
add eax, 0x129ee60
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x20]
push eax
push 0x40
push 8
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x129ee8c]
mov dword [eax], ecx
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x129ee90]
mov dword [eax + 4], ecx
push 0
push dword [ebp - 0x20]
push 8
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push 0x1291294
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x1299999
push 0x1291294
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x12999b0
push 0x12912a0
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x2c], eax
mov eax, dword [0x129ee70]
add eax, 0x129ee60
push eax
call fcn.01292304
pop ecx
xor eax, eax
mov esp, ebp
pop ebp
ret