Function at 0x822c5c0
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
cmp dword [edi + 0x15c], 0
lea esi, [edi + 0x2a8]
lea ebx, [edi + 0x168]
je 0x822c79c
cmp dword [esi], 0
jne 0x822c605
push ebx
push edi
call fcn.0822c2d0
movzx eax, ax
add esp, 8
test ax, ax
je 0x822c614
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x164]
cmp eax, dword [esi + 4]
jbe 0x822c79c
mov eax, dword [edi + 0x160]
mov ecx, dword [esi]
dec eax
imul eax, dword [esi + 8]
push 0
push eax
push ecx
call dword [sym.imp.msvcrt.dll_fseek]
add esp, 0xc
test eax, eax
je 0x822c654
push 0
push 0
push 0x27
push 0
push 0
push 0
add edi, 8
push edi
call fcn.0822a430
add esp, 0x1c
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebx], 1
jne 0x822c665
movzx edx, word [edi + 0x144]
mov dword [ebp - 8], edx
jmp 0x822c674
push edi
call fcn.08225290
movzx eax, ax
add esp, 4
mov dword [ebp - 8], eax
cmp dword [edi + 0x15c], 0
mov dword [ebp - 4], 0
jbe 0x822c78e
mov ebx, dword [sym.imp.msvcrt.dll_fwrite]
mov edi, edi
mov ecx, dword [esi]
mov eax, dword [ebp - 4]
mov edx, dword [edi + 0x148]
push ecx
add eax, eax
push 1
add edx, eax
push 2
push edx
call ebx
add esp, 0x10
push 0
test eax, eax
je 0x822c634
push edi
mov dword [ebp - 0x10], 0
call fcn.082252c0
xor ecx, ecx
add esp, 8
cmp cx, word [ebp - 8]
jge 0x822c77b
lea edi, [eax + 0x68]
nop
mov eax, dword [ebp + 8]
add eax, 0x168
cmp dword [eax], 3
jne 0x822c72f
mov edx, dword [esi]
mov eax, dword [ebp - 4]
mov ecx, dword [edi - 4]
push edx
push 1
add eax, eax
add ecx, eax
push 2
push ecx
call ebx
add esp, 0x10
test eax, eax
je 0x822c7ac
mov eax, dword [edi]
test eax, eax
je 0x822c710
mov ecx, dword [ebp - 4]
add ecx, ecx
movzx edx, word [eax + ecx]
mov dword [ebp - 0xc], edx
jmp 0x822c717
mov dword [ebp - 0xc], 0xffffffff
mov eax, dword [esi]
push eax
push 1
lea ecx, [ebp - 0xc]
push 2
push ecx
call ebx
add esp, 0x10
test eax, eax
je 0x822c7d1
movzx eax, word [edi - 0x1c]
cmp ax, 8
je 0x822c7a5
cmp ax, 0x18
je 0x822c7a5
mov eax, dword [edi - 0x18]
test eax, eax
je 0x822c764
mov edx, dword [esi]
push edx
push 1
push eax
mov eax, dword [edi - 0x14]
imul eax, dword [ebp - 4]
add eax, dword [edi - 8]
push eax
call ebx
add esp, 0x10
test eax, eax
je 0x822c7f6
mov eax, dword [ebp - 0x10]
inc eax
sub edi, 0xffffff80
cmp ax, word [ebp - 8]
mov dword [ebp - 0x10], eax
jl 0x822c6d0
mov edi, dword [ebp + 8]
mov eax, dword [ebp - 4]
inc eax
mov dword [ebp - 4], eax
cmp eax, dword [edi + 0x15c]
jb 0x822c690
mov edi, dword [edi + 0x164]
cmp dword [esi + 4], edi
jae 0x822c79c
mov dword [esi + 4], edi
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 8
jmp 0x822c746
mov ecx, dword [ebp + 8]
push 0
push 0
push 0x27
push 0
push 0
add ecx, 8
push 0
push ecx
call fcn.0822a430
add esp, 0x1c
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 8]
push 0
push 0
push 0x27
push 0
push 0
add edx, 8
push 0
push edx
call fcn.0822a430
add esp, 0x1c
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
push 0
push 0
push 0x27
push 0
push 0
add eax, 8
push 0
push eax
call fcn.0822a430
add esp, 0x1c
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret