Function at 0x51b000
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xf4
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov al, byte [edi + 0x14]
push eax
call fcn.005163b0
mov cl, byte [edi + 0x15]
mov esi, eax
push ecx
shl esi, 4
call fcn.005163b0
mov dl, byte [edi + 0x16]
add esi, eax
push edx
mov dword [ebp - 0x28], esi
call fcn.005163b0
mov esi, eax
mov al, byte [edi + 0x17]
push eax
shl esi, 4
call fcn.005163b0
mov cl, byte [edi + 0x18]
add esi, eax
push ecx
mov dword [ebp - 0x34], esi
call fcn.005163b0
mov dl, byte [edi + 0x19]
mov esi, eax
push edx
shl esi, 4
call fcn.005163b0
add esi, eax
mov al, byte [edi + 0x1e]
push eax
mov dword [ebp - 0x30], esi
call fcn.005163b0
mov cl, byte [edi + 0x1f]
mov esi, eax
push ecx
shl esi, 4
call fcn.005163b0
mov dl, byte [edi + 0x20]
add esi, eax
push edx
mov dword [ebp - 0x3c], esi
call fcn.005163b0
mov esi, eax
mov al, byte [edi + 0x21]
push eax
shl esi, 4
call fcn.005163b0
mov cl, byte [edi + 0x22]
add esi, eax
push ecx
mov dword [ebp - 0x38], esi
call fcn.005163b0
mov dl, byte [edi + 0x23]
mov esi, eax
push edx
shl esi, 4
call fcn.005163b0
add esi, eax
mov eax, dword [edi + 0x7590]
mov dword [ebp - 0x2c], esi
add esp, 0x30
lea ecx, [eax + eax*2]
mov eax, 0x2000
cdq
idiv ecx
mov esi, eax
test esi, esi
mov dword [ebp - 8], esi
jne 0x51b0de
mov dword [ebp - 8], 1
mov esi, dword [ebp - 8]
mov ecx, dword [edi + 0x7594]
mov eax, ecx
cdq
idiv esi
mov ebx, eax
mov eax, ecx
cdq
idiv esi
mov dword [ebp + 8], ebx
test edx, edx
je 0x51b0fb
inc ebx
mov dword [ebp + 8], ebx
cmp esi, ecx
jle 0x51b104
mov dword [ebp - 8], ecx
mov esi, ecx
cmp ebx, 1
jne 0x51b120
mov eax, esi
mov dword [ebp + 8], 2
cdq
mov ebx, dword [ebp + 8]
sub eax, edx
sar eax, 1
inc eax
mov dword [ebp - 8], eax
mov esi, eax
shl ebx, 2
mov eax, ebx
add eax, 3
and al, 0xfc
call fcn.0051c710
mov eax, ebx
mov dword [ebp - 0x1c], esp
add eax, 3
and al, 0xfc
call fcn.0051c710
mov edx, dword [ebp + 8]
mov ecx, esp
test edx, edx
mov dword [ebp - 0x10], ecx
mov ebx, 8
mov dword [ebp - 4], 0
jle 0x51b205
mov eax, dword [ebp - 0x1c]
sub eax, esp
mov dword [ebp - 0x14], eax
jmp 0x51b167
mov eax, dword [ebp - 0x14]
mov dword [eax + ecx], ebx
lea eax, [edx - 1]
cmp dword [ebp - 4], eax
jne 0x51b18d
mov eax, dword [edi + 0x7594]
cdq
idiv esi
test edx, edx
je 0x51b18d
imul edx, dword [edi + 0x7590]
lea eax, [edx + edx*2]
mov dword [ecx], eax
jmp 0x51b19b
mov eax, esi
imul eax, dword [edi + 0x7590]
lea edx, [eax + eax*2]
mov dword [ecx], edx
add ebx, dword [ecx]
mov eax, ebx
and eax, 0x80000001
jns 0x51b1ab
dec eax
or eax, 0xfffffffe
inc eax
cmp eax, 1
jne 0x51b1b1
inc ebx
mov eax, dword [ebp - 4]
mov edx, dword [ebp + 8]
inc eax
add ecx, 4
cmp eax, edx
mov dword [ebp - 4], eax
jl 0x51b164
cmp ebx, 0xffff0000
jbe 0x51b205
mov ecx, dword [ebp - 0x1c]
push ecx
call sub.MSVCRT.dll_free
mov edx, dword [ebp - 0x10]
push edx
call sub.MSVCRT.dll_free
add esp, 8
add edi, 0x7528
mov ecx, 7
mov esi, str.670:_Output_file_size_too_big
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov eax, 0xb
lea esp, [ebp - 0x100]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test byte [edi + 0x10], 8
je 0x51b2cf
mov eax, dword [sym.imp.MSVCRT.dll_vsprintf]
push 0x8000
push eax
call sub.MSVCRT.dll__setmode
add esp, 8
cmp eax, 0xffffffff
jne 0x51b24b
add edi, 0x7528
mov ecx, 7
mov esi, str.671:_Cant_open_output_file
mov eax, 0xa
rep movsd dword es:[edi], dword [esi]
lea esp, [ebp - 0x100]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, sym.imp.MSVCRT.dll_fopen
push esi
push 1
lea edx, [ebp - 0x44]
push 8
push edx
mov word [ebp - 0x44], 0x4949
mov word [ebp - 0x42], 0x2a
mov dword [ebp - 0x40], ebx
call sub.MSVCRT.dll_fwrite
mov eax, dword [edi + 0x7594]
xor ecx, ecx
add esp, 0x10
add ebx, 0xae
cmp eax, ecx
mov dword [ebp - 4], ecx
mov dword [ebp - 0x24], ecx
jle 0x51b43d
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x18], eax
mov eax, dword [edi + 0x7590]
mov dword [ebp - 0x14], ecx
cmp eax, ecx
jle 0x51b3e5
imul eax, dword [ebp - 0x24]
add eax, ecx
mov ecx, dword [ebp + 0xc]
mov dl, byte [eax + ecx]
mov eax, dword [esi + 4]
cmp dl, 0x31
jne 0x51b35c
dec eax
mov dword [esi + 4], eax
js 0x51b30e
mov edx, dword [esi]
mov al, byte [ebp - 0x28]
mov byte [edx], al
mov eax, dword [esi]
inc eax
mov dword [esi], eax
jmp 0x51b31b
lea ecx, [edi + 0x28]
push 0x56c254
push ecx
call sub.MSVCRT.dll_fopen
mov esi, eax
add esp, 8
test esi, esi
jne 0x51b250
add edi, 0x7528
mov ecx, 7
mov esi, str.672:_Cant_open_output_file
mov eax, 0xa
rep movsd dword es:[edi], dword [esi]
lea esp, [ebp - 0x100]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x28]
push esi
push ecx
call sub.MSVCRT.dll__flsbuf
add esp, 8
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
js 0x51b332
mov edx, dword [esi]
mov al, byte [ebp - 0x34]
mov byte [edx], al
mov eax, dword [esi]
inc eax
mov dword [esi], eax
jmp 0x51b33f
mov ecx, dword [ebp - 0x34]
push esi
push ecx
call sub.MSVCRT.dll__flsbuf
add esp, 8
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
js 0x51b356
mov edx, dword [esi]
mov al, byte [ebp - 0x30]
mov byte [edx], al
mov eax, dword [esi]
inc eax
mov dword [esi], eax
jmp 0x51b3c5
mov ecx, dword [ebp - 0x30]
push esi
jmp 0x51b3bc
dec eax
mov dword [esi + 4], eax
js 0x51b370
mov edx, dword [esi]
mov al, byte [ebp - 0x3c]
mov byte [edx], al
mov eax, dword [esi]
inc eax
mov dword [esi], eax
jmp 0x51b37d
mov ecx, dword [ebp - 0x3c]
push esi
push ecx
call sub.MSVCRT.dll__flsbuf
add esp, 8
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
js 0x51b394
mov edx, dword [esi]
mov al, byte [ebp - 0x38]
mov byte [edx], al
mov eax, dword [esi]
inc eax
mov dword [esi], eax
jmp 0x51b3a1
mov ecx, dword [ebp - 0x38]
push esi
push ecx
call sub.MSVCRT.dll__flsbuf
add esp, 8
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
js 0x51b3b8
mov edx, dword [esi]
mov al, byte [ebp - 0x2c]
mov byte [edx], al
mov eax, dword [esi]
inc eax
mov dword [esi], eax
jmp 0x51b3c5
mov ecx, dword [ebp - 0x2c]
push esi
push ecx
call sub.MSVCRT.dll__flsbuf
add esp, 8
mov ecx, dword [ebp - 4]
mov eax, dword [edi + 0x7590]
add ecx, 3
mov dword [ebp - 4], ecx
mov ecx, dword [ebp - 0x14]
inc ecx
cmp ecx, eax
mov dword [ebp - 0x14], ecx
jl 0x51b2a3
xor ecx, ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [edx]
mov edx, dword [ebp - 4]
add edx, 3
cmp edx, eax
jb 0x51b428
and eax, 1
cmp al, 1
jne 0x51b41a
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
js 0x51b410
mov eax, dword [esi]
mov byte [eax], 0
mov eax, dword [esi]
inc eax
mov dword [esi], eax
jmp 0x51b41a
push esi
push ecx
call sub.MSVCRT.dll__flsbuf
add esp, 8
mov eax, dword [ebp - 0x18]
add eax, 4
xor ecx, ecx
mov dword [ebp - 0x18], eax
mov dword [ebp - 4], ecx
mov eax, dword [ebp - 0x24]
mov edx, dword [edi + 0x7594]
inc eax
cmp eax, edx
mov dword [ebp - 0x24], eax
jl 0x51b292
mov edx, dword [edi + 0x7590]
mov dword [ebp - 0xc6], ebx
mov dword [ebp - 0xde], edx
mov edx, dword [edi + 0x7594]
mov dword [ebp - 0xd2], edx
mov edx, dword [ebp + 8]
add ebx, 6
mov dword [ebp - 0xa6], edx
shl edx, 2
mov dword [ebp - 0xa2], ebx
mov dword [ebp + 0xc], edx
add ebx, edx
mov edx, dword [ebp - 8]
mov dword [ebp - 0x8a], edx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x82], edx
mov edx, dword [ebp + 0xc]
mov eax, 1
mov dword [ebp - 0x7e], ebx
add ebx, edx
push esi
mov dword [ebp - 0xee], eax
mov dword [ebp - 0xe2], eax
mov dword [ebp - 0xd6], eax
mov dword [ebp - 0xbe], eax
mov dword [ebp - 0xba], eax
mov dword [ebp - 0xb2], eax
mov dword [ebp - 0x9a], eax
mov dword [ebp - 0x8e], eax
mov dword [ebp - 0x76], eax
mov dword [ebp - 0x6a], eax
mov dword [ebp - 0x5e], eax
mov dword [ebp - 0x5a], eax
mov dword [ebp - 0x52], eax
push eax
mov dword [ebp - 0x4a], ecx
mov dword [ebp - 0xea], ecx
mov dword [ebp - 0x72], ebx
lea eax, [ebp - 0xf4]
mov ecx, 3
mov edx, 5
add ebx, 8
push 0xae
push eax
mov word [ebp - 0xf4], 0xe
mov word [ebp - 0xf2], 0xfe
mov word [ebp - 0xf0], 4
mov word [ebp - 0xe6], pe_nt_image_headers32
mov word [ebp - 0xe4], cx
mov word [ebp - 0xda], 0x101
mov word [ebp - 0xd8], cx
mov word [ebp - 0xce], 0x102
mov word [ebp - 0xcc], cx
mov dword [ebp - 0xca], ecx
mov word [ebp - 0xc2], 0x103
mov word [ebp - 0xc0], cx
mov word [ebp - 0xb6], 0x106
mov word [ebp - 0xb4], cx
mov dword [ebp - 0xae], 2
mov word [ebp - 0xaa], 0x111
mov word [ebp - 0xa8], 4
mov word [ebp - 0x9e], 0x115
mov word [ebp - 0x9c], cx
mov dword [ebp - 0x96], ecx
mov word [ebp - 0x92], 0x116
mov word [ebp - 0x90], 4
mov word [ebp - 0x86], 0x117
mov word [ebp - 0x84], 4
mov word [ebp - 0x7a], 0x11a
mov word [ebp - 0x78], dx
mov word [ebp - 0x6e], 0x11b
mov word [ebp - 0x6c], dx
mov dword [ebp - 0x66], ebx
mov word [ebp - 0x62], 0x11c
mov word [ebp - 0x60], cx
mov word [ebp - 0x56], 0x128
mov word [ebp - 0x54], cx
mov dword [ebp - 0x4e], 2
call sub.MSVCRT.dll_fwrite
mov dword [ebp - 0x20], 8
push esi
push 1
lea ecx, [ebp - 0x20]
push 2
push ecx
call sub.MSVCRT.dll_fwrite
push esi
push 1
lea edx, [ebp - 0x20]
push 2
push edx
call sub.MSVCRT.dll_fwrite
push esi
push 1
lea eax, [ebp - 0x20]
push 2
push eax
call sub.MSVCRT.dll_fwrite
mov eax, dword [ebp + 8]
add esp, 0x40
test eax, eax
jle 0x51b67a
mov ebx, dword [ebp - 0x1c]
mov dword [ebp + 0xc], eax
push esi
push 1
push 4
push ebx
call sub.MSVCRT.dll_fwrite
mov eax, dword [ebp + 0xc]
add esp, 0x10
add ebx, 4
dec eax
mov dword [ebp + 0xc], eax
jne 0x51b639
mov eax, dword [ebp + 8]
test eax, eax
jle 0x51b67a
mov ebx, dword [ebp - 0x10]
mov dword [ebp + 8], eax
push esi
push 1
push 4
push ebx
call sub.MSVCRT.dll_fwrite
mov eax, dword [ebp + 8]
add esp, 0x10
add ebx, 4
dec eax
mov dword [ebp + 8], eax
jne 0x51b660
push esi
push 1
lea ecx, [ebp - 0xc]
mov ebx, 0x48
push 4
push ecx
mov dword [ebp - 0xc], ebx
call sub.MSVCRT.dll_fwrite
push esi
push 1
lea edx, [ebp - 0xc]
push 4
push edx
mov dword [ebp - 0xc], 1
call sub.MSVCRT.dll_fwrite
push esi
push 1
lea eax, [ebp - 0xc]
push 4
push eax
mov dword [ebp - 0xc], ebx
call sub.MSVCRT.dll_fwrite
push esi
push 1
lea ecx, [ebp - 0xc]
push 4
push ecx
mov dword [ebp - 0xc], 1
call sub.MSVCRT.dll_fwrite
mov al, byte [edi + 0x10]
add esp, 0x40
test al, 8
push esi
je 0x51b6ed
call sub.MSVCRT.dll_fflush
add esp, 4
xor eax, eax
lea esp, [ebp - 0x100]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call sub.MSVCRT.dll_fclose
add esp, 4
xor eax, eax
lea esp, [ebp - 0x100]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret