Function at 0x54c790
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
test esi, esi
mov dword [ebp - 8], 0
jne 0x54c7d2
mov eax, dword [0x599834]
test eax, eax
jne 0x54c7ba
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x54c7bf
call fcn.0056b4e0
mov edi, dword [0x599834]
mov dword [ebp + 8], eax
mov dword [ebp - 0xc], edi
mov ebx, 1
jmp 0x54c7f8
mov eax, dword [esi + 0xa8]
mov ebx, dword [esi + 0x108]
mov dword [ebp + 8], eax
mov eax, dword [esi + 0x130]
mov edi, eax
shr edi, 6
shr eax, 7
and edi, 1
and eax, 1
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x54c86b
test esi, esi
mov eax, 1
je 0x54ca55
test dword [esi + 0x128], 0x40000000
je 0x54ca55
mov ecx, dword [esi + 0x28]
mov eax, dword [esi + 0x30]
lea edx, [ebp - 4]
sub eax, ecx
push 0
push edx
push eax
mov eax, dword [ebp + 8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x54c83d
or eax, 0xffffffff
mov ecx, dword [esi + 0xb4]
mov edx, dword [esi + 0x28]
add ecx, edx
mov dword [esi + 0x30], 0
mov dword [esi + 0x34], ecx
mov ecx, dword [esi + 0x128]
and ecx, 0xbfffffff
pop edi
mov dword [esi + 0x128], ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test esi, esi
je 0x54c8a0
mov eax, dword [esi + 0x30]
test eax, eax
je 0x54c8a0
cmp dword [ebp + 0xc], eax
je 0x54c8a0
mov ecx, dword [esi + 0x28]
lea edx, [ebp - 4]
sub eax, ecx
push 0
push edx
push eax
mov eax, dword [ebp + 8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x54c8a0
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x599834]
test eax, eax
je 0x54c93c
test ebx, ebx
jne 0x54c8bb
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
test edi, edi
je 0x54c8d0
cmp ebx, 0xfffffffa
jne 0x54c8d0
mov ebx, dword [ebp + 8]
mov dword [ebp - 8], 1
jmp 0x54c8ed
cmp ebx, 1
je 0x54c8da
cmp ebx, 2
jne 0x54c8ea
mov dword [ebp - 8], 1
call fcn.0056b4e0
mov ebx, eax
jmp 0x54c8ed
mov ebx, dword [ebp + 0xc]
mov eax, dword [0x599834]
test eax, eax
je 0x54c910
test edi, edi
je 0x54c910
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x54c910
push ebx
call fcn.0056b4d0
push ebx
call fcn.0056b4e0
add esp, 8
mov eax, dword [ebp - 8]
test eax, eax
je 0x54c93c
mov esi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
push 0
push ebx
push esi
push ecx
call fcn.0056b4d0
add esp, 0x10
cmp eax, esi
je 0x54ca55
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
test esi, esi
mov eax, 1
je 0x54c9be
test dword [esi + 0x130], 0x10000
je 0x54c9a4
mov edx, dword [esi + 0x28]
mov ecx, dword [ebp + 0xc]
cmp ecx, edx
je 0x54c960
cmp ecx, dword [esi + 0x30]
jne 0x54c9a4
mov ecx, dword [esi + 0xb4]
mov edi, dword [esi + 0x2c]
mov ebx, dword [esi + 0xb0]
lea edi, [edi + ecx*2]
add ebx, edx
cmp ebx, edi
jbe 0x54c9a4
mov edx, dword [ebp + 0xc]
mov edi, dword [ebp + 0x10]
add edx, edi
mov edi, dword [esi + 0x128]
mov dword [esi + 0x30], edx
mov edx, dword [esi + 0x34]
or edi, 0x40000000
add edx, ecx
mov dword [esi + 0x128], edi
mov dword [esi + 0x34], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x30]
mov ecx, dword [ebp + 0xc]
cmp ecx, eax
jne 0x54c9be
mov ecx, dword [esi + 0x28]
mov edx, dword [ebp + 0x10]
sub eax, ecx
mov dword [ebp + 0xc], ecx
add edx, eax
mov dword [ebp + 0x10], edx
mov ebx, dword [ebp + 0x10]
cmp ebx, 0x40000
jg 0x54c9e0
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
lea eax, [ebp - 4]
push 0
push eax
push ebx
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x54ca2a
mov edi, dword [ebp + 0xc]
mov dword [ebp + 0x10], 0x40000
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
lea eax, [ebp - 4]
push 0
push eax
push ecx
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 4]
cmp eax, 1
jne 0x54ca16
sub ebx, ecx
add edi, ecx
cmp ebx, 0x40000
jg 0x54ca16
mov dword [ebp + 0x10], ebx
test ebx, ebx
je 0x54ca23
cmp eax, 1
jne 0x54ca23
test ecx, ecx
ja 0x54c9ea
test eax, eax
jne 0x54ca2a
or eax, 0xffffffff
test esi, esi
je 0x54ca55
mov edi, dword [esi + 0x128]
mov ecx, dword [esi + 0xb4]
mov edx, dword [esi + 0x28]
and edi, 0xbfffffff
add ecx, edx
mov dword [esi + 0x128], edi
mov dword [esi + 0x30], 0
mov dword [esi + 0x34], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret