Function at 0x4122f0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4598c8
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
mov eax, dword [0x474454]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov eax, dword [esi]
push 0
push 0x80
mov ebx, 4
push ebx
push 0
push 0
push 0x40000000
push eax
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp + 8], eax
cmp eax, 0xffffffff
jne 0x4124a0
push str.Failed_to_open_file:
lea ecx, [ebp - 0x14]
call fcn.00402280
push str.WriteToFile
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 1
call fcn.00402280
mov eax, dword [0x474238]
mov edx, dword [eax + 0xc]
mov ecx, 0x474238
mov byte [ebp - 4], 2
call edx
add eax, 0x10
mov dword [ebp + 8], eax
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp + 8]
push ecx
lea edx, [ebp - 0x20]
push edx
mov byte [ebp - 4], 3
call fcn.00422410
push esi
push eax
lea eax, [ebp - 0x18]
push eax
mov byte [ebp - 4], bl
call fcn.00422410
push 2
push eax
lea ecx, [ebp - 0x10]
push ecx
mov byte [ebp - 4], 5
call fcn.00406150
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
add esp, 0x24
mov byte [ebp - 4], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4123db
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
mov byte [ebp - 4], 3
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4123fe
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov byte [ebp - 4], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x412421
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x412444
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x412467
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41248d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x1c], 0
mov ecx, dword [edx - 8]
mov esi, dword [edx - 0xc]
mov eax, 1
sub eax, dword [edx - 4]
or ecx, eax
jge 0x4124d6
push 0
lea ecx, [ebp + 0xc]
call fcn.004013c0
mov edx, dword [ebp + 0xc]
push 0
lea ecx, [ebp - 0x1c]
push ecx
push esi
mov esi, dword [ebp + 8]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x4126a4
push str.Failed_to_write_to_file:
lea ecx, [ebp - 0x18]
call fcn.00402280
push str.WriteToFile
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 6
call fcn.00402280
mov byte [ebp - 4], 7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x28]
push edx
call fcn.004224a0
add esp, 8
mov esi, eax
mov eax, dword [0x474238]
mov edx, dword [eax + 0xc]
mov ecx, 0x474238
mov byte [ebp - 4], 8
call edx
add eax, 0x10
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp - 0x24]
push edx
mov byte [ebp - 4], 9
call fcn.00422410
push esi
push eax
lea eax, [ebp - 0x20]
mov bl, 0xa
push eax
mov byte [ebp - 4], bl
call fcn.00422410
push 2
push eax
lea ecx, [ebp - 0x10]
push ecx
mov byte [ebp - 4], 0xb
call fcn.00406150
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
add esp, 0x24
mov byte [ebp - 4], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x41259d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
mov byte [ebp - 4], 9
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4125c0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
mov byte [ebp - 4], 8
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4125e3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
mov byte [ebp - 4], 7
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x412606
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
mov byte [ebp - 4], 6
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x412629
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41264c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [ebp + 8]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x2c], 1
mov eax, dword [ebp + 0xc]
sete bl
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x412691
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str._bytes_to_file
lea ecx, [ebp - 0x10]
call fcn.00402280
push str.Wrote
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0xc
call fcn.00402280
push str.WriteToFile
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 0xd
call fcn.00402280
mov edx, dword [0x474238]
mov eax, dword [edx + 0xc]
mov ecx, 0x474238
mov byte [ebp - 4], 0xe
call eax
add eax, 0x10
mov dword [ebp + 8], eax
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp + 8]
push edx
lea eax, [ebp - 0x20]
push eax
mov byte [ebp - 4], 0xf
call fcn.00422410
mov ecx, dword [ebp - 0x1c]
push ecx
push eax
lea edx, [ebp - 0x24]
push edx
mov byte [ebp - 4], 0x10
call fcn.00422380
lea ecx, [ebp - 0x10]
push ecx
push eax
lea edx, [ebp - 0x28]
mov bl, 0x11
push edx
mov byte [ebp - 4], bl
call fcn.00422410
push 0
push eax
lea eax, [ebp - 0x18]
push eax
mov byte [ebp - 4], 0x12
call fcn.00406150
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
add esp, 0x30
mov byte [ebp - 4], bl
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41275c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
mov byte [ebp - 4], 0x10
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41277f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
mov byte [ebp - 4], 0xf
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4127a2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov byte [ebp - 4], 0xe
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4127c5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
mov byte [ebp - 4], 0xd
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4127e8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
mov byte [ebp - 4], 0xc
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41280b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41264f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x41264f